web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Custom Fields in SalesLine Delivery Schedule

(0) ShareShare
ReportReport
Posted on by 1,214

Hi,

I have some custom fields in SalesLine table. 

I created a SalesLine then split the line with multiple delivery schedule lines. 

deliveryschedule.png

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)
  • Verified answer
    HAIRUL HAZRI Profile Picture
    1,214 on at

    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;
    
        }


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans