Now, I have understood your requirement through your code mentioned above. Are you trying to get the batch id values from payables lookup window to your custom window field? Am I correct?
Here is the correct code for returning batch id from payables lookup window.
Microsoft.Dexterity.Applications.SmartListDictionary.PmBatchLookupForm PMLookUp = SmartList.Forms.PmBatchLookup;
PMLookUp.PmBatchLookup.SelectButton.ClickBeforeOriginal +=new CancelEventHandler(PMLookUpSelectButton_ClickBeforeOriginal);
private void btnLookUp_Click(object sender, EventArgs e)
{
try
{
Microsoft.Dexterity.Applications.SmartListDictionary.PmBatchLookupForm obj = SmartList.Forms.PmBatchLookup;
obj.Open();
obj.PmBatchLookup.BatchSource.Value = "PM_Trxent";
obj.PmBatchLookup.BatchNumber.Value = "BATCH_FIELD";
obj.PmBatchLookup.RedisplayButton.RunValidate();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
void PMLookUpSelectButton_ClickBeforeOriginal(object sender, CancelEventArgs e)
{
Microsoft.Dexterity.Applications.SmartListDictionary.PmBatchLookupForm PMLookUp = SmartList.Forms.PmBatchLookup;
//string Bathcid = PMLookUp.PmBatchLookup.BatchNumber.Value;
// This is the only line I have changed instead of your above line
string Bathcid = PMLookUp.PmBatchLookup.BatchLookupScrollingWindow.BatchNumber;
txtBatchId.Text = Bathcid; //Here I am getting BatchID is Empty;
}
Hope this the answer for your above requirement!!!