Hi,
I got this error whenever I'm trying to add or edit SalesLine record in SalesTable form.
When I debug, this error always comes from fixCurrentLineInRetailTmpOrderItem method in RetailSalesOrderCalculator class. The highlighted line is where the error being triggered:
private void fixCurrentLineInRetailTmpOrderItem()
{
UserId userId = curUserId();
ItemId currentItemId = currentSalesLine.ItemId;
RetailValidationId currentRetailVariantId = currentSalesLine.RetailVariantId;
// The current sales line may not have been saved yet.
if (currentRetailVariantId)
{
select firstOnly RecId from tempOrderItem
where tempOrderItem.ItemId == currentItemId
&& tempOrderItem.retailVariantId == currentRetailVariantId;
if (!tempOrderItem)
{
tempOrderItem.clear();
tempOrderItem.ItemId = currentItemId;
tempOrderItem.retailVariantId = currentRetailVariantId;
tempOrderItem.insert();
}
}
else if (currentItemId)
{
select firstOnly RecId from tempOrderItem
where tempOrderItem.ItemId == currentItemId;
if (!tempOrderItem)
{
tempOrderItem.clear();
tempOrderItem.ItemId = currentItemId;
tempOrderItem.insert();
}
}
}
I don't understand what's wrong with that line since tempOrderItem.retailVariantId and salesLine.RetailVariantId is the same data type. And I don't see any mapping problem either since these two fields are standard fields and mappings are already added accordingly.
I have run out of ways to tackle this problem. Please help.
Thank You.
*This post is locked for comments
I have the same question (0)