Share all details about your problem, including any error messages you may have received.
I have a field named user, if the user is in inactive state then I want the “Agree” checkbox field to be hidden and if the user is active then the checkbox is not hidden.
The user field value is stored as flag and I am returning the hasInvalidStatus flag(true/false). So I want help to write if the flag value is true then hide the AGree field and Submit button else show.
<Section name="User Info">
boolean hasInvalidStatus = false;
<<this section I am taking the user input and returning the flag hasInvalidStatus=true or hasInvalidStatus=false>>
return hasInvalidStatus;
</Section>
<Section name="ValidationWarning">
<Attributes>
<Map>
<entry key="hidden">
<value>
<Script>
<Source>
if ("true".equalsIgnoreCase(String.valueOf(hasInvalidStatus)))
{
return false;
}
return true;
</Source>
</Script>
</value>
</entry>
</Map>
</Attributes>
<Field displayName="" name="validationWarning" type="string"/>
</Section>
<Section name="I confirm that the details entered are correct.">
<Attributes>
<Map>
<entry key="hidden">
<value>
<Script>
<Source>
if(form.getFieldValue(false)) {
<<then hide>>
}
<<not hide>>
</Source>
</Script>
</value>
</entry>
<entry key="subtitle" value="I confirm that the details entered are correct"/>
</Map>
</Attributes>
<Field displayName="Agree" name="action" required="true" type="boolean"/>
</Section>
<Button action="next" label="Submit" value="submit"/>