Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
ka_rouse

Member
Registered:
Posts: 16
Reply with quote  #1 
Hello all,

I've been trying and searching on the forum, but have not gotten any luck, perhaps it's quite simple, but it may been that I'm missing something.

I have a form segment "FS" and in that form segment "FS" I have a field "Field A", which I needs to update the value on a field "Field B" in form "A" that it is contained, based on a server side response (I have no issues updating form field values from form segments client side). Also, I need to add that the field in the form is a Local variable.

I've tried using ""Current.FormMBO.SetField", when this script is validated, I get no errors, but when I deploy the solution I get the error: 

<<<<'Metastorm.Runtime.Models.SolutionName.FS does not contain a definition for 'FormMBO' and no extension method 'FormMBO' accepting a first argument of type 'Metastorm.Runtime.Models.SolutionName.FS' could be found (are you missing a using directive or an assembly reference?) >>>>>


The reason that I don't have this filed in my form segment, is that I use it in other form segments that are also used in form "A", so I don't want to have the same variable multiple times.

Any help will be appreciated.

Best,
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
setField is client side, so if you are doing server side assignments, that is likely your first issue.

Setting server side, presuming there is an actual variable associated with the field, you should be able to do something like boForFormSegment.FieldA or Local.FieldA (presuming FieldA is the variable name, not necessarily the field name).  When you add a form segment to a form, a BO is automatically created for it.  (It should be at the top of the DataAccess tab/pane.)  FieldA would need to be "is dependent" to show changed assignment values.
0
ka_rouse

Member
Registered:
Posts: 16
Reply with quote  #3 
Thank you for your reply BMellert.

Actually I have done what you state before without any issue, setting a value of a field that I have on a form segment. What I'm trying to do is the opossite, basically setting a field value of a form, on an on change event of a field that I have in a form segment.

Do you know hoy to achieve this?
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #4 
You can do what you're referring to, as long as the business object is present on the form and the form segment.

Assuming you have the same BO or process BO on both form and form segment, you can set the BO's value on the form segment's server script.

When you now move the segment to the form, that script will execute and set the value of the BO on the form (coz, remember, at runtime there is no form segment. Everything gets compiled as one big form). Remember to set "has dependents"/"is dependent on" accordingly for the serverside events to fire.


0
ka_rouse

Member
Registered:
Posts: 16
Reply with quote  #5 
Thanks praxkan.

What happens if the variables that I have on my form is Local? I cannot access a Local variable from the form segment or is it possible to create a BO for these Local variables so they are both on the form as on the form segment. As far as I recall this is not possible.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #6 
You cannot create a BO explicitly for a form and put in on a segment. 

In your scenario, you could use client scripts to set the value of a form field

Form segment field A
Form Field B

On change of A : call SetField("B","value");

This can set the value of your local variable "B" as long as "B" is on the form.

This isn't good programming practice though - because the essence of form segments is to be reusable. But this creates hard-coding, so if this form segment is reused on some form that doesn't have a field "B", then it will no longer make sense when the SetField() is called. Granted it will probably just call and die silently, but if there's another field with the name "B" now you get unintended behavior.

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!