Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

How do I initialize a field on the PurchParmLine table?

Posted on by 102

I have a field called ItemType that I added to the PurchParmLine table, the field must also be added in the PurchEditLines form and must automatically take the value from the PurhLine table. I tried to put the code on the initFromPurchLine method on the PurchParmLine table and on the initFromPurchLine method on the VendDocumetLineMap, but it is not displayed.  I created a relationship with PurchLine on the PurchParmLine table, but without result. The field is not even populated on the table PurchParmLine.

 pastedimage1671721193349v1.pngpastedimage1671721230972v2.pngpastedimage1671722080697v1.pngpastedimage1671721834095v4.png

  • GirishS Profile Picture
    GirishS 27,828 Super User on at
    RE: How do I initialize a field on the PurchParmLine table?

    Field does not exist error indicates that new field is not synced to DB. Try doing AOT synchronization and check.

    Also on the method createParmLine you are getting PurchLine as a buffer as a method parameter, So you can directly use that buffer to assign values to your custom fields in PurchParmLine table.

    Thanks,

    Girish S.

  • Pavel Ioana Profile Picture
    Pavel Ioana 102 on at
    RE: How do I initialize a field on the PurchParmLine table?

    pastedimage1671879842496v1.pngpastedimage1671880127167v2.png

    I tried to populate the field, but apparently the field on the PurchParmLine does not receive the value and says that the field does not exist even though it is added

  • GirishS Profile Picture
    GirishS 27,828 Super User on at
    RE: How do I initialize a field on the PurchParmLine table?

    There is class named "PurchFormLetterParmData" - createParmLine(Method name) - Try to populate your custom fields in this method.

    Also add the debugger point in the method and check whether the debugger is hitting.

    Thanks,

    Girish S.

  • Pavel Ioana Profile Picture
    Pavel Ioana 102 on at
    RE: How do I initialize a field on the PurchParmLine table?

    I used the debugger and it doesn't fit into any of the methods and I really don't know where I should place the code

  • GirishS Profile Picture
    GirishS 27,828 Super User on at
    RE: How do I initialize a field on the PurchParmLine table?

    Hi Pavel Ioana,

    Have you debugged the code and find out whether debugger is hitting in initFromPurchLine method.

    Thanks,

    Girish S.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans