Hi All,
In Editable grid using a!multipleDropdownField(), when user selects the two values in multiple dropdown field then it is storing in CDT ri!rules[fv!index].clientID like (clientID 1234; 7890)
a!save( ri!rules[fv!index].clientID, fv!item.clientID )
Here, for each selected clientID, how to build same CDT with second selected clientID.
Sample code is pasted for a!multipleDropdownField() which is used in Editable grid
Requirement is for each selected clientID in multiple dropdown, on click on button need to display in another editable grid for two selected clientID in separate two rows.
a!multipleDropdownField( label: "clientID", placeholder: "Type in Client Name/clientID", choiceLabels: if( rule!APN_isEmpty(ri!clientDetails), {}, append(a!forEach( items: ri!clientDetails, expression: index(fv!item, "custname", {}) & " - " & index(fv!item, "clientID", {}) ),"NONE") ), choiceValues: append(if( rule!APN_isEmpty(ri!clientDetails), {}, index(ri!clientDetails, "clientID", {}) ),"NONE"), value: if(length(trim(split(fv!item.clientID,";")))>1,trim(split(fv!item.clientID,";")),fv!item.clientID), saveInto: { fv!item.clientID, /*a!save(fv!item.clientID,split(fv!item.clientID,";"))*/ /*,*/ a!save( ri!rules, if( rule!APN_isEmpty(ri!rules), local!rulesGrid, ri!rules ) ), a!save( ri!rules[fv!index].clientID, fv!item.clientID ), a!save( ri!selectedObligorsId, ri!rules[fv!index].clientID ) }, searchDisplay: "ON", required: true, requiredMessage: "Value is required", validations: {}, )
Regards,Sandeep
Discussion posts and replies are publicly visible
Hi,
You can use save!value
a!save( fv!item.clientID, tostring(save!value) )
Hi Vinay, Thank you.Actually i am looking for some sample code, when two dropdown values selected from the a!multipledropdown() in an Editable grid instead of storing two values in CDT ri!rules.clientID like:
[1]
id: nullname: [Test]clientID: [1234; 7890]
[2]
id: nullname: [ABC]clientID: null
whether it is possible to store like this:
id: nullname: [Test]clientID: [1234]
id: nullname: [Test]clientID:[7890]
You'll have to do some additional logic on your own. Maybe save first to a local variable as intermediate step. Then on submit, a!forEach intermediate step, a!forEach fv!item.clientID, saveInto finalState type!CDT(fill it with copy of parent fields and fv!item for clientID)
a!forEach( items: local!intermediate, expression: a!localVariables( local!parent: fv!item, a!forEach( items: local!parent.clientID, expression: type!myCDT( field1: local!parent.field1, field2: local!parent.field2, field3: local!parent.field3 clientID: fv!item ) ) )
Thank you DaveI will try to put this logic and work on.