Posts

Showing posts from March, 2024

Get Company Value in D365fo X++

 Get Company Value in D365fo X++ Code:  public void setCompanyFields() { CompanyInfo companyInfo; BankAccountTable companyBankAccountTable; companyInfo = companyInfo::find(); companyBankAccountTable = BankAccountTable::find(companyInfo.Bank); // Set company fields DSACustInvoiceLineTmp.CompanyName = companyInfo.name(); DSACustInvoiceLineTmp.CompanyAddress = companyInfo.invoiceAddress().Address; DSACustInvoiceLineTmp.CompanyCoRegNum = companyInfo.CoRegNum; DSACustInvoiceLineTmp.CompanyRegNum = companyInfo.RegNum; DSACustInvoiceLineTmp.CompanyEmail = companyInfo.email(); DSACustInvoiceLineTmp.CompanyPhone = companyInfo.phone(); DSACustInvoiceLineTmp.CompanyTeleFax = companyInfo.teleFax(); DSACustInvoiceLineTmp.CompanyLogo = FormLetter::companyLogo(); // Set bank fields DSACustInvoiceLineTmp.CompanyBankName = companyBankAccoun...

Send Email With Attachment using sysoutgoing email table in D365fo X++

 Send Email With Attachment using sysoutgoing email table in D365fo X++ Code: class DSASendReportAsEmailAttachmentServiceclass extends SysOperationServiceBase { Map mappings = new Map(Types::String,Types::String); //Args _args; public void process() { custTable custTable; while select custTable where custTable.AccountNum == '10-30001' { this.generateAndSendCustStatementReport(custTable.AccountNum); } } public void generateAndSendCustStatementReport(CustAccount _custAccount) { //Set variables custTable custTable; Array arrayFiles; SRSProxy srsProxy; Map reportParametersMap; SRSPrintDestinationSettings settings; SrsReportRunController formLetterController = ZACustStatementReportController::construct()...

Summary of Creating a Workflow on a form in D365fo x++

 Summary of Creating a Workflow on a Form in D365fo x++ Create a customized workflow on the service management module for a service agreement. There isn’t any workflow available for this module. Enum add a field on the table query workflow category workflow type workflow Approval add workflow approval to workflow type Enable workflow on form Create workflow

How to Make Custom Workflow in D365fo X++

 How to Make Custom Workflow in D365fo X++ Steps:  1. Add a new base enum with the name “CustomWorkflowBaseEnum” 2. Add the elements in the newly created enum by right click on the enum and selecting “Add Element”. 3. Create a custom table with the name “CustomWorkflowTable” and add three fields (Id, name, CustomWorkflowBaseEnum) in the table. 4. Add a field group in this table by right click on the field groups and click “New Group”. 5. Change the name of the field group to “CustomWorkflowFieldGroup” and drag the fields in the field group according to your requirements. From clicking a learning perspective, I drag and drop all the fields in the group. 6. Override CanSubmitToWorkflow method of this table 7. Add a new method with the name "UpdateWorkflowStatus" in this table. public boolean canSubmitToWorkflow(str _workflowType = '') { boolean ret; ret = super(_workflowType); if(this.CustomWorkflowBaseEnum != CustomWorkflowBaseEnum::Ap...