Business Central

Wednesday, 4 September 2019

How to add progress bar window in D365 BC (Dynamics NAV)

When running the report everyone will be curious to know how long the report might run.
To track on at which level the report is processing the records we can run a progress bar in the foreground to have a better clarity of it.

Progress window can be displayed using the Open function of Dialog datatype.

Syntax:
Dialog.OPEN(String [, Variable1],...)

Few string parameters that can be considered in displaying progress bar:

1. Use a backslash (\) to start a new line.
2. Use number signs (#) to insert variable values into the string.
3. Place the number signs where you want to substitute the variable value.
4. Place a number in the part of the string where a variable value will be substituted

(Example, #1####) or (@1@@@@) to be able to reference this field for updating.

5. If you use @ characters instead of # characters, then the variable value is used as a percentage and both the percentage and a progress indicator are displayed. The percentage value that is displayed is the percentage of the variable value from 0 to 9999.



In OnPreDataItem initialze the following values.

--OnPreDataItem--

Window.OPEN('Processing data... #1################### @2@@@@@@@@@@@@@\');
NoOfRecs := COUNT;
NoOfRecsProgress := NoOfRecs DIV 100;
Counter := 0;
NoOfProgressed := 0;
TimeProgress := TIME;


In OnAfterGetRecord you can write the code(all variables of type integer except TimeProgress).


--OnAfterGetRecord--

//Do some processing
.
.

Counter := Counter + 1;

IF (Counter >= NoOfRecsProgress) OR (TIME - TimeProgress > 1000) THEN BEGIN
  NoOfProgressed := NoOfProgressed + Counter;
  Window.UPDATE(1,Custname); //this code will update the customer name at the control1
  Window.UPDATE(2,ROUND(NoOfProgressed / NoOfRecs * 10000,1)); //this will update the progress bar
  Counter := 0;
  TimeProgress := TIME;
END;


--OnPostDataItem--

Window.Close;

Tuesday, 3 September 2019

Dynamics 365 Business Central learning videos now available in "Microsoft Learn"

Most of them already knows that Microsoft is continuously working in order to release all the learning features related to D365 BC. It was a wide talk since last few months but result was still pending.

Yes, finally Microsoft has initiated something related to self learning portal in Microsoft Learn website, not much technical videos for now but most of the E-Learning features belongs to Finance Domain of D365 BC.

28 new videos have been released so far in which 26 videos belongs to Finance Domain, we can surely expect more no. of videos in the coming days covering all the domains including technical learning related to D365 BC.

Click the following link to access all the videos related to self learning portal of D365 BC LearningPortalD365BC