Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 13696

Re: How can i make fields Conditional Mandatory

$
0
0

Something like this could help:

 

import System
static def GetAttributeValue(Incident):          // Raise User selected but Severity AND Urgency not --> Both Attributes Mandatory          if Incident._IncidentUrgency == null and Incident.Severity == null:                    return String.Format(":SetMandatory(_IncidentUrgency,true);:SetMandatory(Severity,true);")          // Raise User selected, Severity null, but Urgency not --> Only Urgency mandatory          if Incident._IncidentUrgency != null and Incident.Severity == null:                    return String.Format(":SetMandatory(_IncidentUrgency,true);:SetMandatory(Severity,false);")          // Raise User selected, Severity not null, but Urgency null --> Only Severity mandatory          if Incident._IncidentUrgency == null and Incident.Severity != null:                    return String.Format(":SetMandatory(_IncidentUrgency,false);:SetMandatory(Severity,true);")          // Raise User, Severity and Urgency selected --> Nothing mandatory          if Incident._IncidentUrgency != null and Incident.Severity != null:                    return String.Format(":SetMandatory(_IncidentUrgency,false);:SetMandatory(Severity,false);")          return return String.Format(":SetMandatory(_IncidentUrgency,true);:SetMandatory(Severity,true);")

 

My example changes the mandatory property of Incident Urgency and Severity wether one of the fields is selected.

To initiat the calculation I have the Raise User as Dependency additional.

The necessary dependencies are Incident Urgency and Severity and all three reference lsist have the option "Is calculate on change" set to true.

 

Maybe this gives you an idea how dynamic windows can work.

 

Regards

Fabian


Viewing all articles
Browse latest Browse all 13696

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>