I am using insert_recordset to insert data in a custom table by using following query;
insert_recordset myTable (LineAmountMST,Qty, ItemId, InventDimId, InvoiceDate , InventSizeId, InventColorId , OperatingUnitID , COGS ) SELECT SUM(LineAmountMST), SUM(Qty), ItemId, InventDimId, InvoiceDate from CustInvoiceTrans JOIN CustInvoiceJour where CustInvoiceTrans.SalesId == CustInvoiceJour.SalesId && CustInvoiceTrans.InvoiceId == CustInvoiceJour.InvoiceId && CustInvoiceTrans.InvoiceDate == CustInvoiceJour.InvoiceDate && CustInvoiceTrans.numberSequenceGroup == CustInvoiceJour.numberSequenceGroup && CustInvoiceTrans.InvoiceDate >= start && CustInvoiceTrans.InvoiceDate <= end OUTER JOIN InventSizeId, InventColorId from InventDim where CustInvoiceTrans.InventDimId == InventDim.InventDimId OUTER JOIN OMInternalOrganization from RetailCustInvoiceJourTable group by RetailCustInvoiceJourTable.OMInternalOrganization, CustInvoiceTrans.ItemId, CustInvoiceTrans.inventdimid, CustInvoiceTrans.InvoiceDate , InventDim.InventSizeId, InventDim.InventColorId where CustInvoiceJour.RecId == RetailCustInvoiceJourTable.CustInvoiceJour OUTER JOIN InventTransOrigin where CustInvoiceTrans.InventTransId == InventTransOrigin.InventTransId OUTER JOIN sum(COGS) from KSPInventTransGrouped where CustInvoiceTrans.InvoiceId == KSPInventTransGrouped.InvoiceId && InventTransOrigin.RecId == KSPInventTransGrouped.InventTransOrigin;
but it is showing following errors;
Any solution to resolve this issue?
Multiple lines have no record.
OperatingUnitId = OMInternalOrganization
You're getting values of OperatingUnitID and COGS from outer-joined data sources; I think that that one of them (or both) doesn't return any record, therefore the value is NULL. That's not a valid field value in F&O.
Hi Ashraf,
I think you have missed to add OperatingUnitId reference in the select statement.
Try to run the select statement separately and find which values are null.
Thanks,
Girish S.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156