...
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:
...
- 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.
...