Requirement: I need to display the status per SO Line – which lines are still on open order, picked, packed or invoiced (we invoice per sales line).
Problem: One of my enum values is not passing – nothing fancy, just as simple assignment from view to temporary table. The enum value does seems to be “NOT being saved into the temp table”. What am I missing here? I hope someone can help.
On my temp table, the column has enum type of XXX_APG_ECOStatus(acquired from SalesLineStatus on an AOT view)
The enum contains these elements.
When retrieving the search result, ECOStatus (or Sales Line Status) does not yield.
I checked my temp table, the value is not indeed existing.
I am sure I set my datasource correctly.
I went to check by breaking point every affected line; I even made another column and a variable to make sure and see the data. Everything is fine. Both ecoResultTempTable.ECOStatus & ecoResultTempTable.SalesLineStatus are not being used or reassigned new values after these lines.
Nothing is fancy on my code – just a very simple straightforward assignment.
This issue also persists on other elements of the enum – not just “Open Order”.
What I already did but was NOT successful:
- Created a new column in temp table.
- Created a new column in the source query/view and took the value from there instead.
- Created and assigned an EDT for the affected enum both for temp table and the query/view.
- Cleared my usage data.
- Restarted my computer (to clear local cache)
- Restarted AX.
- Re-created this form.
- Re-created my query.
- Re-created my view.
- Praying and contemplating for hours on this. T.T
Full code below.
void clicked(){
XXXX_APG_ECOView ecoView;
XXXX_APG_ECOTempTable ecoResultTempTable;
XXXX_APG_ECOStatusType ecoStatus; /*temporary for debugging*/
;
if(XXXX_APG_ECOTempTable::ValidateFroToDates(lsdFrom, lsdTo)){
ttsBegin;
while select
SalesId
,CustAccount
,SalesName
,SoCreatedDate
,SalesStatus
,SalesConfirmStatus
,ShippingDateRequested
,RecId
,CostMatrix
,LCNo
,NCODate
,Expiry1
,Expiry2
,Expiry3
,NCO
,RefNo
,Packaging
,Brand
,CasesPerFCL
,ProductStatus
,LabelStatus
,CartonStatus
,configId
,PaymentTerm
,PaymTermId
,BGColor
,FGColor
,ItemId
,CanSize
,InventDimId
,ItemBOMId
,Media
,NetWeight
,PCW
,DrainedWeight
,SALT
,FLAKES
,OBR
,Tins
,DlvTerm
,LSDLatest
,LSD2
,LSD3
,Destination
,Freight
,ShippingNominations
,PackId
,PackQty
,PackDate
,InvoiceId
,InvoiceDate
,InvoiceQty
,PickQtySum
,PickLatestDate
,SalesOrderRecId
,SalesLineStatus
from ecoView
order by LSDLatest asc
where(
ecoView.LSDLatest >= lsdFrom /*declared from classdeclaration*/
&& ecoView.LSDLatest <= lsdTo /*declared from classdeclaration*/
) //end of where clause
{
/*Sales Header START*/
ecoResultTempTable.SalesId = ecoView.SalesId;
ecoResultTempTable.SORecId = ecoView.SalesOrderRecId;
ecoResultTempTable.CustAccount = ecoView.CustAccount;
ecoResultTempTable.SalesName = ecoView.SalesName;
ecoResultTempTable.SoCreatedDate = ecoView.SoCreatedDate;
ecoResultTempTable.SalesStatus = ecoView.SalesStatus;
ecoResultTempTable.SalesConfirmStatus = ecoView.SalesConfirmStatus;
ecoResultTempTable.ShippingDateRequested = ecoView.ShippingDateRequested;
/*Sales Header END*/
/*Sales Line START*/
/*General Setup START*/
ecoResultTempTable.CostMatrix = ecoView.CostMatrix;
ecoResultTempTable.LCNo = ecoView.LCNo;
ecoResultTempTable.NCODate = ecoView.NCODate;
ecoResultTempTable.Expiry1 = ecoView.Expiry1;
ecoResultTempTable.Expiry2 = ecoView.Expiry2;
ecoResultTempTable.Expiry3 = ecoView.Expiry3;
ecoResultTempTable.NCO = ecoView.NCO;
ecoResultTempTable.RefNo = ecoView.RefNo;
ecoResultTempTable.Packaging = ecoView.Packaging;
ecoResultTempTable.Brand = ecoView.Brand;
ecoResultTempTable.SalesQty = ecoView.CasesPerFCL;
ecoResultTempTable.ProductStatus = ecoView.ProductStatus;
ecoResultTempTable.LabelStatus = ecoView.LabelStatus;
ecoResultTempTable.CartonStatus = ecoView.CartonStatus;
ecoResultTempTable.Buyer = ecoView.configId;
ecoResultTempTable.PaymentTermName = ecoView.PaymentTerm;
ecoResultTempTable.PaymTermId = ecoView.PaymTermId;
ecoResultTempTable.BGColor = ecoView.BGColor;
ecoResultTempTable.FGColor = ecoView.FGColor;
ecoStatus = ecoView.SalesLineStatus;
ecoResultTempTable.ECOStatus = ecoStatus;
ecoResultTempTable.SalesLineStatus = ecoStatus;
/*General Setup END*/
/*Buyer specs START*/
ecoResultTempTable.ItemId = ecoView.ItemId;
ecoResultTempTable.CanSize = ecoView.CanSize;
ecoResultTempTable.InventDimId = ecoView.InventDimId;
ecoResultTempTable.BOMId = ecoView.ItemBOMId;
ecoResultTempTable.Media = ecoView.Media;
ecoResultTempTable.NetWeight = ecoView.NetWeight;
ecoResultTempTable.PCW = ecoView.PCW;
ecoResultTempTable.DrainedWeight = ecoView.DrainedWeight;
ecoResultTempTable.Salt = ecoView.SALT;
ecoResultTempTable.Flakes = ecoView.FLAKES;
ecoResultTempTable.OBR = ecoView.OBR;
ecoResultTempTable.Tins = ecoView.Tins;
/*Buyer specs END*/
/*Pick START*/
//TO-DO
/*Pick END*/
/*Ship START*/
ecoResultTempTable.DlvTerm = ecoView.DlvTerm;
ecoResultTempTable.LSDLatest = ecoView.LSDLatest;
ecoResultTempTable.LSD2 = ecoView.LSD2;
ecoResultTempTable.LSD3 = ecoView.LSD3;
ecoResultTempTable.Destination = ecoView.Destination;
ecoResultTempTable.Freight = ecoView.Freight;
ecoResultTempTable.ShippingNominations = ecoView.ShippingNominations;
/*Ship END*/
/*Invoice START*/
//TO-DO
/*Invoice END*/
/*Sales Line END*/
ecoResultTempTable.insert();
}
ttsCommit;
XXXX_APG_ECOTempTable_1_ds.research();
}//if statement end
}//click method end
*This post is locked for comments