...
Code Block | ||
---|---|---|
| ||
PRINT '------------------------------------------------------------'; PRINT FORMATMESSAGE ('%s - Started "Create PDF Actions for NGLP"',FORMAT(GETDATE(),'MM/dd/yyyy hh:mm:ss tt')); PRINT '------------------------------------------------------------'; INSERT INTO [dbo].[WORKFLOW_STEP_ACTION] ([WORKFLOW_STEP_ACTION_TYPE_ID] ,[WORKFLOW_STEP_ID] ,[NAME] ,[GOTO_STEP_ID] ,[DISPLAY_ORDER] ,[CONTINUE_AFTER_ACTION] ,[BUTTON_CLASS] ,[VISIBILITY] ,[VISIBILITY_COMPARISON_RULE_ID] ,[BUTTON_TEXT] ,[FEEDBACK_MESSAGE] ,[NOTES] ,[REFRESH] ,[STALE_PAGE_MESSAGE] ,[HELP_TEXT] ,[CONFIRMATION_MESSAGE] ,[QUICK_ACTION_ICON] ,[VISIBLE_TO_ROLE_IDS] ,[SHOW_ON_WORKFLOW_POPUP] ,[SHOW_ON_QUICK_ACTION_MENU] ,[VISIBLE_WHEN_WORKFLOW_INCOMPLETE] ,[VISIBLE_WHEN_WORKFLOW_COMPLETE_SUCCESSFUL] ,[VISIBLE_WHEN_WORKFLOW_COMPLETE_UNSUCCESSFUL] ,[VISIBLE_ON_STEP_ACCESS_CURRENT] ,[VISIBLE_ON_STEP_ACCESS_TARGET] ,[ENFORCE_REQUIRED_FIELDS] ,[PDF_TEMPLATE_ID] ,[COMPLETION_BADGE_ACTION] ,[COMPLETION_BADGE_ICON] ,[COMPLETION_BADGE_TOOLTIP]) SELECT DISTINCT [WORKFLOW_STEP_ACTION_TYPE_ID] = 10 ,ws.[WORKFLOW_STEP_ID] ,[NAME] = 'View ' + t.TEMPLATE_NAME ,[GOTO_STEP_ID] = NULL ,[DISPLAY_ORDER] = 1 ,[CONTINUE_AFTER_ACTION] = 1 ,[BUTTON_CLASS] = '' ,[VISIBILITY] = 'CONDITIONALLY' ,[VISIBILITY_COMPARISON_RULE_ID] = NULL ,[BUTTON_TEXT] = 'View ' + t.TEMPLATE_NAME ,[FEEDBACK_MESSAGE] = '' ,[NOTES] = 'Added via Script during NGLP upgrade on ' + cast(CURRENT_TIMESTAMP as VARCHAR(30)) ,[REFRESH] = 'ALWAYS' ,[STALE_PAGE_MESSAGE] = '' ,[HELP_TEXT] = NULL ,[CONFIRMATION_MESSAGE] = NULL ,[QUICK_ACTION_ICON] = 'fa-file-pdf-o' ,[VISIBLE_TO_ROLE_IDS] = '' ,[SHOW_ON_WORKFLOW_POPUP] = 0 ,[SHOW_ON_QUICK_ACTION_MENU] = 1 ,[VISIBLE_WHEN_WORKFLOW_INCOMPLETE] = 0 ,[VISIBLE_WHEN_WORKFLOW_COMPLETE_SUCCESSFUL] = 1 ,[VISIBLE_WHEN_WORKFLOW_COMPLETE_UNSUCCESSFUL] = 0 ,[VISIBLE_ON_STEP_ACCESS_CURRENT] = 0 ,[VISIBLE_ON_STEP_ACCESS_TARGET] = 0 ,[ENFORCE_REQUIRED_FIELDS] = 0 ,[PDF_TEMPLATE_ID] = 6t.PDF_TEMPLATE_ID ,[COMPLETION_BADGE_ACTION] = 'NONE' ,[COMPLETION_BADGE_ICON] = '' ,[COMPLETION_BADGE_TOOLTIP] = '' from ENTITY_TEMPLATE et join PDF_TEMPLATE t on t.PDF_TEMPLATE_ID = et.PDF_TEMPLATE_ID join ENTITY e on e.ENTITY_ID = et.ENTITY_ID and e.ENTITY_TYPE_ID = 2 join WORKFLOW w on w.ENTITY_ID = et.ENTITY_ID join WORKFLOW_STEP ws on ws.WORKFLOW_ID = w.WORKFLOW_ID PRINT FORMATMESSAGE ('Added [%d] WORKFLOW_STEP_ACTION Records to view Completion PDFs',@@ROWCOUNT); delete et from ENTITY_TEMPLATE et join ENTITY e on e.ENTITY_ID = et.ENTITY_ID and e.ENTITY_TYPE_ID = 2 PRINT FORMATMESSAGE ('Deleted [%d] ENTITY_TEMPLATE Records',@@ROWCOUNT); PRINT '------------------------------------------------------------'; PRINT FORMATMESSAGE ('%s - Completed "Create PDF Actions for NGLP"',FORMAT(GETDATE(),'MM/dd/yyyy hh:mm:ss tt')); PRINT '------------------------------------------------------------'; |
Configuration Changes
For each Template Attribute:
...
Determine if the Template outputs plain text or rich text (i.e. includes HTML markup) and if the output is a small or large amount of text.
...
Also, identify all of the input fields used by the template as you’ll need this for later steps.
...
Add a new field to store the data from the template.
Data Type:
Rich Text if there is any HTML markup
Short Text if the output is small and has no HTML markup
Long Text if the output is not small and has no HTML markup
Name: Similar to the template but suffix it with something like “Materialized” to the step where the template is calculated.
Label: Set to same value as the label on the source template attribute.
Description: “This field is a materialized version of “[template_attribute_name]” to work around the NGLP activity card performance issue with Templates”
...
...
Locate the step(s) on the workflow where each template input field is modified.
...
On each of those steps, update every action that saves data (generally all except the cancel action) to include a behavior to copy the data from the source template to the newly created field.
...
On all steps where the workflow may currently be, create a one-time automation that runs when the activity is incomplete, completed successfully, and completed unsuccessfully that performs the same behavior. Schedule it to run yearly on the next calendar day to update existing activities.
...
The next day, then update Leaning Plan Display settings and replace the templated field with the new materialized text field after the automation runs.
...
Verify the data displays on the Learning Plan Activity Card as expect, with no change in content from the original Template.
...
Also delete the one-time automation.
After the above steps have been done on UAT, you can perform the same steps on the live site, even before upgrading to a version that support NGLP or turning on NGLP.
- Peter Fasano to review