Posts

Showing posts from December, 2020

How to change SSRS Report Design based on Dialog value

Scenario -  In my case, I have a dialog field called 'Language' which is a deciding factor to open up a particular SSRS report design. Problem -  Run different report designs based on user input. Solution -  Add a parm method called parmLanguageId() in the Report Contract class. Create a method called getReportName() to return the Report name in Report Controller class. Override the preRunModifyContract() method of the Report Controller class. [    DataMemberAttribute('languageId'),    SysOperationLabelAttribute('Language'),    SysOperationHelpTextAttribute('Set language'),    SysOperationDisplayOrderAttribute('3') ] public LanguageId parmLanguageId(LanguageId _languageId = languageId) {    languageId = _languageId;    return languageId; } private str getReportName(MyContractClass _contract) {     str reportName;     LanguageId  languageId = _contract.parmLanguageId();...

How to move temporary form data to RDP Class of SSRS Report in Dynamics AX

1. Declare a list object in the ClassDeclaration of the temporary form public class FormRun extends ObjectRun {       List   recordList; }  2. Override the clicked() method of the OK button in the temporary form. Loop the form data source records and add it to a List. Then call the method printMyReport(). void clicked() {     MyTmpTable  myTmpTableLocal;     recordList = new List(Types::Record);     myTmpTable_ds.write();     for (myTmpTableLocal= myTmpTable_ds.getFirst();            myTmpTableLocal;            myTmpTableLocal= myTmpTable_ds.getNext())     {           recordList.addEnd(myTmpTableLocal);     }                  element.printMyReport();  } 3.  Create a method in Form, called printMyReport() and pass the list object of records as par...

How to check if the Item is Batch / Serial Controlled through X++ Code

//Check if the Item is Batch controlled public static boolean isItemBatchControlled(ItemId _itemId) {     boolean isActive;     FieldId batchIdDimension    = fieldNum(InventDim, InventBatchId);     str     label               = fieldPName(InventDim, InventBatchId);     if (_itemId)     {         isActive = EcoResTrackingDimensionGroupFldSetup::findByDimensionGroupFieldId(InventTable::find(_itemId).trackingDimensionGroup(), batchIdDimension).IsActive;     }     return isActive; } //Check if the Item is Serial controlled public static boolean isItemSerialControlled(ItemId _itemId) {     boolean isActive;     FieldId serialIdDimension   = fieldNum(InventDim, InventSerialId);     str     label               = fieldPName(InventDim, InventSerialId...