I have created a simple table SaleslineEx. which has a foreign key relationship with the SalesLine table.
When trying to create a new record in the sales line, the SalesLineEx sales line field does not populate with the sales line record.
I have tried different solutions from the blogs but they are not working. Can anyone give me a solution?
I was able to resolve this issue by creating the mapping between my extension table and the SalesLine
using SysExtensionSerializerExtensionMap
.
After adding the mappings create an Extension class for the SalesLine
table, and create a COC method for the insert
method. Call the insert operation of the Extension table after the next call of the sales line insert
method, using SysExtensionSerializerExtensionMap
class from the extension table buffer is shown below.
next insert(_dropInvent, _findMarkup, _childBuffer, _skipCreditLimitCheck, _skipWHSProcesses, _interCompanyInventTransId);
if(FormDataUtil::isFormDataSource(this))
{
SalesLineExt salesLineExt = this.SysExtensionSerializerMap::getExtensionTable(tableNum(SalesLineExt));
salesLineExt.SysExtensionSerializerExtensionMap::insertAfterBaseTable(this);
}