HOW TO MANDATORY THE LINE AND VOUCHER NARRATION IN JOURNAL VOUCHER

“Gen.J Narration”.RESET;
“Gen.J Narration”.SETRANGE(“Journal Batch Name”,“Journal Batch Name”);
“Gen.J Narration”.SETRANGE(“Journal Template Name”,“Journal Template Name”);
//“Gen.J Narration”.SETRANGE(“Document No.”,“Document No.”);
IF “Gen.J Narration”.FINDFIRST THEN REPEAT
IF (“Gen.J Narration”.“Gen. Journal Line No.”=0) AND (“Gen.J Narration”.Narration=’’) THEN
ERROR(‘Sorry! Line Narration is blank’);
IF (“Gen.J Narration”.“Gen. Journal Line No.”<>0) AND (“Gen.J Narration”.Narration=’’) THEN
ERROR(‘Sorry! Voucher Narration is blank’);
UNTIL “Gen.J Narration”.NEXT=0
//END
ELSE IF NOT “Gen.J Narration”.FINDFIRST THEN
ERROR(‘Sorry!Sorry!Sorry! No Voucher or Line Narration Exist’);

{

I TRIED THIS CODE BUT THIS IS NOT WORK PROPERLY, IT’S ONLY SHOW THE ERROR WHEN BOTH LINE AND VOUCHER NARRATION ARE NOT THERE.BUT IN THE CASE OF ANY ONE IS EMPTY IT’S NOT SHOW ANY ERROR FOR THE SPECIFIC ONE. WHAT SHOULD I DO?KINDLY HELP.

}

Instead of ‘AND ’ try with ‘OR’ so it will check either or
“Gen.J Narration”.RESET;
“Gen.J Narration”.SETRANGE(“Journal Batch Name”,“Journal Batch Name”);
“Gen.J Narration”.SETRANGE(“Journal Template Name”,“Journal Template Name”);
//“Gen.J Narration”.SETRANGE(“Document No.”,“Document No.”);
IF “Gen.J Narration”.FINDFIRST THEN REPEAT
IF (“Gen.J Narration”.“Gen. Journal Line No.”=0) OR (“Gen.J Narration”.Narration=’’) THEN
ERROR(‘Sorry! Line Narration is blank’);
IF (“Gen.J Narration”.“Gen. Journal Line No.”<>0) OR (“Gen.J Narration”.Narration=’’) THEN
ERROR(‘Sorry! Voucher Narration is blank’);
UNTIL “Gen.J Narration”.NEXT=0
//END
ELSE IF NOT “Gen.J Narration”.FINDFIRST THEN
ERROR(‘Sorry!Sorry!Sorry! No Voucher or Line Narration Exist’);

Thanks for your reply sir.

I tried this before but it’s not working

Kindly paste your code after changing from AND to OR so we will get an idea

Sir I solve this problem by using setrange the Gen. Journal Line No. and check for narration is blank or not.And the problem is being solved.
Thank you.

Sir I solve this problem by using setrange the Gen. Journal Line No. and check for narration is blank or not.And the problem is being solved.
Thank you.