Highlighted
Super Contributor.
Super Contributor.
478 views

How to make RQ_TARGET_RCYC checkbox as readonly if the requirement is other than Not Covered status

I have a requirement to preserve all checked target Cycle for Requirements when requirement status is other than Not Covered.

Means, in case the requirement is in Not Covered state, then user can modify (check/uncheck) cycle check boxes as usual but if the requirement is in any other coverage status, then it should display a warning that only admin can change it.

Any lead to make checkboxes as readonly.

0 Likes
9 Replies
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

I think it will be a bit tricky. Are you putting the restriction only on the Target Cycle? Meaning, only the Target Cycle field is locked out is the requirement is not covered, all other requirement fields are free to be modified? If so, you can set the permission to Target Cycle as not "updateable" like no check in the Permissions settings. Then presumably you can add a workflow script in the Req_FieldChange or FieldCanChange event that would evaluate the value of the Cover Status and based on the condition, reset the field permissions for the Target Cycle.  

Not sure if this would work, I have never tried it.  Also, I do not provide direct code, only an algorithm.
Give a man fish and they can eat for the day. Teach a man how to fish and they can eat for the rest of their lives.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

@sheyenne : Thanks for your help. Actually the requirement is, none except admin would be able to remove any existing target cycle checkbox for requirement but should be able to add new Target Cycle checkbox. They would only be able to remove existing Target Cycle checkbox only if the requirement is not covered state.

If I restrict user to update Target Cycle for Requirement from groups and permission, then they will not be able to add another Target Cycle checkbox (multiselect).   

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

This is possible to implement with some scripting. You can store the value of the Target Cycle field in a global variable in the workflow. Then whenever a user tries to update the field you should be able to iterate over the Target Cycles referred to in FieldCanChange to see if any of the previously selected Cycles have been removed,
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

@Priyotosh_ganguly How are you making Target Cycle, a system to field accept multi values?

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

The requirement Target Cycle field allows you to connect to multiple cycles by design.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Highlighted
Super Contributor.
Super Contributor.

@NEW_ALM12 : Yes. It's a system field that accepts multiple values.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

@Jan Czajkowski : Thanks for your valuable comment.

Would it be possible for you a bit more info on how to handle this through script... mostly on how I save it in global variable and fetch that.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Hi Jan,

How are you doing?

I am trying with below code in Req_FieldCanChange to store the selected variable values for target cycle.

 

If Fieldname = "RQ_TARGET_RCYC" then
Set aList = NewValue
msgbox aList.count
for j=0 to (aList.Count - 1)
set rc = Req_Fields.Field("RQ_TARGET_RCYC").Value
msgbox rc.Item(j).Name
Next
Exit Function
End if
End If

 

but the values seems inconsistent. Can you please help. I am trying to store existing check boxes in a variable so that I could check if user has unchecked any previous checked one and refrain user from doing that.

Thanks in advance.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

 Anyone have any input on how I could implement this.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.