Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

reIMAGINE 2015

Hosted by Dynamic Communities


Workflow
New Workflow for Dynamics GP
Basic Process for Workflow Development
Create a workflow type constant
Add workflow support to tables
Add workflow support to tables
Add the records that define the workflow type
Define the Business Object Key

Workflow Type Business Object Key:


A string that specifies the set of fields that uniquely identify the
business document. The following format must be used to
specify the business object key:

TablePhysicalName~Field1PhysicalName~Field2PhysicalName

The business object key must have at least one field, and can
have a maximum of four fields.
Add records for Workflow Condition Editor
Add code for workflow actions from windows
Add code for workflow actions from windows
Add code to support actions from windows
Add code to support actions from windows

in integer product_id;
in integer form_id;
in integer window_id;

call Workflow_Infobar_Initialize, product_id, form_id, window_id,


WORKFLOW_TYPE_ITEM_APPROVAL, false;
Add code to support actions from windows

local integer formid, trigger_tag, i;

formid=resourceid(form IV_Item_Maintenance);
i=countitems('(L) InfoBar_Trigger_Tags' of window 'Dummy Window' of form 'Main Menu');
while i>0 do
if itemname('(L) InfoBar_Trigger_Tags' of window 'Dummy Window' of form 'Main Menu',i)=str(formid) then
trigger_tag=integer(itemdata('(L) InfoBar_Trigger_Tags' of window 'Dummy Window' of form 'Main
Menu',i));
Trigger_Unregister(trigger_tag);
delete item i from '(L) InfoBar_Trigger_Tags' of window 'Dummy Window' of form 'Main Menu';
end if;
decrement i;
end while;
Add code to support actions from windows
Add code to support actions from windows
Add code to support actions from windows

Core:
in [WORKFLOW_TYPE_ITEM_APPROVAL]
set sBusObjKey to l_field_1;

3rd Party Trigger Registration:

l_result = Trigger_RegisterFunction(function SetWFBusObjKeyforWorkflowType of form wfEngine,


TRIGGER_AFTER_ORIGINAL, function Set3rdPartyKey);
if l_result <> SY_NOERR then
warning "Function trigger registration failed.";
end if;
Add code to support actions from windows

3rd Party Trigger Function:

function returns 'Workflow Business Object Key' sBusObjKey;


in 'Workflow Type Name' l_wf_type_name;
in anonymous l_field_1;
optional in anonymous l_field_2;
optional in anonymous l_field_3;
optional in anonymous l_field_4;
if sBusObjKey = "" then
if l_wf_type_name = WORKFLOW_TYPE_XXXX_APPROVAL then
{Set the single-field key for the Lead object}
set sBusObjKey to l_field_1;
end if;
end if;
Add code to support actions from windows

DisplayWorkflowInfo of form IV_Item_Maintenance


in 'Item Number' sItemNumber;
in boolean l_first_class_window;
in table Workflow_Document_Steps;

local integer l_product_id;


l_product_id=0; {The dictionary ID of the dictionary that contains the form you are working on}
call WFDisplayDocumentInfo of form wfEngine,
l_product_id, Resource_GetID(l_product_id,DT_FORM,technicalname(form IV_Item_Maintenance)),
1{Window ID},
WORKFLOW_TYPE_ITEM_APPROVAL, {Constant that defines your workflow type}
sItemNumber, {first field in the key that guarantees uniqueness of this document}
l_first_class_window,
false, {IV_Item_Maintenance is not an inquiry window}
table Workflow_Document_Steps; {up to 3 optional fields after here are possible}
Add code to support actions from windows
New Tables for Workflow
Workflow_Type WF100001
Workflow_Master WF100002
Workflow_Step WF100003
QueryDesigner_FieldsList CO00121
QueryDesigner_Relationships CO00122
QueryDesigner_Conditions CO00123
Workflow_Roles WF40201

Workflow_Instance WFI10002
Workflow_Step_Instance WFI10003
Workflow_Tasks WFI10004
Workflow_History WF30100
Workflow_Calendar WF40300
Workflow_Calendar_Down_Days WF40310
Key Workflow Functions
GetWorkflowStatus() of form wfEngine
Workflow Type Name
Workflow Business Object Key

IsWorkflowActive() of form wfEngine


Workflow Type Name

WFDisplayDocumentInfo of form wfEngine


Product ID
Form ID
Window ID
Workflow Type Name
Document Number
First Class Window (Boolean)
Inquiry Window (Boolean)
Workflow Document Steps (table buffer)
Key Workflow Functions
GetAllowableActions of form wfEngine
Workflow Type Name
Workflow Business Object Key Workflow Actions:
Workflow Instance ID 1. Submit
Workflow Step Instance ID 2. Resubmit
Workflow User 3. Approve
First Class Window (Boolean)
4. Task Complete
Inquiry Window (Boolean)
5. Reject
Workflow Actions (array of 10 booleans)
6. Delegate
Single Action (Boolean)
7. Recall
10. View History
ViewHistory of form wfEngine
(8 and 9 are not used)
Workflow Type Name
Workflow Business Object Key
Workflow Name
Where Can I Download This Presentation?
https://www.eventscribe.com/2015/reIMAGINE/

• People who register for reIMAGINE will automatically be added to a


reIMAGINE 2015 Community on the Dynamics Pro website. They can
enter the community by signing in to the Dynamics Pro website (free to
create an account), clicking on the dropdown next to the picture icon, and
clicking the “communities” button. The list of communities will come up
and they can click “Enter” on the reIMAGINE 2015 community. There will
be a library tab with all presentations.

You might also like