Skip to main content
julienc
Known Participant
Jun 8, 2022 10:55 AM UTC
Question

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

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
Jun 8, 2022 11:22 AM UTC

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

julienc
juliencAuthor
Known Participant
Jun 8, 2022 12:26 PM UTC

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
Jun 8, 2022 12:43 PM UTC