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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
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;

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,794 Moderator on at

    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.');
    

  • NAV_BC_Developer Profile Picture
    4 on at

    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;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,711 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 998 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 635 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans