I have a page where users need to be able to change a picklist to change the status of a record, such as “working”, “submitted”, etc. However, normal users shouldn’t be able to put it into the approved status. I know I can add a validation rule that says "if the user’s profile = x and the picklist value = “approved”, then throw error message ‘you can’t select that’ ", but the ideal way, of course, is to prevent a normal user from being able to select the “accepted” value in the first place. This seems like a perfect opportunity for a custom Skuid renderer! I’m thinking that in read mode the picklist shows the current value, but in edit mode it shows only values that the current user has access to based on their profile. Something like: if (field.mode == ‘read’) { skuid.ui.fieldRenderers[field.metadata.displaytype]field.mode; } else if (field.mode == ‘edit’) { /* if (profile != admin) { add picklist value ‘working’; add picklist value ‘submitted’; } else if (profile = ‘admin’) { add picklist value ‘approved’; } render picklist in edit mode */ } How would I do this (or create an equivalent or similar solution)? Bonus points: Maybe it can also prevent normal users from changing the status from “approved” to something else?
Question
How do I render custom picklist values?
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.