Issue with nested CDTs and a!writeToDataStoreEntity

We have a nested data model but our CDT's are flat so we save the parent first and use the PK to save the children. I think this is the recommended practice as there are issues with nested cdt's. The problem I am having is with the new 16.2 a!writeToDataStoreEntity expression that allows saving cdt's from SAIL. When saving nested structure on SAIL form we will have two a!writeToDataStoreEntity calls - one for parent and other for all children which gives the attached error. Is there a way to work around this? Is this something that will be fixed in future releases?

OriginalPostID-220503

OriginalPostID-220503

  Discussion posts and replies are publicly visible

Parents
  • Hi Gents,
    It is possible to save to nested CDTs using this function.

    consider the following CDTs:
    w2ds_parent(
    pkid (number pk auto),
    textfield (text),
    w2ds_child (w2ds_child)
    )
    //

    w2ds_child(
    pkid (number pk auto),
    textfield (text)
    )
    //

    On your submit button, the saveInto syntax is as follows:

    saveInto: {
              a!writeToDataStoreEntity(
                        cons!w2ds_parent,
                        'type!{urn:com:appian:types}w2ds_parent'(
                                  textfield: local!parentText,
                                  w2ds_child: 'type!{urn:com:appian:types}w2ds_child'(
                                            textField: local!childText
                                  )
                        )
              )
    }


Reply
  • Hi Gents,
    It is possible to save to nested CDTs using this function.

    consider the following CDTs:
    w2ds_parent(
    pkid (number pk auto),
    textfield (text),
    w2ds_child (w2ds_child)
    )
    //

    w2ds_child(
    pkid (number pk auto),
    textfield (text)
    )
    //

    On your submit button, the saveInto syntax is as follows:

    saveInto: {
              a!writeToDataStoreEntity(
                        cons!w2ds_parent,
                        'type!{urn:com:appian:types}w2ds_parent'(
                                  textfield: local!parentText,
                                  w2ds_child: 'type!{urn:com:appian:types}w2ds_child'(
                                            textField: local!childText
                                  )
                        )
              )
    }


Children
No Data