Hi,
We are having a editable grid where the columns are relation, soeid, geid, firstname, lastname.
Relation is a dropdown field with the values {employee, contractor, client}.
Soeid is a user picker field and the remaining columns are text fields.
If user select employee or contractor in the dropdown and he should select soeid then the remaining columns will autopopulate related to the soeid.
If user select client then the soeid and geid get disabled(grayed out) and he needs to fill all the other columns.
My task is here
1. when the user first select employee and enter a soeid then the other columns will populate.
2. if the user select client again in the dropdown the soeid, geid, firstname, lastname which was already populated should become blank.
How to achieve the above functionality
Thanks in advance.
Discussion posts and replies are publicly visible
rows:{ a!forEach( items:ri!relatedPersons, expression: a!gridRowLayout( contents: { rule!relatedPersonIncidentDropdown( selectedRole: fv!item.relationship, disabled: ri!readOnly= true, ), a!pickerFieldUsers( value: fv!item.soeid, a!localVariables( local!empData: rule!QE_Employee(soeId: fv!item.soeid).data, if( a!isNullOrEmpty(fv!item.soeid), { a!save(fv!item.geid,{}), a!save(fv!item.firstName,{}), a!save(fv!item.lastName,{}), }, { a!save(fv!item.geid, local!empData.geid), a!save( fv!item.firstName, local!empData.firstName ), a!save( fv!item.lastName, local!empData.lastName ), } ) ), }, maxSelection: 1, showWhen: not(ri!oreRelated= true), readOnly: ri!readOnly= true, disabled: and(not(rule!AF_RULE_isBlank(fv!item.relationship)), not(contains(cons!GCC_VAL_RELATION, fv!item.relationship ) ) ) ), a!textField( value: fv!item.geid, saveInto: fv!item.geid, showWhen: not(ri!oreRelated = true), readOnly: ri!readOnly = true, disabled: not( rule!AF_RULE_General_isBlank(fv!item.relationship) ) ), a!textField( value:fv!item.lastName, saveInto: fv!item.lastName, readOnly: ri!readOnly= true, disabled: and(contains(cons!GCC_VAL_RELATION, fv!item.relationship ), not(ri!oreRelated= true) ) ), a!richTextDisplayField( showWhen: not(ri!readOnly= true), value: a!richTextIcon( icon: "times", color: "Negative", linkStyle: "STANDALONE", link: a!dynamicLink( value: null, saveInto:{ a!save( ri!relatedPersons, value: remove(ri!relatedPersons, fv!index) ),})))}) )