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)

FreetextInvoice InvoiceTxt into CustTrans Txt

(0) ShareShare
ReportReport
Posted on by

Hi, would like to know is there way to get CustInvoiceLine.InvoiceTxt or CustInvoiceTrans.Name to insert into CustTrans.txt ?

I have traced the code for posting free text invoice, but somehow i am only able to trace it to the part where CustInvoiceLine.InvoiceTxt insert to  CustInvoiceTrans.Name. When the code reached the part where CustTrans.insert() is, CustTrans.txt was empty, and I could not get CustInvoiceTrans/Line from there. 

The part of the code im stuck in. 

class\CustVendVoucher.post

In the class (or anywhereelse), how can i retrieve the Invoice desc (CustInvoiceLine.InvoiceTxt or CustInvoiceTrans.Name) and update it into CustTrans.txt? 

Much appreciated! Thanks a million!

Regards

Gary

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    This is happening already in standard AX.

    you can debug standard AX, to know the facts

    AOT\Data Dictionary\Tables\CustInvoiceTrans\Methods\initFromCustInvoiceLine

    now notice down following line of code

    this.Name               = _custInvoiceLine.InvoiceTxt;

  • Community Member Profile Picture
    on at

    hi. this is the part that i found. but this part of code only save it to CustInvoiceTrans, correct? later part of the code, i could not find a way to retrieve it and save it into CustTrans.txt

    please advise

  • Brandon Wiese Profile Picture
    17,788 on at

    Gary,

    Is it possible that your Free text invoice will have more than one line?  If so, WHICH line should get copied to CustTrans?

  • Community Member Profile Picture
    on at

    Hi Brandon,

    the free text invoice may have few lines. each line's invoicetxt has to be insert into custtrans.txt. in the current posting engine, invoicetxt was not brought into custtrans.

  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    I don't think you can count on each line's InvoiceTxt field fitting into the one CustTrans.Txt field.  I don't think you've properly grasped the problem that you are only going to have a single CustTrans record when the invoice is posted.  It doesn't make any sense to combine many lines of InvoiceTxt into a single CustTrans.Txt field, and it probably won't all fit most of the time.

  • Community Member Profile Picture
    on at

    Hi Brandon,

    Thanks for your advise. You are right. I was under the wrong impression that each line in Freetext Invoice creates a line in CustTrans.  

    Based on the client's business process, they will only create one line of free text invoice. So, i can just "append" the invoicetxt into CustTrans.txt

    Thanks!

    Gary

  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    In that case, you want to modify the CustVendVoucher.setTransactionTxt(..) method.  In the case statement, focus on the section for LedgerTransTxt::CustInvoiceCust.  You'll notice that the CustInvoiceTable is already found for you.  Do a select firstonly CustInvoiceLine where CustInvoiceLine.ParentRecId == custInvoiceTableLocal.RecId and return the InvoiceTxt field as desired.

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
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans