This is not a question but would like to share something which might be helpful

This is not a question but would like to share something which might be helpful for others.
Use Case: You have a CDT with few elements and a SAIL form which displays the elements. You want to add new elements to the CDT and update the new element to the SAIL form. But doing this will break the Sail form for the inflight tasks which are having the older versions of the CDT and doesn’t have the new element in it.
Example: You have a “Customer_Address” CDT with below structure
          MailingAddress (Customer_Address)
                                        Id (Number (Integer))
                                        LineOne (Text)
                                        LineTwo (Text)
                                        City (Text)
                                        State (Text)
                                        Country (Text)

Now you want to add the element zip code to it and make it as
          MailingAddress (BW_CMPO_Address)
                                        Id (Number (Integer))
                                        LineOne (Text)
                                        LineTwo (Text)
                                        City (Text)
                                        State (Text)
Zipcode (Number (Integer))
                                        Country (Text)

                                        
Now if you directly refer the zi...

OriginalPostID-174264

OriginalPostID-174264

  Discussion posts and replies are publicly visible

Parents
  • ...pcode in your SAIL code, the older tasks would break. The following SAIL code would not cause any issues.
    if(
    rule!CheckIfTrue(
    index(
    ri!MailingAddress,
    "Zipcode",
    true
    )
    ),
    {},
    a!textField(
    label: "Zip Code",
    instructions: "",
    labelPosition: "ADJACENT",
    value: ri!MailingAddress. Zipcode
    )
    )

    The index function above would return true when the element is not found and so the text field will not be displayed. For tasks with new version of the CDT, the index function above will return the Zipcode value (if the value is null, it will return null value) and so the text field will be displayed.
    I am sure many already know this but I hope this is helpful to someone. If someone have any better ways of doing this, please feel fre...
Reply
  • ...pcode in your SAIL code, the older tasks would break. The following SAIL code would not cause any issues.
    if(
    rule!CheckIfTrue(
    index(
    ri!MailingAddress,
    "Zipcode",
    true
    )
    ),
    {},
    a!textField(
    label: "Zip Code",
    instructions: "",
    labelPosition: "ADJACENT",
    value: ri!MailingAddress. Zipcode
    )
    )

    The index function above would return true when the element is not found and so the text field will not be displayed. For tasks with new version of the CDT, the index function above will return the Zipcode value (if the value is null, it will return null value) and so the text field will be displayed.
    I am sure many already know this but I hope this is helpful to someone. If someone have any better ways of doing this, please feel fre...
Children
No Data