You can add additional roles for your integrating application that will be displayed in the Select Home Page window. For example the Lead Generation role is added by the sample integrating application.
The following is a portion of the Startup script for the sample integrating application. It registers a procedure trigger that will add a new role to the list in the Select Home Page window.
l_result = Trigger_RegisterProcedure(script LoadRoleListBox of form syHomePageRole, TRIGGER_AFTER_ORIGINAL, script IG_HomePage_AddRole); if l_result <> SY_NOERR then warning "Procedure trigger registration for LoadRoleListBox failed."; end if;
The following example is the IG_HomePage_AddRole procedure for the sample integrating application. It adds the “Lead Generation” role to the list, and specifies the integer ID for the new role as the data item for the list entry.
in long iIndustry; {Add a new role} if iIndustry = INDUSTRY_OTHER then add item "Lead Generation", ROLE_LEADGENERATOR to field '(L) RoleListBox' of window SelectHomePage of form syHomePageRole; end if;
The industry the user selected will be passed as a parameter for the trigger processing procedure. The value will correspond to one of the following constants:
Industry |
Constant |
---|---|
Education |
INDUSTRY_EDUCATION |
Finacial Services |
INDUSTRY_FINANCIALSERVICES |
Government |
INDUSTRY_GOVERNMENT |
Healthcare |
INDUSTRY_HEALTHCARE |
Manufacturing |
INDUSTRY_MANUFACTURING |
Media & Entertainment |
INDUSTRY_MEDIAENTERTAINMENT |
Non Profit |
INDUSTRY_NONPROFIT |
Other |
INDUSTRY_OTHER |
Retail |
INDUSTRY_RETAIL |
Services |
INDUSTRY_SERVICES |
Telecommunications |
INDUSTRY_TELECOM |
Transportation |
INDUSTRY_TRANSPORTATION |
Utilities |
INDUSTRY_UTILITIES |
Wholesale |
INDUSTRY_WHOLESALE |
When specifying the integer value that indentifies a new role, use the following guidelines:
The sample integrating application uses its product ID 3333 to identify the role it adds to Microsoft Dynamics GP. |
When the user selects a role in the list, a description of the role is displayed. The following is a portion of the Startup script for the sample integrating application. It registers a focus trigger that will display a description when the new role is selected.
l_result = Trigger_RegisterFocus(anonymous('(L) RoleListBox' of window SelectHomePage of form syHomePageRole), TRIGGER_FOCUS_CHANGE, TRIGGER_AFTER_ORIGINAL, script IG_HomePage_LookupRoleDescription); if l_result <> SY_NOERR then warning "Focus trigger registration for role description failed."; end if;
The following example is the IG_HomePage_LookupRoleDescription procedure for the sample integrating application. It displays a description for the “Lead Generation” role when this role is selected in the Select Home Page window.
if itemdata('(L) RoleListBox' of window SelectHomePage of form syHomePageRole, '(L) RoleListBox' of window SelectHomePage of form syHomePageRole) = ROLE_LEADGENERATOR then '(L) RoleDescription' of window SelectHomePage of form syHomePageRole = "Tasks for this role would include finding and managing potential customer leads."; end if;
If the user chooses the new role you added and clicks OK, your code must handle the entire process of building the Home Page for the user. The following is a portion of the Startup script for the sample integrating application. It registers a procedure trigger that will build a home page for the new role added.
l_result = Trigger_RegisterProcedure(script BuildHomePageForRole of form syHomePageRole, TRIGGER_AFTER_ORIGINAL, script IG_HomePage_BuildHomePage); if l_result <> SY_NOERR then warning "Procedure trigger registration for Build Home Page failed."; end if;
The process of building a Home Page requires using several procedures and functions defined on the Home Page forms for Microsoft Dynamics GP. These are described in << Ref goes here>>. Refer to the example for the Create() function to see the IG_HomePage_BuildHomePage trigger processing procedure. for the sample integrating application. This procedure builds the Home Page when the user has chosen the “Lead Generation” role.
When you create a new role for a Home Page, you may want to make this role available for use when sharing list views. To do this, you will register a procedure trigger for the FillRolesLookup procedure of the syListViewCustomize form. The following example shows this registration for the sample integrating application.
l_result = Trigger_RegisterProcedure(script FillRolesLookup of form syListViewCustomize, TRIGGER_AFTER_ORIGINAL, script IG_Lists_AddRole); if l_result <> SY_NOERR then warning "Procedure trigger registration for FillRolesLookup failed."; end if;
The trigger processing precedure that runs in response to this trigger will add the new role to the list of roles the user can select from when sharing a list view. The following example is the IG_Lists_AddRole trigger processing procedure that adds a new role to this list.
local long nItemIndex; {Add the Lead Generation role} nItemIndex = ListView_ItemAdd('(L) RoleList' of window RoleLookup of form syListViewCustomize, GetHomePageRoleName(ROLE_LEADGENERATOR), ROLE_LEADGENERATOR, 0);