Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
creating custom workflow with new table which we will use sort of extension and associate the table
with standard form extension.
Following are the steps to create custom work flow and associate with existing form.
Step-2 Create custom table and add two fields Main field id and Status field extend both fields with
Step-3 Create relation on parent table and our newly created table on the basis of Main field id.
Step-4 Create a Custom Query and Add the newly created table.
Step-10 Place proper labels on workflow types, approval and menu items.
Step-12 Now navigate to workflow form of your module and click on new to create new workflow.
Step-14 Create extension of the form on which you want to associate workflow.
Step-15 Add data source table and join with parent data source.
Step-16 Only two type of join supported. Inner and outer.. in my case i am using outer join because
Step-17 Override the initialized method of the newly added table data-source and enable the
workflow.
[FormDataSourceEventHandler(formDataSourceStr(YYYCaseRequestTable, NewlyCreatedTable),
FormDataSourceEventType::Initialized)]
public static void XXXXXXChild_OnInitialized(FormDataSource sender,
FormDataSourceEventArgs e)
{
sender.formRun().design().workflowDatasource(formDataSourceStr(FormName,
NewlyCreatedDataSourceName));
sender.formRun().design().workflowEnabled(true);
sender.formRun().design().workflowType(workflowTypeStr(WorkflowType));
}
Step-18 Now override the parent table Method OnWritten and insert the record on our newly added
[FormDataSourceEventHandler(formDataSourceStr(YYYCaseRequestTable,
YYYCaseRequestTable), FormDataSourceEventType::Written)]
public static void YYYCaseRequestTable_OnWritten(FormDataSource sender,
FormDataSourceEventArgs e)
{
YYYCaseRequestTable objCaseRequestTable = sender.cursor();
FormDataSource fds =
sender.formRun().dataSource(formDataSourceStr(YYYCaseRequestTable,
NewlyCreatedTable));
fds.object(fieldnum(NewlyCreatedTable,RequestId)).setValue(objAMCaseRequestTab
le.RequestId);
fds.object(fieldnum(NewlyCreatedTable,approvalStatus)).setValue(YYYCaseRequest
TableWorkflowStatus::NotSubmitted);
fds.write();
}
Step-19 – Buid the model and you can verify with the new record.