Unique ID for all records, in all tables

Unique ID for all records, in all tables

  

I am trying to create and use a Server Action that will populate a 50 Byte Text field when a record is inserted (created) with a GUID as created by the System.GenerateGuid function.

I am attempting to do this through a server action, but I'm missing something basic. 

I have tried with an Assign, still no luck.

It might help to tell you than I am C# programmer so I am probably overthinking this. I'm not used to the system doing so much for me. 


Any help would be appreciated. 

Thanks

John


Hey John, how are you?

Could you share your espace so we can take a look at?

João Melo wrote:

Hey John, how are you?

Could you share your espace so we can take a look at?

Joao,

Not exactly sure how to share my espace. I have attached the OML file if that helps. I also searched for terms like 'share espace', None of the results covered this topic

Thanks.   

John


But what is the problem exactly?


just guessing here...

everytime you insert a record and you call "generateGUID" it will generate a new GUID.

if you want to have a "session" dependant guid, i would set a session-variable with generateGUID the first time (if empty for example) then use that session-var to insert records.


watching the oml, but you never assign the generateguid to anything?



J. wrote:

But what is the problem exactly?


just guessing here...

everytime you insert a record and you call "generateGUID" it will generate a new GUID.

if you want to have a "session" dependant guid, i would set a session-variable with generateGUID the first time (if empty for example) then use that session-var to insert records.


watching the oml, but you never assign the generateguid to anything?




I don't understand how to tie generateguid to the record insertion. Where do I do that?" 

Solution

just before the create-action, you drop the assign block

there you doubleclick on the variable and you choose thw Form-widget (in folder widgets, then record and the attribute in the end)

in the value you place the guid. not sure if it's a function or not.

if it;s a function it's simple

other you call the action before and you the out as such.


see attached screenshot




Solution

Thank you so much. This is exactly the information I needed. I wired it up and it is working. Thanks again!