regarding value in a text field

what actually happens 

when we give 

1)a!textField(

label:"First Name",

value:ri!emp.firstName,

saveInto:ri!emp.firstName

)

2)a!textField(

label:"First Name",

value:index(ri!emp,"firstName",null),

saveInto:ri!emp.firstName

)

or

2)a!textField(

label:"First Name",

value:property(ri!emp,"firstName",null),

saveInto:ri!emp.firstName

)

in what scenario's we need to use first one / second one...

  Discussion posts and replies are publicly visible

Parents Reply
  • Additionally, one use case for property() with a flat CDT is during enhancements when a new field is added - if you have running process instances which may utilize the prior version of the CDT, missing the new field, you can eliminate errors with something like below (example if Middle Name were added post go-live):

    a!localVariables(
      local!cdt: {
        firstName: "John",
        lastName: "Doe",
        /*middleName: "M"*/
      },
      {
        a!textField(
          label: "First Name",
          value: local!cdt.firstName,
          saveInto: local!cdt.firstName
        ),
        a!textField(
          label: "Middle Name",
          showWhen: not(isnull(property(local!cdt,"middleName",null))),
          value: local!cdt.middleName,
          saveInto: local!cdt.middleName
        ),
        a!textField(
          label: "Last Name",
          value: local!cdt.lastName,
          saveInto: local!cdt.lastName
        )
      }
    )

Children