Launch Form

Hari,

I haven’t written Activate event, I suggested Activated. So, try

// End Wizard Added Custom Method Calls
POEntryForm.Activated += POEntryForm_Activated;

(…)
private void POEntryForm_Activated(object sender, EventArgs args)
{
// Add Event Handler Code
POAdapter objPO = new POAdapter(oTrans);
objPO.BOConnect();
if (POEntryForm.LaunchFormOptions != null)
{
if (POEntryForm.LaunchFormOptions.ValueIn != null)
{
string PONum = Convert.ToString(POEntryForm.LaunchFormOptions.ValueIn);
if (objPO.GetByID(PONum) == true) → Why?
{
SearchOptions searchOpts = new SearchOptions(SearchMode.AutoSearch);
bool blnMorePages = true;
searchOpts.DataSetMode = DataSetMode.RowsDataSet;
searchOpts.PreLoadSearchFilter = "PONum = " + PONum;
oTrans.InvokeSearch(searchOpts);
oTrans.Refresh();
//objPO.GetRows(searchOpts, out blnMorePages); → Why?
searchOpts = null;
}
}
}
}
EDIT.
Can’t properly format my post…hummm

1 Like