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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Post a custom field to VendTrans through Pending vendor invoices ?

(0) ShareShare
ReportReport
Posted on by 3,805

Hi all..

i have custom field in form Pending vendor invoice in table VendInvoiceInfoTable.

i want, if i click button Post, my custom field send to table VendTrans and i can see in form Open vendor invoices.

i try open class PurchFormLetter_Invoice, but i don't know, where i can put my custom field.

please help me..

Thanks..

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi PIL,

    Please refer to this thread discussing same change community.dynamics.com/.../223067

  • fajar Profile Picture
    3,805 on at

    thanks ievgen..

    i was try before post this forum.

    i try like this.

    here's the code so far in VendVoucher class :

    public PIL_SPPNumber parmSPP(PIL_SPPNumber _SPP = xSPP)

    {

    xSPP= _SPP;

    return xSPP;

    }

    initCustVendTrans method :

    If(_custVendTrans.TableId == tableNum(VendTrans))

    {

    _custVendTrans.PIL_SPPNumber = xSPP;

    }

    the post method has this code :

    this.parmSPP(_vendTrans.PIL_SPPNumber )

    But, if i click button Post in form Pending vendor invoices, and then i check in table vendTrans, value for field PIL_SPPNumber is null.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Probably you can place your custom code in the method postCustVend of class PurchInvoiceJournalPost as this method has access to the table buffer VendInvoiceInfoTable and creates the record in VendTrans table.

    VendInvoiceInfoTable.jpg

    Check the call stack below.
                                                                                              Line#s
    \Data Dictionary\Tables\VendTrans\Methods\insert          7
    \Classes\CustVendVoucher\post                                        464
    \Classes\VendVoucher\post                                                20
    \Classes\PurchInvoiceJournalPost\postCustVend               132

  • Mea_ Profile Picture
    60,286 on at

    And you compiled everything and did CIL, as per post I referred ?

  • fajar Profile Picture
    3,805 on at

    No, oke i will Full CIL now and try again.

  • fajar Profile Picture
    3,805 on at

    Thanks..

    so, i just place my custom code in method postCustVend of class PurchInvoiceJournalPost ?

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Yes if my understanding is correct from your requirement then please try the following code in method postCustVend:

    VendTrans.PIL_SPPNumber = vendInvoiceInfotable.xSPP;

    before the statement

    vendVoucher.post(ledgerVoucher,
    vendTrans,
    this.approval(),
    Currency::noYes2UnknownNoYes(vendInvoiceJour.Triangulation),
    false,
    true);
  • fajar Profile Picture
    3,805 on at

    i try compile all and not found Error, and then i try CIL, success.

    and then i try Post invoice from pending vendor invoices, but value is null in my field in table vendTrans.

    What can i do, help..

  • Mea_ Profile Picture
    60,286 on at

    It could be a good idea to debug. Also you can provide code that you have, so we can take a look and say what is wrong

  • fajar Profile Picture
    3,805 on at

    Thanks Chaitanya,

    i try following your code, but nothing happend if i try Post pending vendor invoices.

    Please help..

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans