Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
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,547 Super User 2024 Season 1 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,832 Super User 2024 Season 1 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,547 Super User 2024 Season 1 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,832 Super User 2024 Season 1 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,547 Super User 2024 Season 1 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.

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

Product updates

Dynamics 365 release plans