Setting a text field from a server script
public class MyClass { publicstatic BusinessObject1 bo1; publicstatic Form1 form1; [Promote(PromotionTargets.ExpressionBuilder)] [Category("UserCategory")] public static string sGetNextInSequence() { bo1.Refresh(); string sValue=bo1.NextSequenceFormatted.ToString(); // trying to set the Text1 value form1.Fields.Text1.DataValue=sValue; return sValue; } }
Its me again.
Via a Button click, I'm trying to return a string from a Business Object (Query) and set the text of a textField with the result.
My server script is above.
I'm using a Visual Script Event Handler ( Code Activity to call my server script )
string sReturn = MyClass.sGetNextInSequence();
Any suggestions ? Am I on the right track - or completrly missing the point ?
Comments
-
Looks like mu questions boils down to:
How do I set a text field in a server script ?
Surely this should be simple - but damend if I can see how to do it :smileymad:
0 -
... and you can tell its Friday afternoon here in UK .... typing getting bad .....
0 -
You need to pass in an instance of the form's "Local". My form has a local variable called intAge on it:
public static void SetIt(NameOfMyForm.Declarations.Local loc)
{
loc.intAge = 21;
}^ is in the server side script.
You call it like this from the form's design surface:
NameOfMyServerSideScriptClass.SetIt(Local);
Make sure the field you are assigning to is also set to be "dependent on another" through its properties.
0 -
Hi Tony - not sure what you mean by forms design surface - please explain
Thank you for the prompt reply
0 -
Aha --- problem solved - all I needed to do was to set the "Field is dependant on another" check box for my text field.
Thanks Tony for pointing me in the right direction .......
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 152 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories