I would like to add a Main Menu option to create a new Insurance Claim Filing, where:
- the user should be presented with a custom screen to input required fields
- upon saving a workflow should launch
- the workflow should create a spreadsheet including data entered by the user
- a task should be queued to have a manager review the spreadsheet
How do I accomplish this?
In this case, you want to put a cart before the horse. That is, you will render a child object (a
Task) before it's parent object (Process) is created. Leveraging QBO's related table data pattern and a tiny bit of javascript will bind theProcess,Task,DocumentandWorkflowtogether nicely.By leveraging a QBO's related table data feature,
Consider configuring the following:
Task TemplatecalledInsurance Claim Data EntryProcess_Process: this will trigger the task to create anProcessonchangejavascript handler to callensureProcess()(see below)Process_ProcessTemplateID: this will dictate theProcess TemplatetheProcessis based on, and in turn, trigger the automatic creation of a workflowTask GUI Designer:Workflow TemplatecalledInsurance Claim FilingTasknamedInsurance Claim Data EntryDocumentnamedInsurance Claim AnalysisTasknamedInsurance Claim ReviewProcess TemplatecalledInsurance Claim FilingInsurance Claim Filingworkflow when it's createdTasks can be rendered before their parent exists by calling:
You can add to the Main Menu, replacing {a task template id} with the ID of your
Task TemplatenamedInsurance Claim Data Entry.When a user clicks on the Main Menu link to call
ImportFormTemplate/RenderForm, theTaskwill be rendered. Key concepts to note:Process_Processfield is required, and a lynchpin to creating theTask'sParentobject (in this case aProcess).Process_ProcessTemplateIDensures that the newly createdProcessuses theProcess Templateyou createdProcess Templateyou configured will automatically launch a workflow whenever aProcessbased upon it is createdWorkflowwill automatically bind to the just-createdInsurance Claim Data Entrytask that kicked the whole thing off, because it's configured with aRepeatabilityofOne per parent