
Hello,
I need the 'Required Attendees' field on the appointment form to be editable once an appointment has been marked complete. For other fields on the appointment form I have used a business rule to unlock these fields if the status is 'Completed'.
However, the Required Attendees field is not visible to select for a business rule, any ideas how I can achieve this?
Thank you
Ladga
Hi Ladga,
The reason why the Required Attendees field is not visible in the business rule is that it is a Party List type field.
So, in order to unlock the Required Attendees field, we have to use Javascript.
Here are steps.
Edit the Appointment form, open the Form Properties.
Add a form library.
New a web resource, select Type to Script. Edit the text to the follow. Then publish it. Add the new web rescource.
function unlockfield(executionContext)
{
var formContext = executionContext.getFormContext();
var headerControl = formContext.getControl('header_statecode');
var status = headerControl.getAttribute().getText();
if(status=="Completed")
{
formContext.getControl("requiredattendees").setDisabled(false);
}
}
Add a OnLoad event.
Type function to unlockfield. Select "Pass execution context as first parameter".
Save and publish the form.
When we open an appointment which is completed, the Required field is editable, we can save the change of this field.