Coding for ERROR message

SUDARSANSUDARSAN Member Posts: 7
edited 2014-06-10 in NAV Three Tier
I'm having a requirement in Report

I created a report for salesperson, If there is no record for that salesperson the table is non showing.

My need is, instead of displaying empty report, I need ERROR message

Comments

  • geordiegeordie Member Posts: 655
    In my opinion this question involves very basic C/AL programming knowledge: did you at least read the introduction to C/AL development available on MSDN before posting?
  • vivek4121vivek4121 Member Posts: 165
    In the PreDataItem Trigger of the Report, Write Something Like that :

    SalespersonPurchaser.SETFILTER("Commission %",'>0'); // Filter Depending on your Requirement
    IF SalespersonPurchaser.FINDFIRST THEN
    // do something
    ELSE
    ERROR('No records exists'); // Which you want to Specify


    Thanks
    Vivek
  • KishormKishorm Member Posts: 921
    You could simplify this by just adding the following code to the OnPreDataItem Trigger of the Report...

    IF ISEMPTY THEN
    ERROR('No records exist');

    ...this way it will use the filters that the report is using.
Sign In or Register to comment.