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

    If you're acting upon an unpopulated ri!businessPartner, then the error you're seeing would be expected as far as I know.  "ri!businessPartner.contacts" would refer to an empty set, and the further ".firstName" property would not exist within that empty set, directly leading to the error message you've posted. 

    If you're adding a new Business Partner, i'm thinking you'll want to have a control on the form where the user clicks to add the first Contact, and that click would add an empty FIR_Contact entry to the first entry of ri!businessPartner.contacts; at this point you could directly address that new instance and save data into it.  This might be a good use case for an editable grid (even if it just has one or two fields per row) as it implicitly handles arrays like this when configured properly.

Reply
  • 0
    Certified Lead Developer

    If you're acting upon an unpopulated ri!businessPartner, then the error you're seeing would be expected as far as I know.  "ri!businessPartner.contacts" would refer to an empty set, and the further ".firstName" property would not exist within that empty set, directly leading to the error message you've posted. 

    If you're adding a new Business Partner, i'm thinking you'll want to have a control on the form where the user clicks to add the first Contact, and that click would add an empty FIR_Contact entry to the first entry of ri!businessPartner.contacts; at this point you could directly address that new instance and save data into it.  This might be a good use case for an editable grid (even if it just has one or two fields per row) as it implicitly handles arrays like this when configured properly.

Children
No Data