D365/AX7: Method to call when record is marked – markChanged() FormDataSource

Requirement:

The requirement was to display information of selected records of form Grid on a string control.The information on custom string control should change during the marking of records in real time.

Sample Code:

Copy the method in form datasource.

  1. public void markChanged()
  2.         {
  3.             AcxBrandMaster  acxBrandMaster1;
  4.             str brandStr;
  5.             MultiSelectionHelper    multiSelectionHelper =  MultiSelectionHelper::construct();
  6.             multiSelectionHelper.parmDatasource(AcxBrandMaster_DS);
  7.             acxBrandMaster1 = multiSelectionHelper.getFirst();
  8.             FormStringControl1.text(“”);
  9.             while (acxBrandMaster1.RecId)
  10.             {
  11.                 brandStr = brandStr +  acxBrandMaster1.Brand;
  12.                 acxBrandMaster1 = multiSelectionHelper.getNext();
  13.             }
  14.             FormStringControl1.text(brandStr) ;
  15.             super();
  16.         }

Leave a Reply