Try our conversational search powered by Generative AI!

generate ref number on Forms creation

Vote:
 

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?

#150338
Jun 16, 2016 12:31
Vote:
 

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? 

#150343
Jun 16, 2016 13:10
Vote:
 

Hi,

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 (http://world.episerver.com/add-ons/episerver-forms/handling-events-for-episerver-forms/), at appropriate time you can get the RefNumber's value through the passed Event argument.

#150346
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.