Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

restrict narration in cash payment voucher in navision 2016

(1) ShareShare
ReportReport
Posted on by 4

Dear Experts,

I want to add a restriction in cash payment voucher payment page if user not inserted the narration he will not be able to take preview post.

please help..below code is written..but it is not working

GenJournalNarration.RESET;
GenJournalNarration.SETRANGE("Journal Template Name",'CASH PAYME');
GenJournalNarration.SETRANGE("Journal Batch Name",'KKOLA-CP-A');
GenJournalNarration.SETRANGE("Document No.",Rec."Document No.");
GenJournalNarration.SETFILTER("Line No.",'<>%1',0);
//GenJournalNarration.SETRANGE("Gen. Journal Line No.",Rec."Line No.");
//GenJournalNarration.SETRANGE("Line No.",Rec."Line No.");
 IF GenJournalNarration.FINDFIRST THEN BEGIN
IF GenJournalNarration.Narration='' THEN BEGIN
GenJournalNarration.TESTFIELD(Narration);
END;
END;

  • RE: restrict narration in cash payment voucher in navision 2016

    your code is not working ...But I have resolved it from myself..I have amended my code like..

    CurrPage.SETSELECTIONFILTER(Rec);

    IF Rec.FINDFIRST THEN REPEAT

       GenJournalNarration.RESET;

       GenJournalNarration.SETCURRENTKEY("Journal Template Name","Journal Batch Name","Document No.");

       GenJournalNarration.SETRANGE("Document No.",Rec."Document No.");

       GenJournalNarration.SETRANGE("Journal Template Name",'CASH PAYME');

       GenJournalNarration.SETRANGE("Journal Batch Name",'KKOLA-CP-A');    

        IF NOT GenJournalNarration.FINDFIRST THEN

           GenJournalNarration.TESTFIELD(Narration);

    UNTIL Rec.NEXT=0;

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: restrict narration in cash payment voucher in navision 2016

    Hi,

    you can try this way.

    GenJournalNarration.RESET;
            GenJournalNarration.SETRANGE("Journal Template Name", 'CASH PAYME');
            GenJournalNarration.SETRANGE("Journal Batch Name", 'KKOLA-CP-A');
            GenJournalNarration.SETRANGE(Narration, '');
            IF not GenJournalNarration.isempty THEN
                Error('Your message here.');
    

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans