Accessing BusinessObjects from server side scripts or code blocks within Visual Scripts?
Is it possible to access business objects from server side scripts or from code blocks within the visual scripting area?
I'd like to assign a number of form fields based upon the data that select statement retrieves and I'd like to find the nost efficient way of doing it...
In the V7 days we could do something similar to %sqlData:=%SelectSQL("SELECT FirstName FROM UserTable")
and then follow this up with
%fieldName1 := %sqlData[0]
%fieldName1 := %sqlData[1]
%fieldName1 := %sqlData[2]
Now that we're in the days of temp variables I'd like to write this assignment using a loop(if possible) and do something similar to:
int i = 0;
List data = SelectSql(null,"SELECT FirstName FROM UserTable").List;
foreach (object in data)
{ BusinessObject.LocalFormVariables["FieldName" + i] = object.ToString()
i++;
}
Is this possible?
Comments
-
I tend to return a data object from the select statement. You can then use a data row and assign individual columns to each variable. If you use column names it makes the code much more readable than in the old v7 days.
Hope this helps.
Paul
0 -
Looking at this further I can see how you return a DataTable or DataSet but using visual scripts I can see no way how to take these results and assign them to multiple fields without re-running the sql for each assignment. I'm hoping I'm missing something obvious but it appears that there is no way to hold data and re-use it later within the workflow?
Similarly if I wish to write a code block, again it seems fairly trivial in getting the data back, but then how do you get access to the local temporary MBO to assign the data?
0 -
Actually - forget this!
I've sorted it now and I've found I can access the local and process data from within code blocks! Phew - it was originally not showing up within the tool tips due to a compilation error elsewhere!
Hopefully I'll move forward again now!
Thanks for the tip though!
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 156 General Questions
- 149 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
- 33 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories