Posts

Query not value enum in D365

//Query not value field QueryBuildRange qbrRecId; qbrRecId = qbds1.addRange( fieldNum ( HcmWorker , RecId   )); // add range qbrRecId.value( SysQuery ::valueNot( "22565420979" )); //22565420979 is RecId of worker;    // QueryBuildDatasource add range not equal to ENUM value QueryBuildRange qbrStatus; qbrStatus  = qbds1.addRange( fieldNum ( PerdiemHeader , Status)); // add range qbrStatus .value( SysQuery ::valueNot(enum2str( PerdiemStatus ::Rejected))); it works for one range ,but what if i want add multiple value to range like this : QueryBuildDataSource qbds;               qbds.addRange( fieldNum ( HcmWorker , RecId ).value( SysQuery ::valueNot( "22565420979" )); qbds.addRange( fieldNum ( PerdiemHeader ,Status).value( SysQuery ::valueNot(enum2str( PerdiemStatus ::Rejected)));

User ID to user name or Worker Name in D365

hcmworker   userId2Worker = hcmworker ::find( hcmworker ::userId2Worker(curUserId()));

How to pass the parameter from one form to another in Dynamic365

1. Create two forms with Name FormA & FormB   2. Below code is override in clicked method() of button. void  clicked() {      // Args class is usually used in Axapta for passing parameters between forms      Args             args;      FormRun          formRun;     ;     args =  new   args ();      // Our values which we want to pass to FormB      // If we want pass just simple string we can use 'parm' method of 'Args' class like     args.parm(  LeaveRequestID.text() );      // If we want pass whole record we can use 'parm' method of 'Args' class        args.record(TableName);      // Run FormB     args.name(  formstr ( FormB ) );     formRun = classFactory.formRunClass( Args );     formRun.init();     formrun.run();     formrun.wait();      super (); } 3. Now override init() method in FormB. public   void  init() {      str             anyStringValueFromCaller;      TableName       tablename;

How to get workflow approvers list using x++

WorkflowTable            workflowTable; WorkflowVersionTable     workflowVersionTable; WorkflowElementTable     workflowElementTable; WorkflowStepTable        workflowStepTable; WorkflowAssignmentTable workflowAssignmentTable; while select workflowAssignmentTable     join workflowStepTable     where workflowStepTable.RecId == workflowAssignmentTable.workflowStepTable     join workflowElementTable     where workflowElementTable.ElementId == workflowStepTable.ElementId     join workflowVersionTable     where workflowVersionTable.ConfigurationId == workflowElementTable.ConfigurationId         && workflowVersionTable.Enabled == NoYes ::Yes     join workflowTable     where workflowTable.RecId == workflowVersionTable.workflowTable     && workflowTable.DocumentTableName == "LeaveRequestHeader" {     info(strFmt( "%1" , workflowAssignmentTable.UserValue)); }           

Multi Select Lookup in SSRS Report in D365

Multi Select Lookup in SSRS Report in D365 Description:-  Here we will create multi select lookup in ssrs report so we can select multiple data from lookup. Here I have given sample demonstration for how to generate multi select lookup in ssrs report. First, you must create contract class for that and create method for parameters. Contract Class: - [DataContractAttribute, SysOperationContractProcessingAttribute( classstr (SampleUIBuilder))] class SampleContract implements SysOperationValidatable {     List   ListItemId; [DataMemberAttribute( "Item Id" ),AifCollectionTypeAttribute( "Item Id" , Types ::String),        SysOperationLabelAttribute( literalStr ( "Item Id" ))]        public List parmItemId( List _ListItemId = ListItemId) {               ListItemId = _ListItemId;               return ListItemId; } } //For validation parameters,     public boolean validate()     {         boolean              is

Cache Lookup Property of table

Cache Lookup Caches are used on both the client and the server. It increases the performance, the ax will get data from the cache instead of doing round trips and DB calls. So for each table, it's good to use cache lookup property.Microsoft Dynamics Ax run time manages the cache by removing old records when new records are added to the cache. Client Cache A Client-side cache can be used only by the client. The client cache is used when a select statement is executed from the client tier. If no records are found in the client cache, the client then searches in the server cache for the records. If the record isn't located in the server cache, it will retrieve from the database. The maximum number of records can be maintained in a client cache is 100 records per table for the selected company. Server Cache A server-side cache can be used by any connection to the server. The server cache is used when a select is executed on the server tier. If no record found in th