Skip to main content

Notifications

Announcements

No record found.

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"

Posted on by 1,835

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
    ShanAbeywicrema 940 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
    manish.yadav 1,835 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
    Mohana Yadav 59,139 Super User 2024 Season 2 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
    manish.yadav 1,835 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
    Mohana Yadav 59,139 Super User 2024 Season 2 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
    manish.yadav 1,835 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
    ShanAbeywicrema 940 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
    Mohana Yadav 59,139 Super User 2024 Season 2 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
    Ahmed Mohamed Rafik 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
    manish.yadav 1,835 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans