5

use case of create fonction

Sometimes I need a function that searches for a record, creates it if it doesn't exist, and updates it.

Here is a simplified example of such a function :

But the compiler returns an error :

I tried to figure out why the compiler says the return type is not record?

I added a debug function and with Debug Tracer, I realised that the create function returns a node (JSON containing record values) and not a nest (pointer to a record) like the rec variable :

With this new information, I modify my code to attribute the id of new record to rec variable. And now it work fine :

 

I hope this information cloud be help somme one.

Reply

null

Content aside

  • 5 Likes
  • 1 yr agoLast active
  • 109Views
  • 2 Following