SaaS CMS has officially launched! Learn more now.

generate ref number on Forms creation


I want to generate a unique ref number on every Episerver Form creation. The generated unique ref number should be available to the next page after form submission.

The generated unique number should be a customized number meeting certain criteria.

Does anyone have any references on how to approach?

Jun 16, 2016 12:31

Use forms events to trigger generating number. Store it in DDS (for generating next) and session (for keeping track of current users ref nr) for persistence. 

Do you mean when editor creates form in epi or on submit for user? 

Jun 16, 2016 13:10


I do not think had someone done something as your requirement.

But with Episerver Form as a kind of ContentType (named FormContainerBlock) then you can inherit and add more properties, for example a RefNumber property with type of string, and then in the CreatingContent event you can assign a genereated value to the property, this RefNumber property should be decorated with Editable(false) attribute so that cannot be updated through the UI.

EPiserver Form also exposes somes events (, at appropriate time you can get the RefNumber's value through the passed Event argument.

Jun 16, 2016 14:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.