Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

I added enum field in all customers(CustTable) form and sales order(Sales Table). In sales order enum field value should come from customer master for the associated customer for the sales order

Posted on by 35

Create a enum field named as "ABC code" and create enum value as below and Add this enum field in the customer master in general tab -

a) None b) A C) B D) C

Add ABC code in the sales order and this value should come from customer master for the associated customer for the Sales order.

Can you please help me

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,540 Super User on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    No need to declare VendTable buffer again. I think you are trying to re-use code I provided earlier for custTable. Please note that initFromCustTable method does not have CustTable table buffer as parameter but initFromVendTable have vendTable buffer which should be used. Code provided by Girish will work.

    If Fixed, don't forget to Verify answer/s that helped you by clicking Yes to Did this answer your question?

  • learner.d365 Profile Picture
    learner.d365 35 on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    Thank you Girish S

  • GirishS Profile Picture
    GirishS 27,828 Super User on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    You already have vendTable buffer in the argument of the method. Just use that buffer and see if it works.

    [ExtensionOf(tableStr(PurchTable))]
    
    public final class PurchTable_Extension
    
    {
    
    public void initFromVendTable(VendTable _vendTable)
    
    {
    
    next initFromVendTable();
    
    this.ABCcode = _vendTable.ABCCode;
    
    }
    
    

    Thanks,

    Girish S.

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,540 Super User on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    You can add breakpoint in add method of info class and in call stack check where its throwing this error.

  • learner.d365 Profile Picture
    learner.d365 35 on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    [ExtensionOf(tableStr(PurchTable))]

    public final class PurchTable_Extension

    {

    public void initFromVendTable(VendTable _vendTable)

    {

    next initFromVendTable();

    VendTable vendtable = this.vendTable_OrderAccount();

    this.ABCcode = VendTable.ABCCode;

    }

    In this line I'm getting error while Debugging

    VendTable vendtable = this.vendTable_OrderAccount()

  • GirishS Profile Picture
    GirishS 27,828 Super User on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    You need to debug the code and find out on which line the error is throwing.

    Thanks,

    Girish S.

  • learner.d365 Profile Picture
    learner.d365 35 on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    I'm trying for same requirement in vendtable(all vendors) and pruchtable (all purchase orders) but I'm getting error while creating new purchase order "object reference is not set to an instance of an object".

    Here in this requirement I need to change the code or some other process.

    Can you give an idea for this

    Kind regards

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,540 Super User on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    learner.d365 That's great, please mark answer verified.

  • learner.d365 Profile Picture
    learner.d365 35 on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    Thank you very much Girish S for your information.

  • learner.d365 Profile Picture
    learner.d365 35 on at
    RE: I added same field in all customers form and sales order . In sales order form field value should come from customer form.

    Thank you very Mohit Rampal

    You have given code is working fine.

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... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans