We have an editable grid, in the second column if the user selects "primary" on more than one row; the grid displays an error.Is there a way to hide the "Primary" option from the consequent dropdown values; if the user selects "Primary" on any of the columns?
OriginalPostID-216959
Discussion posts and replies are publicly visible
Any specific solution which worked mohamedb?
Here is a sample code logic that can do the same. Ensure you refine the code as you want and apply necessary best practices
a!localVariables( local!choiceValues: { "Primary", "Choice 2", "Choice 3" }, local!selectedRoles: {}, { a!gridLayout( label: "Editable Grid", labelPosition: "ABOVE", headerCells: { a!gridLayoutHeaderCell(label: "Header Cell") }, columnConfigs: {}, rows: a!forEach( items: local!selectedRoles, expression: { a!gridRowLayout( contents: { a!dropdownField( label: "Ownership Role", placeholder: "Select", choiceLabels: difference( local!choiceValues, difference(local!selectedRoles, fv!item) ), choiceValues: difference( local!choiceValues, difference(local!selectedRoles, fv!item) ), value: fv!item, saveInto: fv!item ) } ) } ), selectionSaveInto: {}, validations: {}, addRowLink: a!dynamicLink( label: "Add Row", saveInto: { a!save( local!selectedRoles, touniformstring(append(local!selectedRoles, null)) ) } ), shadeAlternateRows: true ) } )