Posts

jumpRef method to open one form to another form in d365 fo x++

Steps:    Create a method in Table and take the specific id to the parameter  public static void jumpRefId(ContractID _ContractID)     {         Args            args = new Args();         MenuFunction    menuFunction;         PersonContracts PersonContracts;         select * from PersonContracts         where PersonContracts.PersonId == _ContractID;         args.record(PersonContracts);         args.lookupRecord(PersonContracts);         menuFunction = new MenuFunction(menuitemDisplayStr("Menuitemname"), MenuItemType::Display);         menuFunction.run(args);     } step 2: call this method in form field method jumpref()  [Control("String")]     class DSPPersonContracts_PersonId     {         ...

Form datasource Event Handler in d365 fo x++

  Datasource event handler: Written: // Datasource - event handler for written     [ FormDataSourceEventHandler ( formDataSourceStr ( FormName , DataSourceName),  FormDataSourceEventType ::Written)]      public   static   void  DataSourceName_OnWritten( FormDataSource  sender,  FormDataSourceEventArgs  e)     {          FormRun          form              = sender.formRun();          FormDataSource   DatasourceName_ds = form.dataSource( formDataSourceStr ( FormName , DataSourceName))  as   FormDataSource ;          TableName        buffTable         = Datasourc...

Employee Name Lookup in d365 fo x++

     public void lookup()         {             Query query = new Query();             QueryBuildDataSource queryBuildDataSource;             QueryBuildRange queryBuildRange;             SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(HcmWorker), this);             sysTableLookup.addLookupField(fieldNum(HcmWorker,PersonnelNumber));             sysTableLookup.addLookupMethod(tableMethodStr(HcmWorker,name),true);             queryBuildDataSource = query.addDataSource(tableNum(HcmWorker));             sysTableLookup.parmQuery(query);             sysTableLookup.performFormLookup();         }

How to show lookup of Designs of standered and Customized Reports in d365 fo x++

 We can show the lookup of Designs of reports in d365 fo x++ the following code will show the report design    public void lookup()         {             TmpSrsReportDesignName reportDesignTable;             reportDesignTable = DSSReportRunUtil::getReportDesignTmpTable(HeaderGroup_Report.valueStr());             if (reportDesignTable)             {                 SysTableLookup lookupTable = SysTableLookup::newParameters(tableNum(TmpSrsReportDesignName), this);                 lookupTable.parmTmpBuffer(reportDesignTable);                 lookupTable.addLookupfield(fieldNum(TmpSrsReportDesignName, DesignName));                 lookupTable.performFormLookup();     ...

How to show Lookup of all Standered and Customized Reports in d365 fo x++

 We can show lookup of standered and Customized Report on form in d365 fo x++ The Following Code will show you the lookup    public void lookup()         {             SysTableLookup lookupTable = SysTableLookup::newParameters(tableNum(SysMetaReportNameLookup), this);             lookupTable.addLookupfield(fieldnum(SysMetaReportNameLookup, Name));             lookupTable.performFormLookup();         } this lookup show all the standered and customizes Report in d365 fo x++.

Get AOT Menu Item propeties in d365 fo x++

  public static DSSDisplayReportTmp getReports()     {                  Table tableBuf;         delete_from tableBuf;                  System.Type axMenuItemTypeDisplay = new Microsoft.Dynamics.AX.Metadata.MetaModel.AxMenuItemDisplay ().GetType ();         System.Collections.Specialized.StringEnumerator menuItemDisplayNames = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::MenuItemDisplayNames ();         while (menuItemDisplayNames.moveNext ())         {             str menuItemName = menuItemDisplayNames.get_current ();             var enum = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetModelsOfMetadataArtifact (menuItemName, axMenuItemTypeDisplay).GetEnumerator ();             str modelName = enum.moveNext () ? enum.C...

Get current User subOrdinates (Reportees) in d365 fo x++

1). i want get a Subordinates of current user or Reportees of current user who are directly reporting to a peron who are currently logged in.    2). call this method by getting current users  3).this.getListOfSubordinates(HcmWorker::userId2Worker(curUserId())) 4). public List getListOfSubordinates(HcmWorkerRecId _recid)     {         List  responsibleWorkers  =   new List(Types::Int64);         int64 PositionId  =   HcmPositionDetail::findByPrimaryPositionForWorker(_recid).Position;         HcmWorker                   hcmWorker;         HcmPositionWorkerAssignment workerAssignment;         HcmPosition                 hcmPosition;         HcmPositionDetail           hcmPositionDetail; ...