ITSM

Narmadha PR
Tera Contributor

Please help me with my requirement:

AC1.Given that I have selected a value in the "Company" field in the change request table, then when clicking on "Add" button in the Affected CIs related list should show data related to the relevant value selected in the company field.

AC2. Given that the "Company" field is empty on a change record, then the "Business Service", "Service Offering" and "Configuration Item" fields are readonly and cannot be filled.

 

For the AC2. I've created a onChange client script, which is making the "Business Service" and "Service Offering" fields readonly, but the "Configuration Item" field is not becoming ready only. Also check this in my pdi still getting the same issue.

OnChange client script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
g_form.setReadOnly('service_offering', true);
g_form.setReadOnly('business_service', true);
g_form.setReadOnly('cmdb_ci', true);
return;
}
1 REPLY 1

Mark Manders
Mega Patron

Why an 'onChange client script'? A UI policy would work, right? No scripting needed. Just put the fields as read only (also: check on existing UI policies/client scripts to see why the ci field didn't get read only, you may have colliding logic).

 

I am curious about this logic, because a change isn't done on company level (although I don't know your business, so I could be wrong), but on CI level. And a CI can be anything and therefor also related to multiple companies. A server is getting a change after which it needs rebooting, affecting all companies that are using the application running on that server. But as I said, I don't know your business, so maybe it is valid. 
To change the filter (be sure that this is always the case, because it will go for all changes), you can find the related list (task_ci.task) in the sys_ui_related_list_entry table, pick the change request one with your view and add a filter on that record.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark