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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Option Type

(0) ShareShare
ReportReport
Posted on by 4,824

Hi Expert, 

I created a new field which has several options (A,B,C,D) in the customer table.
If option is A then, change the salesperson code from x to  y.


"Account Type" := Customer."Account Type";

If "Account Type" := "Account Type":: A Then
xxxxx

The salesperson code has changed, but it also change the type which is B,C,D.

Please advise! Thank you

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Then you have to put the code in the OnValidate trigger of your account type field.

    docs.microsoft.com/.../devenv-onvalidate-field-trigger

  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at

    Hi, please delete first line, "Account Type" := Customer."Account Type";

    And try the following.

    If Rec."Account Type" := Rec."Account Type":: A Then
    xxxxx

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    Please remove the below marked line from your code.

    "Account Type" := Customer."Account Type";

    If "Account Type" := "Account Type":: A Then

    xxxxx

  • snoppy Profile Picture
    4,824 on at

    No, it does not work even though the line was removed. Thank you!

  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at

    Hi, because of the limited information you have given, we may not be able to give the correct answer.

    From your code, this code can be placed in the OnValidate (Field) Trigger of "Account Type" field, please make sure it is in the right place.

    Hope this helps as well.

    Thanks.

    ZHU

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans