...
Code Block |
---|
if (form.load) { var an = _data.getParameter ("flow.activity.name"); if (an === 'Employee' && EId.value.length === 0) { // User Information EId.value = _data.getParameter('subject.id'); // Username EFullName.value = SubjectUtil.getFullName(_data.getParameter ('subject.first.name'), _data.getParameter ('subject.last.name')); EEmail.value = _data.getParameter('subject.email'); MId.value = _data.getParameter('subject.reports.to'); ManagerApproval.visible = false; ManagerApproval.required = false; } else if (an === 'HR') && MFullName.value.length === 0) {{ MFullNameHFullName.value = SubjectUtil.getFullName(_data.getParameter ('subject.first.name'), _data.getParameter ('subject.last.name')); MEmail HEmail.value = _data.getParameter('subject.email'); } } |
Add a second rule to make the Certification field visible when Sick Leave is selected as the Type of Leave:
...
- Create a new flow by clicking on the Flows menu item and clicking the New button.
- Drag and drop a New Form the Leave Approval form you just created into the flow. This creates a step (activity) in the workflow.
- Name the activity 'Employee' by typing the name in the Name property.
- In our example, we will use the same form tHRee times, once for the Employee, Manager and HR.
- Select the Employee activity and click the icon twice.
- This will create two linked activities. A linked activity refers to the same form as the original activity. The form cannot be edited from the linked activity but any edits made to the original form are reflected in the linked activity.
- Name the second activity Manager and the third activity HR.
- For the first activity, set the role Employee.
- For the second activity, we require that it is performed by the Employee's Manager (specific person rather than a role). We'll set this up later.
- For the third activity, set the role HR
...
- Click the Doc Action button in the toolbar at the top of the form.
- In the wizard that pops up, click the Additional Email Tab.
- Click the Email data to a specified address button.
- In the To: field, enter a template using the drop down to the right. Select the Employee's email address via the control EEmail. The To: field should look like {EEmail}.
- In the Send Snapshot: drop down, select PDF.
- Uncheck the Send Data: checkbox.
- Click Next.
- In the Subject: field enter Leave approval for {StartDate}. Once again, you can use the drop down at right to select controls.
- In the Message: field you can enter anything you want including dynamic content using the drop down at right. For example, Your leave approval request was successfully processed by {MFullNameHFullName}. This field can also contain HTML for rich content.
...