Interface Error dealing with an array inside a CDT

Briefly, the situation is as follows:
-My Data Type of a FIR_BusinessPartner, has an array of Contacts, of data type FIR_Contacts.

-In my FIR_AddBusinessPartnerForm, at least 1 contact info is required.

-Although I am passing a BusinessPartner as a RI, which includes an array of FIR_Contacts, it still won’t let me access that array properly.

 

Question/Issue:

1- For example, in FirstName text box, I can’t “Save Input to” “ri!businessPartner.contacts.firstName” naturally, I have to type that as an expression, is that normal?

2- It is not allowing me to “Display Data” with the same expression above, gives me an error of the following.

Please advise.

Thank you.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    In short your error message means that you didn't handle "null" properly.  Appian frequently interprets null of an unknown type as null Text type.  So when it receives null from your CDT, where a sub-CDT should be, it has nothing to grab the structure from.  So it doesn't know anything at all about the structure, which is why it can't find the 'firstName' property of the nothing.

    Check to make sure the FIRContactList has a length greater than 0 before attempting to grab values from it. 

    You may also want to consider, if your user is supposed to input the first entry, to make all the components a separate local variable that you can then save into the larger CDT's contactList.  For instance, local!startingFIRContact.  Then your text inputs can save into that, and a button can save that into the larger CDT.  And if your query does get valid values for it in the beginning, you can overwrite the local variable with the contents from the query, otherwise it will still have a structure and won't crash.

Reply
  • 0
    Certified Lead Developer

    In short your error message means that you didn't handle "null" properly.  Appian frequently interprets null of an unknown type as null Text type.  So when it receives null from your CDT, where a sub-CDT should be, it has nothing to grab the structure from.  So it doesn't know anything at all about the structure, which is why it can't find the 'firstName' property of the nothing.

    Check to make sure the FIRContactList has a length greater than 0 before attempting to grab values from it. 

    You may also want to consider, if your user is supposed to input the first entry, to make all the components a separate local variable that you can then save into the larger CDT's contactList.  For instance, local!startingFIRContact.  Then your text inputs can save into that, and a button can save that into the larger CDT.  And if your query does get valid values for it in the beginning, you can overwrite the local variable with the contents from the query, otherwise it will still have a structure and won't crash.

Children
No Data