Posts

Showing posts from May, 2024

Cost JOC In X++

 internal final class FabricCost {     /// <summary>     /// Class entry point. The system will call this method when a designated menu      /// is selected or when execution starts and this class is set as the startup class.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         real      Cost;         PRODTABLE PRODTABLE;         SALESTABLE SALESTABLE;         bfpProdMasterTable bfpProdMasterTable;         ProdJournalTable ProdJournalTable;         ProdTableJour ProdTableJour;         ProdJournalBOM ProdJournalBOM;         INVENTTRANSORIGIN INVENTTRANSORIGIN;         INVENTTRANS INVENTTRANS;      ...

Click Map Button and get Location In d365fo x++

Click Map Button and get Location In d365fo x++ Code:  ublic static void mapIt(LogisticsPostalAddress _address) { str address; const str mapUrl = 'http://www.bing.com/maps/default.aspx?where1=\%1'; const str comma = ','; const str newLine = '\n'; if (_address) { address = _address.Address; // Replace the newline with comma address = strReplace(address, newline, comma); // URL encode address = System.Web.HttpUtility::UrlEncode(address); // Add the address to the URL Browser br = new Browser(); br.navigate((strFmt(mapUrl, address)), true); } }

SO Form Datasources IN D365FO X++

  FormDataSource  SalesLine_ds                              =  sender.formRun().dataSource(formDataSourceStr(SalesTable, SalesLine));             FormDataSource  InventDim_ds                              =  sender.formRun().dataSource(formDataSourceStr(SalesTable, InventDim));             FormDataSource SalesLineForeignTradeCategory_DS          =  sender.formRun().dataSource(formDataSourceStr(SalesTable, SalesLineForeignTradeCategory));             FormDataSource InterCompanyPurchSalesReference_DS        =  sender.formRun().dataSource(formDataSourceStr(SalesTable, InterCompanyPurchSalesReference));             FormDataSource WHSLoadLine_...

Get Workflow History in D365FO x++

  Get Workflow History in D365FO x++ Code:  select CostSheetId,workflowTrackingTable.CreatedDateTime , workflowTrackingTable.USER_ from workflowTrackingTable join workflowTrackingCommentTable on workflowTrackingCommentTable.WorkflowTrackingTable = workflowTrackingTable.RecId join workflowTrackingStatusTable on workflowTrackingTable.WorkflowTrackingStatusTable = workflowTrackingStatusTable.RecId join SLDFabCostSheetsCalculation on workflowTrackingStatusTable.ContextRecId = SLDFabCostSheetsCalculation.RecId --and workflowTrackingStatusTable.ContextTableId = SLDFabCostSheetsCalculation.table where workflowTrackingTable.TrackingType = 4

Cancel Workflow through Code in x++

 Cancel Workflow through Code in x++ private void updateWorkflowStatus(SalesTable  salesTable)     {         WorkflowTrackingStatusTable _workflowTrackingStatusTable;         select firstonly CorrelationId, TrackingStatus          from _workflowTrackingStatusTable         where salesTable.RecId == _workflowTrackingStatusTable.ContextRecId         && salesTable.TableId == _workflowTrackingStatusTable.ContextTableId         && _workflowTrackingStatusTable.TrackingStatus != WorkflowTrackingStatus::Cancelled;         if(_workflowTrackingStatusTable             && _workflowTrackingStatusTable.TrackingStatus != WorkflowTrackingStatus::Cancelled)         {             Workflow::cancelWorkflow(_workflowTrackingStatusTable.Correlat...

Custom Sales Order Workflow Not working fine in D365fo x++

Custom Sales Order Workflow not working fine in D365fo x++  write this code in DataSource COC Code:  [ExtensionOf(formDataSourceStr(SalesTable, SalesTable))] final class DSSH_SalesTable_Salestable_Extension { public int active() { int ret; ret = next active(); FormDataSource ds = this; FormRun salesTablef = ds.FormRun(); salesTablef.design().workflowEnabled(true); //salesTablef.design().controlName( salesTablef.design().controlName("WorkflowActionBarButtonGroup").visible(true); salesTablef.design().workflowDataSource(this); salesTablef.design().workflowType("DSSH_SalesOrderWFType"); return ret; } }

Workflow Error: Function WorkflowSubmitDialog.run has been incorrectly called solution Dynamics 365 Finance and Operations

 Workflow Error: Function WorkflowSubmitDialog.run has been incorrectly called solution Dynamics 365 Finance and Operations Code:  public static void main(Args args) { // TODO: Write code to execute once a work item is submitted. SalesTable SalesTable; WorkflowComment note = ""; WorkflowSubmitDialog workflowSubmitDialog; WorkflowCorrelationId workflowCorrelationId; WorkflowVersionTable workflowVersionTable; WorkflowTypeName workflowTypeName = workFlowTypeStr(DSSH_SalesOrderWFType); workflowVersionTable = args.caller().getActiveWorkflowConfiguration(); if(!workflowVersionTable) { workflowVersionTable = DSSH_SalesOrderWFTypeSubmitManager::findWorkFlowVersionTable(); } workflowSubmitDialog = WorkflowSubmitDialog::construct(workflowVersionTable); workflowSubmitDialog.run(); if (workflowSubmitDialog.parmIsClosedOK()) ...