Create form/view parameters by code

  • 12 August 2016
  • 1 reply
  • 1 view

Badge

Hi,

 

I'm trying to make a method that allow me to create new parameters to a specific form or view by code. 

 

Here is my code:

Snippet

FormsManager formsManager = new FormsManager(connectionString);

Form form = new Form(formsManager.GetFormDefinition(formName));
FormParameterCollection parameters = form.Parameters;

parameters.Add(parameterName, ParameterDataType.Text, defaultValue);  

Am I forgetting something? Because it isn't working, and I can't find any references to this operation. I can get the existent parameters and show them but not create new ones. Or maybe it is normal and it's not possible to create paramenters by code?

 

Thanks in advance,

 

Best regards.


1 reply

Userlevel 1
Badge +8

Hi ChuckyPT

 

I am not sure about this, but it looks like you are using the wrong API here. It appears you are using the "Form" object which is found in the SourceCode.Forms.Client API, when I think you need to be using the SourceCode.Forms.Management API 

 

My guess is you need to get the FormInfo using the GetForm method of FormsManager. You probably then need to check the form out, update the parameters collection and then call the Checkin method.

 

 

 

 

 

 

 

Reply