Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Logic to update certain value in field

Posted on by 217

Dear Friends,

Can anyone suggest where to write the x++ code for the below scenario.

     I have added a field in the table "LedgerJournalTrans" by name "Branch" which holds the Branch segment value of the LedgerDimension of DefaultDimension. 

   Now I know the logic to update the field but my doubt is that where should I write the x++ code to update this field every time a process is run.

should I write in insert() method or update() method or in both, or is there any other way?

Regards

Martin.A

*This post is locked for comments

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Logic to update certain value in field

    Hey Martin Arul,

    I can see some misunderstanding of the process here. LedgerJournalTrans is a journal line, so it won't be created after posting, it's a document that is posted by AX. As the result of posting you will get ledger transactions.

    Let's back to my original question.

    What should trigger population of new field ?

    How do you create LedgerJournalTrans ?

    Do you need ledgerDimension to be populated if you will change value in new field ?

  • martinarul Profile Picture
    martinarul 217 on at
    RE: Logic to update certain value in field

    Dear Crispin John Augustine,

       I shall try in here. Thanks for the reply.

    Regards

    Martin.A

  • martinarul Profile Picture
    martinarul 217 on at
    RE: Logic to update certain value in field

    Dear Ievgen Miroshnikov,

        For example, when we post a ledger journal, records will be created in the table "LedgerJournalTrans". This table contains a field called "LedgerDimension" and while inserting the record the value for the field "LedgerDimension" will also be inserted. Now from the value of this "LedgerDimension" field I will extract the "Branch" segment value and write in a field called "BranchCode" which I created, in the same table "LedgerJournalTrans".

    I asked for this scenario as to where I can write the code.

    Regards

    Martin.A

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Logic to update certain value in field Ax 2012

    Hi Martin Arul,

    What process are you talking about ? Could you please elaborate your question and add some details ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans