Hi,
Not sure what you mean. But every form posting is a row in the database and every row has an identifier of some kind.
Hi Johan,
Basically in the database table within EPiServer, which displays all the results, we need the auto generated field to appear in the results, infront of the other fields.
Hi Johan,
Yep, thats the one. So when its exported into excel, there will always be the unique ID displaying next to each row.
Maybe there is an event you can listen to and add an id to each row in the exported file.
But I would listen to an event when the form is posted and then add a guid to the posting. You can add columns on the fly to a posting, it doesn't need to be in the xform definition.
Roughly (not compiled) :
protected void Application_Start(Object sender, EventArgs e)
{
XFormControl.ControlSetup += new EventHandler(XForm_ControlSetup);
}
public void XForm_ControlSetup(object sender, EventArgs e)
{
XFormControl control = (XFormControl)sender;
control.BeforeSubmitPostedData += new SaveFormDataEventHandler(XForm_BeforeSubmitPostedData);
}
public void XForm_BeforeSubmitPostedData(object sender, SaveFormDataEventArgs e)
{
XFormControl control = (XFormControl)sender;
e.FormData.SetValue("MyKey", new Guid().ToString());
}
Hello All,
Is there anyway by default to have a unique ID on every row when an individual form is filled in?
Will need this for audit purposes.
Many Thanks.
Marc.