
Hi,
I have some custom fields in SalesLine table.
I created a SalesLine then split the line with multiple delivery schedule lines.
Section, Area1 and Area2 are the custom fields.
After splitting the line with delivery schedule, values of these custom fields are only copied into the first delivery line, not into the second, third and so on.
I want the values copied into every delivery lines, just like any other fields.
I found this SalesLine.initFromOrderLineWithMultipleDeliveries() method. So I tried to create it's post-event handler method but how can I do table buffer equivalent to
this.SectionCode = salesLine.SectionCode
in this post-event handler method?
So far I only able to hardcode the value like this:
[PostHandlerFor(tableStr(SalesLine), tableMethodStr(SalesLine, initFromOrderLineWithMultipleDeliveries))]
public static void SalesLine_Post_initFromOrderLineWithMultipleDeliveries(XppPrePostArgs args)
{
SalesLine thisSalesLine = args.getThis() as SalesLine;
thisSalesLine.SectionCode = "Section";
thisSalesLine.Area1 = "Area1";
thisSalesLine.Area2Code = "Area2";
thisSalesLine.Remarks = "Remarks";
//this.SectionCode = _salesLine.SectionCode;
}
Thank You.
*This post is locked for comments
I have the same question (0)I found the answer here.
So my final code is like this:
[PostHandlerFor(tableStr(SalesLine), tableMethodStr(SalesLine, initFromOrderLineWithMultipleDeliveries))]
public static void SalesLine_Post_initFromOrderLineWithMultipleDeliveries(XppPrePostArgs args)
{
SalesLine thisSalesLine = args.getThis() as SalesLine;
SalesLine dlvLine = args.getArg('_salesLine');
thisSalesLine.SectionCode = dlvLine.SectionCode;
thisSalesLine.Area1 = dlvLine.Area1;
thisSalesLine.Area2Code = dlvLine.Area2Code;
thisSalesLine.Remarks = dlvLine.Remarks;
}