Hi,
Here I am having one dropdown if I select Exclusion there then category,type and add exclusion button will be visible. But when I click on add exclusion button in next category and type are getting duplicated I dont want that I want to select other exclusion and Type differently . How can I achieve it?
Code:
local!set: if(a!isNotNullOrEmpty(local!exclusionList), index(local!exclusionList.set,1,{}), {}),
saveInto: { a!forEach( items: local!exclusionList, expression: a!save( local!exclusionList, append( local!exclusionList, a!map( set: local!set, coveragetoRoleId: ri!basCoverageToRole['recordType!{33c2cbea-4c4e-4288-9d10-d6107f847a76}UWG Coverage To Role.fields.{c8b1b4ee-b5f4-494d-bcf3-763d83073e71}id'], standardUWSupportCodeRefId: null, exclusionText: "" ) ) ) ) },
Discussion posts and replies are publicly visible
harshithal2027 said:But when I click on add exclusion button in next category and type are getting duplicated I dont want that I want to select other exclusion and Type differently .
... I don't understand ...
Please explain it like to a 5 year old.
same date is getting populated when I click on addAnotherExclusion but it shouldnot populate the same data
Could you please copy and paste all the code?
.... I really do not like being forced to guess what you are doing and to roll a dice for the purpose ... !
A typical issue is that you use a foreach to display multiple items, but in the saveInto you store directly into the rule input. Use fv!item as the save target instead.
As per my understanding you want the fileds to be emply/blank when you click on the 'Add Another Exclusion' link. Probably the fields in the section is referring to the same array variable and index that is used in the first section. You need to check and correct the value and saveinto for this section. IF you can share code of the section that renders these 3 fields we can help debug better.
Please insert code in community posts using
Please don't use loop.
saveInto: { a!save( local!exclusionList, append( local!exclusionList, a!map( set: {}, coveragetoRoleId: ri!basCoverageToRole['recordType!{33c2cbea-4c4e-4288-9d10-d6107f847a76}UWG Coverage To Role.fields.{c8b1b4ee-b5f4-494d-bcf3-763d83073e71}id'], standardUWSupportCodeRefId: null, exclusionText: "" ) ) ) }