Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

link customer and sales person on sales order

Posted on by Microsoft Employee

hi.

i want to link customer and sales person on sales order, for this goal, i set each customer with sales person in customer from, but when i create a sales order and select a customer, it is possible to change sales person and i want to be a relation between customer and sales person that no body can change it. have solution?

Regards

*This post is locked for comments

  • RE: link customer and sales person on sales order

    Muchas gracias por su aporte. Fue de gran ayuda!

    Thank you for your contribution was helpful!

  • Verified answer
    Denis Macchinetti Profile Picture
    Denis Macchinetti 16,444 on at
    RE: link customer and sales person on sales order

    Hi

    Modify the initFromCustTableIL method of the SalesTable Table.

    Add the line below to the bottom of the method:

    this.WorkerSalesResponsible = this.custTable_CustAccount().MainContactWorker;

    Launch Incremental CIL.

    If you want to follow the best practices, you have to create a new Event Handler Subscription, set the CalledWhen property to Post and move the code in the new class\method.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    Hi NITESH RANJAN. i do what you say, but it works like my code. sales responsible on form has value and when i select customer on salescreateorder form, field sales responsible get null.

    regards

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    hmmm...

    this.WorkerSalesResponsible = DirPartyTable::findRec(contactPerson::find(custTable::find(custTable.AccountNum).ContactPersonId).recId).recId

    Find this, and check if this works

    Actually you need to find out worker RecId of Contact person, which is same as DirPartyTable recID

    Please verify this and update if it works..

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    in CustTable, field "MainContactWorker" is field Employee Responsible on form customer. i want this field be retrieved when i select customer on form  "SalesCreateOrder", and replace on sales responsible field that is on "SalesCreateOrder" form. what can i do?

    Regards

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    hi. i do what you say before but get error  that Operand types are not compatible with the operator.

    this.WorkerSalesResponsible = custTable::find(custTable.AccountNum).ContactPersonId;

    Regards

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    I don't think MainContactWorker is the correct field it should be ContactPersonId

    Please try using this field.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    Hi.

    I provide just this code on initfromcusttable method but when i select customer, sales responsible doesn't field in, and get null value.

    regards

       if (this.CustAccount)

       {

           this.WorkerSalesResponsible = custTable::find(custTable.AccountNum).MainContactWorker;

       }

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    You have ContactPerson Table

    You can find record in Contact Person Table related to CustAccount as per you SalesTable.

    Please verify and update this helps you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: link customer and sales person on sales order

    Hi.

    how can i find  customer's contact person in the method initfromCustTable()?

    regards

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans