Useage of a!writeToMultipleDataStoreEntities in sail forms

Hello Everyone!

 

So I am trying to get a!writeToMultipleDataStoreEntities and I am not having any luck getting even the most basic save to work.  Does anyone have any thoughts on why this may not be working?

 

The error I am getting is: 

Could not display interface. Please check definition and inputs.

Interface Definition: Expression evaluation error: An error occurred while executing a smart service: An error occurred while trying to write to the data store [Transactional]. No values have been written. Details: could not insert: [ENTITYToWriteDT6746] (APNX-1-4208-004) This error will not be displayed to the user viewing this form. 

 

= a!formLayout(
  label: "Form",
  /*should match PM Test Write to DS*/
  contents: {
    a!paragraphField(
      text: ri!error & ri!success
    )
  },
  buttons: a!buttonLayout(
    secondaryButtons: {
      a!buttonWidgetSubmit(
        label: "TEST WRITE",
        style: "NORMAL",
        value: true,
        saveInto: {
          a!writeToMultipleDataStoreEntities(
            valuesToStore: {
              a!entityData(
                entity: cons!ENTITY_TO_WRITE,
                data: {
                 ri!entity
                }
              )
            },
            onSuccess: a!save(
              ri!success,
              "successs"
            ),
            onError: a!save(
              ri!error,
              "errorr"
            )
          )
        },
        skipValidation: true
      )
    }
  ),
  validations: {}
)

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer
    Hi @Seth Solomon is the entity referred by your constant and the rule input data is of same type?

    Also can you cross check whether the CDT is empty, which you are trying to persist.

    However to debug this issue , can you please create a process where you will have one parameter i.e. of type your rule input.

    Now on button submit use a!startProcess and pass your rule input as parameter to it.

    Now use write to multiple data store entity to persist the data, and check whether the node is getting break or not, if it's getting break then check your process variable which you have sent through your SAIL .

    Hope this will help you in investigate the issue.
Reply
  • +1
    Certified Lead Developer
    Hi @Seth Solomon is the entity referred by your constant and the rule input data is of same type?

    Also can you cross check whether the CDT is empty, which you are trying to persist.

    However to debug this issue , can you please create a process where you will have one parameter i.e. of type your rule input.

    Now on button submit use a!startProcess and pass your rule input as parameter to it.

    Now use write to multiple data store entity to persist the data, and check whether the node is getting break or not, if it's getting break then check your process variable which you have sent through your SAIL .

    Hope this will help you in investigate the issue.
Children