Hi All, I have a CDT rule input of type "Any Type" called r

Hi All,

I have a CDT rule input of type "Any Type" called ri!companyContact. I am trying to pass this rule input to a textField's value field. There is a nested CDT inside this CDT. I am actually trying to store the value into one of those fields inside the inner CDT. But it is giving an error saying "Cannot index property "CompanyContactDetails" of type Text into type Text" where inner CDT is called "CompanyContactDetails".
This is the code:

a!textField(
label:"",
value: ri!companyContact.CompanyContactDetails.DetailTypeId,
saveInto: ri!companyContact.CompanyContactDetails.DetailTypeId
)

Can anybody help on this issue?...

OriginalPostID-107781

OriginalPostID-107781

  Discussion posts and replies are publicly visible

Parents
  • If you didn't pass in the CDT it will not work. It cannot find that field because it doesn't exist. You could use the index() instead of dot notation when reading out of the CDT for a more robust expression.

    a!textField(
    label:"",
    value: index(index(ri!companyContact,"CompanyContactDetails",{}),"DetailTypeId",{}),
    saveInto: ri!companyContact.CompanyContactDetails.DetailTypeId
    )

Reply
  • If you didn't pass in the CDT it will not work. It cannot find that field because it doesn't exist. You could use the index() instead of dot notation when reading out of the CDT for a more robust expression.

    a!textField(
    label:"",
    value: index(index(ri!companyContact,"CompanyContactDetails",{}),"DetailTypeId",{}),
    saveInto: ri!companyContact.CompanyContactDetails.DetailTypeId
    )

Children
No Data