Proper way to pull variable in c# server script

I had a v7 jscript server script that ran on "when button pressed" that queried a table using a field on the current form.

 

Select function_id from table where Application_Desc = '"+ework.txtSystem2+"'"

 

What is the proper way to pull that variable into C#?

 

Thanks,

Harry

Tagged:

Comments

  • That depends 'where' you are executing this code. We no longer need 'scripts'. Although Metastorm have named server-side code 'scripts' to keep with previous versions' terminology, I feel this is a mistake, as scripts are not 'real' code, and what we have here is.

     

    You can run any C# code within an event (button press, form load, etc) by using a Visual Script 'code' activity. From there you can access all Business Objects associated with the current environment. In a process, the BO is Data. On a form, you have to add the BO for the process, so the BO instance is typically named Data1 (although you are free to rename this).

     

    If you need to call a reusable function, you can create a server side 'script' (really a C# class with static member functions). To pass data to this function, you can either pass individual variables, or pass the whole Business Object itself. If you pass the BO, you can access all of the variables in teh same way as you would use "ework.variable" in previous versions.

     

    I hope that helps. We have a number of examples from the link below that may explain this concept and several others for those new to version 9.

  • Thanks Jerome. I will definitely look at these examples.

  • Jerome,

     

    Thanks for your examples!  I helped alot!