are you familiar with dynamic windows? If not, first take a look at the following article: Dynamic Windows - Understanding Window Calculations
I think that should help you to show or hide an attribute in a window.
thanks for your reply.
I am familiar with dynamic windows, howver, i have only configured dynamic windows for the hide/show fields when a specific service is selected (field hide/show depending on the service selected in the service catalog).
ex (If the service "X-Connect - New X-Connect setup" is selected, show the following fields:
static def GetAttributeValue(Request):
HNewx = true
MNewx = false
if Request._ConfigItemRequested != null:
if Request._ConfigItemRequested.Title == "X-Connect - New X-Connect setup":
HNewx = false
MNewx = true
However, i am not familiar on how this is done with the calculation i am seeking
on the same window: (when field x has values, show that field, if not, hide the field)
I think the calculation will look almost the same. But I'm not sure if it will work with string values, because there is no property that enables the attribute to trigger calculations on change.
So it could look like this:
if Request._RiskOfDoing != null:
Hidden = true
Currently I seriously doubt, that it will work that way because of the missing "Is calculate on change" property, but I think it is worth a try.
Have a try and let us know.
thanks for the feedback.
I will give it a try then, but what happens in case you have a field on a window that you want to remove? does a complete new window need to be designed?
The objective of the merge of both field is that the Change process is a bit "Heavy" at the time a we want to simplify it. We wanted, instead of having 2 separate fields (risk of doing and risk of not doing) have just 1 field (risk of doing/not doing).
But this can generate errors if i simply delete 1 of the fields because we have previous records were both field are already filled and this can generate errors.
then just hide the not used field permanently from view. You can set the property of that attribute accordingly in your Window Manager. Then it is hidden and cannot be used, but will generate no error. You can also hide the group box if it still pops up.
Maybe that's an option?
That solution would work, however, if we have users that want to preview old records and have details in that field that i want to hide, this field would not be available anymore.
Thus the reason why i was verifying a solution to show the field only if it has values in it.
Ah, then I've got another Idea:
Do you know how to use View Rules?
Just add a new window and call it e.g. Request Create. In that window (you can copy it) just remove or hide the not used attribute.
Use the existing window and set the corresponding attribute to read only, so that no one can enter new information in future.
Create a view Rule and define the two windows, one for creation, one for update. So any existing request can be viewed with the "old" attribute, but if you create a new request, no one can see that attribute and it won't be populated.