Skip to main content

Hello,


Does anyone know whether it is possible to generate a GUID in a smartforms? I see that you can define e.g. a datalabel with type AutoGuid, but can this be used to trigger such a generation? Or do I have to do this via a SmartObject?


Thanks,


Anders

The AutoGUID is similar to the  Autonumber, it takes on the role of an identity type field where a GUID will be auto generated when a record is created. So effectively the guid is created behind the scenes when a record is created


I had the same problem. I missed the step of set default value of GUID field in database as (newid()). Once I added that to the GUID field in the table and updated the corresponding smart object. That property in smart object changed to autoGUID. 


You can generate a GUID in K2 by using one of the System SmartObjects.

It is in SystemManagementSmartObjectsSmartObjects and is called Common.NewGuid.

It has a single Read method that returns a GUID.

16293i727BB0921B9B7B84.png
Generating a GUID using the Read method of the Common.NewGuid SmartObject in the K2 Five Management Portal.

 


There is no smartobject or function to generate guid in K2 Blackpearl 4.7, you need to create your own advanced smartobject (SQL Server)


Reply