SalesLine salesLine;
InventDim inventDim;
// Update all sales lines for this order with the specified field value
while select forupdate salesLine
where salesLine.SalesId == _salesId
{
// Use transaction control to ensure data consistency
ttsbegin;
// Load the related inventory dimension record
inventDim = salesLine.inventDim();
// Update the inventory dimension field
inventDim.(_salesLineFieldId) = _fieldValue;
// Update the inventory dimension record
salesLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
salesLine.doUpdate();
ttscommit;
}

Report
All responses (
Answers (