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
  • Here's the whole code:


    load(



    local!detailType:if(rule!COMMON_IsNullOrEmpty(rule!DCMIFS_GetDetailType()), {},rule!DCMIFS_GetDetailType()) ,
    a!sectionLayout(
                        label:"Details",
                        firstColumnContents:{
                        a!textField(
                        label:"Phone Number",
                        value:index(index(ri!companyContact1, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact1.CompanyContactDetails.Value
                        ),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact1, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto:ri!companyContact1.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Email",
                        value:index(index(ri!companyContact2, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact2.CompanyContactDetails.Value),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact2, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact2.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Website",
                        value:index(index(ri!companyContact3, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact3.CompanyContactDetails.Value
                        ),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact3, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact3.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Twitter Hashtag",
                        value:index(index(ri!companyContact4, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact4.CompanyContactDetails.Value),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact4, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact4.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!paragraphField(
                        label:"Location Notes",
                        value:"",
                        saveInto:""
                        )
    })
    )
Reply
  • Here's the whole code:


    load(



    local!detailType:if(rule!COMMON_IsNullOrEmpty(rule!DCMIFS_GetDetailType()), {},rule!DCMIFS_GetDetailType()) ,
    a!sectionLayout(
                        label:"Details",
                        firstColumnContents:{
                        a!textField(
                        label:"Phone Number",
                        value:index(index(ri!companyContact1, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact1.CompanyContactDetails.Value
                        ),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact1, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto:ri!companyContact1.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Email",
                        value:index(index(ri!companyContact2, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact2.CompanyContactDetails.Value),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact2, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact2.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Website",
                        value:index(index(ri!companyContact3, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact3.CompanyContactDetails.Value
                        ),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact3, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact3.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!textField(
                        label:"Twitter Hashtag",
                        value:index(index(ri!companyContact4, "CompanyContactDetails", {}), "Value", {}),
                        saveInto:ri!companyContact4.CompanyContactDetails.Value),
    a!dropdownField(
    label:"Detail Type",
    placeholderLabel:cons!DCMIFS_DROPDOWN_PLACEHOLDER_LABEL,
    choiceLabels: rule!APN_distinct(local!detailType.DetailType),
    choiceValues: rule!APN_distinct(local!detailType.DetailTypeId),
    value:index(index(ri!companyContact4, "CompanyContactDetails", {}), "CompanyContactDetailId", {}),
    saveInto: ri!companyContact4.CompanyContactDetails.CompanyContactDetailId
    ),
                        a!paragraphField(
                        label:"Location Notes",
                        value:"",
                        saveInto:""
                        )
    })
    )
Children
No Data