Visible a label with checkbox option


I am editing the “Aged Accounts Receivable” report. There the customer name is displaying in the report.

I need to put a check box in options tab and use it to make the customer name visible when check it and customer name hide when uncheck the check box.

I am new to C/AL development. Therefore please be kind enough to explain it to me step by step.

Thanks a lot.

Hi Thimira,

Let me know which version of NAV you are using?


Nav 2009 R2



There are plenty of places which shows customer name in ‘Aged Accounts Receivable’ report. Which part do you want to hide/show according to the check box? Screen short of report sections will be more helpful.


Yes…i the report there are two places for each and every customer.

1.In the beginning

2.End stating the total amount

I need to display and hide these two labels with the check box selection.

Please tell me all the steps step by step as I am new to this. A picture of the said report is attached below.

Thanks a lot.

Hey… Don’t provide customer real information. It will be a problem for you. So, you can ask admin to delete this post.

Step 1- First you have to create a Boolean type global variable.

Step 2- Insert checkbox into option tab of request page of the report.

Step 3- Bind the global variable to check box.(through SourceExpr property of check box)

Step 4- Find the correct data item to write the code. For that you have to check report sections. By referring that you can identify how the report is designed and what data is displaying. According to Agee Accounts Receivable report I understand you can use ‘OnAfterGetRecord()’ of Customer data item.

Step 5- End of the trigger you can write the code to make visible/invisible of customer name according to your checkbox.


Customer.Name := ’ ';

To do this you need to have basic knowledge on MS Dynamics NAV report development. I recommend you to read training manual.


Hello Hansi,

Many thanks.

I created the global variable. Put a checkbox. Assigned the global variable to the checkbox.

But I can’t find the ‘OnAfterGetRecord()’ trigger.

Do I need to select the checkbox and go to cal code.

then I find OnActivate, Ondeactivate, Onpush, Onvalidate fuctions only.

Please tell me how to use this code in my CA/L program.

Thanks a lot.

Hi Thimira,

It is not in the report request page. You have to go to report designer as follows. Then select the data item you want and press ‘C/AL Code (F9)’ to go to it’s C/L code.



Hay I strongly recommend you to read the training manual to start. Otherwise you will be in a problem. :smiley:

Hi Hansi,

Many thanks…Yes it works… :slight_smile: :slight_smile: :slight_smile:

This is my first C/AL code and it works fine…just because of your help…thanks again…

Yes…you re exactly right…I am learning it now…But I couldn’t find a proper training manual. Can you please tell me a good training manual for a beginner.

Thanks you very much.

Hey you can get tanning stuff from Microsoft Partner source or customer source.