Programmatically change default value in a BizForm

Tommy De Notarpietro asked on December 16, 2016 10:26

I cloned a BizForm which loads an Online Form.

Is it possible to programmatically set default values to certain fields on a new form ( not an inserted form )? The values must be visible on the form. I already tried:

viewBiz.Data.SetValue("FieldName", "SomeValue");
viewBiz.FieldControls["FieldName"].Text = "SomeValue";

Recent Answers


Dawid Jachnik answered on December 16, 2016 10:45 (last edited on December 16, 2016 10:45)

Hello, You dont need to make some customization in file. You can do it in the definition of fields in the Fields tab, when defining the form https://snag.gy/pWhaeM.jpg

There's a attribute Default value

0 votesVote for this answer Mark as a Correct answer

Tommy De Notarpietro answered on December 16, 2016 10:55

You can use this solution for fixed default values or when using a macro. It's more difficult when your default value is generated in a method in your custom web part.

For example: when you want to access a default value from an api.

0 votesVote for this answer Mark as a Correct answer

Dawid Jachnik answered on December 16, 2016 12:08

So make an macro, that genrates the value from API. So the only customization will be your custom macro. Assuming this will be supported by Kentico, your modification from the first post not.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.