Skip to main content
julienc
June 8, 2022
Question

How to insert Data and get database ID as an output of my process?

  • June 8, 2022
  • 6 replies
  • 0 views

My process inserts a new record in table CONTACT.

Using AC!StoredValues, the process variable pv!contact is correctly updated with the ID (in debug, I see it in the process variables).

Now I would like to understand why it is not updated in the interface calling the process as bellow.

                                                  a!startProcess(
                        processModel: cons!CADOR_PM_SAVE_INFO_CONTACT,
                        processParameters: {
                          contact: ri!contact
                        },
                        onSuccess: {
                                         /* here I would expect the ri!contact data to be updated with my newly inserted ID
                                            but it doesn't  */
                        },
            

Note that all nodes in my PM (and sub-PMs) are chained.

6 replies

stefanhelzle0001
Brainy
June 8, 2022

You will have to add at least one a!save to onSuccess to copy data to your rule input.

julienc
juliencAuthor
June 8, 2022

Thanks! However I am not done yet... [emoticon:5ce50ea3f9eb49809e861e8733750338]

Side question: how do I reference the output parameter? From what you say, here is what I understood I should do:

a!save(ri!contact, ri!contact)

(or with a little more imagination :

a!save(ri!contact, save!value.contact)

)?

None seem to be working for me.

stefanhelzle0001
Brainy
June 8, 2022