I have an editable grid in my interface. I need to make a text field required based on values in one column of the grid. I have used the following statements in the required attribute of the text filed:
if(contains(ri!itemsRoles.InfoSecDisposition,"Return to Customer"),false(),true()) - this give me the error: Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'contains' parameter 2 [line 667]: Invalid index: Cannot index property 'InfoSecDisposition' of type Text into null value of type saasRoles?list
I've also tried the following statement:
if(contains(ri!itemsRoles.InfoSecDisposition,"Return to Customer"),false(),true()) - this gives me the error: Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'contains' parameter 1 [line 667]: Could not find variable 'fv!item'
Is there a way the I could make a text field required when the user selects certain value in a grid?
Discussion posts and replies are publicly visible
Hi,
Place a null or empty array check for ri!itemRoles before the evaluation of the condition.
i.e.
if( or(ri!itemRoles="",ri!itemRoles=null), false(), contains( touniformstring(ri!itemsRoles.InfoSecDisposition), cons!VALUE_TO_CHECK) )
This will evaluate the condition only if the array is not empty or null. Also Would suggest using constants for storing the value(s) which you would like to check.