Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

(0) ShareShare
ReportReport
Posted on by 1,879

Dear Experts,

In bank receipt voucher

I want to set "Document Type" as a TESTFIELD for all account type except the "G/L Account". where i need to write the condition and please provide me the tips to write the condition.

7752.test01.png

*This post is locked for comments

  • Suggested answer
    ShanAbeywicrema Profile Picture
    944 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    What Mohana said is correct. All based on your requirement. You can user onaction trigger of the post button, before start the code you can place your own code which you have written .

    Testfiled gives you standard error message. If you do not like it, you can you ERROR instead of TESTFIELD.

  • manish.yadav Profile Picture
    1,879 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    Than you sir.

    I will confirm you tomorrow.

  • Verified answer
    Mohana Yadav Profile Picture
    60,209 Super User 2025 Season 1 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    if you want to have document type filled while selecting the Account Type. then you can write it in Account type onvalidate trigger

    or if you want it while trying to post then write it in post onaction trigger

  • manish.yadav Profile Picture
    1,879 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    Thank you for the timely reply.

    I write the logic something like that...but where I needs to write it.

    IF "Account Type"="Account Type" ::"Bank Account" THEN

     TESTFIELD("Document Type");

  • Suggested answer
    Mohana Yadav Profile Picture
    60,209 Super User 2025 Season 1 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    what code did you try?

  • manish.yadav Profile Picture
    1,879 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    yes sir, I want to use as a "Document Type" mandatory when the we do the bank related entry.

  • ShanAbeywicrema Profile Picture
    944 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    You can use TESTFIELD . Have you tried it ?

  • Suggested answer
    Mohana Yadav Profile Picture
    60,209 Super User 2025 Season 1 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    did you try writing TESTFIELD code under Post Action trigger of bank entry page?

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    3,049 User Group Leader on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    Hi MKY,

    You can refer to this thread as it this question answered before.

    community.dynamics.com/.../162390

    If you find this answer helpful, you can share it with community members as a Verified answer by click Yes.

  • manish.yadav Profile Picture
    1,879 on at
    RE: How to set document type is mandatory for all type of " account type" available in list except the "G/L Account"

    Dear Sir,

    For example when we post the bank entry always ask "Document Type Can Not be blank",

    but if we are doing the general entry there will be no message.

    I hope you can understand.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,099 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans