Hello,
On a custom Inquiry form, that shows details related to item id and product name etc.., i added a new logic to retrieve item name, vendor name and sales price, after that i keep on getting error message when opening the form saying "Field 'Product' must be filled in. Field 'Item number' must be filled in." After i commented the research() and refresh() in my code, the error message didnt show anymore when opening the form, but when i try to filter, it didnt allow me and shows this error. this form is a custom ISV FORM, thats why the code is on the activated event handler because i had to extend. so please if anyone can help me resolve it.
here is my code:
-------------------
[FormDataSourceEventHandler(formDataSourceStr(DPPdsInventBatchShelfLifeByWHS, InventBatch), FormDataSourceEventType::Activated)]
public static void InventBatch_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
FormRun formRun = sender.formRun();
if (formRun)
{
FormDataSource inventBatchDS = formRun.dataSource(formDataSourceStr(DPPdsInventBatchShelfLifeByWHS, InventBatch));
if (inventBatchDS)
{
// inventBatchDS.executeQuery();
InventBatch inventBatchRec = inventBatchDS.getFirst();
while (inventBatchRec)
{
if (inventBatchRec.SearchName == "" || inventBatchRec.SearchName == null && inventBatchRec.VendName == "" || inventBatchRec.VendName == null)
{
InventTable inventTableRec;
select firstonly NameAlias, PrimaryVendorId from inventTableRec
where inventTableRec.ItemId == inventBatchRec.ItemId;
if (inventTableRec && inventTableRec.NameAlias != "")
{
inventBatchRec.SearchName = inventTableRec.NameAlias;
}
if (inventTableRec && inventTableRec.PrimaryVendorId != "")
{
inventBatchRec.VendName = inventTableRec.PrimaryVendorId;
}
}
if (inventBatchRec.Amount == 0.0)
{
PriceDiscTable priceDiscRec;
InventTable inventTableRec;
select firstonly Amount from priceDiscRec
where priceDiscRec.ItemCode == PriceDiscProductCodeType::Table
&& priceDiscRec.ItemRelation == inventBatchRec.ItemId;
if (priceDiscRec && priceDiscRec.Amount != 0.0)
{
inventBatchRec.Amount = priceDiscRec.Amount;
}
}
inventBatchRec = inventBatchDS.getNext();
}
// inventBatchDS.refresh();
// inventBatchDS.research();
}
}
}