Skip to main content

Workflow in D365 FO

 

This guide will explain every step needed to create your custom workflow in Dynamics 365

Create Enum

The base enumeration is used to define the status of the workflow. Here are the steps needed to define it:

– Create a new Enum for the workflow status

Create A New Field on the Table

– Here, we use the table SMAAgreementTable as an example. Create an extension of the table and drag Enum to table.

Create Methods on the Table

Next, you will be required to create methods on the table using the following steps:

  • Create a new class and name it “devSMAAgreementTable_Extension”
  • Extend the table “SMAAgreementTable”.
  • Create methods with the following names
    • canSubmitToWorkflow
    • UpdateCustWorkflowState
  • The “canSubmitToWorkflow” method will use a chain of command for the next keyword.

Create a New Query

Creating a new query is easy:

  • Here we use the SMAAgreementTableListPage query

Create Workflow Category

  • Click on Add > New Item > Business Process and Workflow > Workflow Category
  • Enter a proper name
  • Set the properties as given below
    • Label = “Service agreement workflow category”
    • Module = Salesorder (as of now we will add workflow to AR. So, the workflow will list under the AR module)

Create Workflow Type

  • Create a new workflow type with the following steps:
    • Click on Add > New Item > Business Process and Workflow > Workflow Type

– Edit the devServiceAgreementWFTypeEventHandler class as given below

– Write the following code on the submit manager class

Create Workflow Approval

– To create a workflow approval, simply click on Add > New item > Business process and workflow > Workflow Approval

– Update the devServiceAgreementWFApprovalEventHandler eventhandler class

Add Workflow Approval to Workflow Type

– Create an approval supported element on workflow type under devServiceAgreementWFType > Supported elements

– Enable Workflow on Form

– Create Workflow


Comments

Popular posts from this blog

Edit Method on Form

Edit Method D365 for a form Data Source 1. To create an edit method first create a controller class. with following properties  public static edit MainAccountNum LedgerJournalTransLedger(LedgerJournalTrans _ledgerjournal, boolean _set, MainAccountNum _id) { MainAccountNum accountId = _id; MainAccount mainAccount = MainAccount::findByMainAccountId(_id); if(_set) { if(_ledgerjournal.AccountType== LedgerJournalACType::Ledger) { mainAccount = MainAccount::findByMainAccountId(accountId); if(_ledgerjournal.LedgerDimension) { DimensionDefault defaultDim = LedgerDimensionFacade::getDefaultDimensionFromLedgerDimension(_ledgerjournal.LedgerDimension); _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::getAccountStructure(mainAccount.RecId), defaultDim); } else { _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::ge...

EXCEL Add-in D365 FO

EXCEL add-in USED FOR D365 DATA ENTITY To use excel add-in for D365 data entities for CRUD operations. You can easily follow below mentioned steps: 1. Open Excel from any Desktop or VM and click on Add-ins option under insert tab: 2. Check if you have Microsoft Dynamics Office Add-ins, If not then download it from Microsoft store: 3. If you have above mentioned Add-in click on this and click add server information: 4. In server URL add your environment URL either dev, UAT or PROD and click OK.  for e.g:  (https://xxxxxxxxxxxxxxxxxxx.dynamics.com/)  5. Click on Design button and it will display below mentioned screen: 6. Click on Select entity data source and choose your desired data entity from list on which you need to perform CRUD operations and click on NEXT: 7. Double click on each field present in AVAILABLE FIELD SECTION to get them in SELECTED FIELD SECTION: 8. Click on Refresh Once and you will be able to see data in your entity in Excel: 9. After making changes to...

Field Level Security In Ax 2012

FIELD LEVEL SECURITY IN AX 2012 In this blog we will discuss field level security applied in  Ax 2012. 1. Field level security is added on form level as well in Ax 2012 its bit different then field level security in D365 2. This also requires privileges to be applied on form specific fields only. Step #1 :  Change datasource property of the field which need to be added in security. Step #2 : Now add these 2 fields in form --- > permissions --- > Read Step #3 : Now finally create privilege and add these fields explicitly in it.       HEY HEY HEY !!!! HACK OF THE DAY  Add Fields in Entry point privilege section of form  Explicitly.