Multi Value CDT

I've defined a CDT as a Multi Value. At run time I will have 'n' instances of the object.
During runtime I wish to update a specific field for one of the instances of the object but I'm not seeing how to address the field correctly.

I cant use array[1].field  as that's only addressing the first instance. So for example I have at run time the multi Value CDT with the values :

                         Instance1   Instance2    Instance3

Field1(Text)             A               D                    G         

Field2(Text)             B               E                    H

Field3(Boolean)        true           false               false

I want to change Instance3 Field 3 from false to true, (and ideally instance 1/2 to false)

 

 

 

  Discussion posts and replies are publicly visible

  • All sorted .. not enough coffee this morning.
  • Hello,

    You can either modify the particular object and property within your process model using a script task node or within a SAIL form.

    1.

    2. Based on user actions you can modify the property of an object using a!save() function.

    you can play with the following code:

    load(
      local!animal_cdts: {
        {id: 1,description: "snake",isActive: true},
        {id: 1,description: "dog",isActive: true},
        {id: 1,description: "cat",isActive: true}    
      },
      a!formLayout(
        contents: {
          a!gridLayout(
            headerCells: {
              a!gridLayoutHeaderCell(label: "Description"),
              a!gridLayoutHeaderCell(label: "Status"),
              a!gridLayoutHeaderCell(label: "")
            },
            columnConfigs: {
              a!gridLayoutColumnConfig(weight: 6),
              a!gridLayoutColumnConfig(weight: 3),
              a!gridLayoutColumnConfig(width: "ICON")
            },
            rows: {
              a!forEach(
                items: local!animal_cdts,
                expression: a!gridRowLayout(
                  contents: {
                    a!textField(
                      value: property(fv!item,"description",null),
                      readOnly: true
                    ),
                    a!textField(
                      value: if(toboolean(property(fv!item,"isActive",false)),"Active","Inactive"),
                      readOnly: true
                    ),
                    a!imageField(
                      images: a!documentImage(
                        document: a!iconIndicator(
                          icon: "REMOVE"
                        ),
                        link: a!dynamicLink(
                          value: fv!index,
                          saveInto: {
                            a!save(
                              target: fv!item.isActive,
                              value: false
                            )
                          }
                        ),
                        showWhen: toboolean(property(fv!item,"isActive",false))
                      )
                    )
                  }
                )
              )
            }
          )
        }
      )
    )

    Hope it helps.

    Regards.

  • Hi Paul, can you help me with how you acheived the solution for this? I am facing the same thing. Thanks in advance