Section | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
...
The first step in our form is to create an Identification area, which will collect the Id, the Name, and the Email Address of both of the employee and the name of the assigned managerreviewer for that employee. In our tenant, the two employees used are named Jack and Tom. The managers (Reviewers) are named, respectively, Jill and Jerry.
Using a simple business rule
Using Business Rules, we can autofill not only the employee text boxes, but also the corresponding manager boxesReviewer box and Report Date. The employee information is and the Reviewer name are automatically filled in using the credentials of the user who is logged in. In the rule below, we are simply hard-coding the manager information but in practice, the manager information would be retrieved from a back end system such as a database or an LDAP server.The Report date will be filled in using a separate ruIe. The IRS Mileage Rate is a default value for that field. Here is an example of a rule to fill in the
Code Block |
---|
if (form.load) { var sid = _data.getParameter('subject.id') if (EmployeeId.value.length == 0) { EmployeeId.value = sid; EmployeeName.value = _data.getParameter('subject.first.name') + ' ' + _data.getParameter('subject.last.name'); EmployeeEmail.value = _data.getParameter('subject.email'); } else { sid = EmployeeId.value; } if (sid == 'jack') { ManagerId.value = 'jill'; ManagerName.value = 'Jill Burns'; ManagerEmail.value = 'jill@frevvo.org'; } else if (sid == 'tom') { ManagerId.value = 'jerry'; ManagerName.value = 'Jerry Mouse'; ManagerEmail.value = 'jerry@frevvo.org'; } } |
...