spacer
cornerspacercorner
Reply
Occasional Advisor
Jas Hayre
Posts: 17
Registered: 09-06-2010
0 Kudos

Using Business Object on For Each loop

Hey All

 

I'm trying to build some code to run a for each loop from a form's command button.

 

I add the For Each activity in the visual script editor and then in the List / Business Object collection I select the Local Business Object but then i'm not allowed to select the form variable from Local BO. I cant seem to type type anything in either. Has anyone else tried this?

 

Thanks

Jas

Esteemed Contributor
Jerome҉
Posts: 744
Registered: 05-18-2010
0 Kudos

Re: Using Business Object on For Each loop

It does not make sense to use the Local Business Object in a foreach loop. I am pretty certain it does not support the required interation interface. I imagine it is in the selection list in error.

 

What is it you are trying to do?

Occasional Advisor
Bill Tanner
Posts: 75
Registered: 05-20-2010
0 Kudos

Re: Using Business Object on For Each loop

Hi,

 

Yes we have done this before, however we use a Code activity not the "Assign value(s)" visual script with-in the loop to do this.

 

This then allows you to do something like...

 

if (Local.memComments == null || Local.memComments == "")
	Local.memComments = ForEachActivity1.comments;
else
	Local.memComments += "\r\n" + ForEachActivity1.comments;

 Within the iteration of the loop, where "ForEachActivity1" is the name you give to the For each loop visual script.

 

Cheers,

Bill

Esteemed Contributor
Jerome҉
Posts: 744
Registered: 05-18-2010
0 Kudos

Re: Using Business Object on For Each loop

As I understand it, that is for using a List in the foreach activity. If you use a Business Object, you should reference that, I think.

 

In any case, the Local 'Business Object' is not iterative in either event.

 


Bill Tanner wrote:

Hi,

 

Yes we have done this before, however we use a Code activity not the "Assign value(s)" visual script with-in the loop to do this.

 

This then allows you to do something like...

 

if (Local.memComments == null || Local.memComments == "")
	Local.memComments = ForEachActivity1.comments;
else
	Local.memComments += "\r\n" + ForEachActivity1.comments;

 Within the iteration of the loop, where "ForEachActivity1" is the name you give to the For each loop visual script.

 

Cheers,

Bill




line spacer line
spacerFollow Metastorm on:
spacer Twitter YouTube Blog iTunes LinkedIn Metastorm Community Central, MC2
spacer Copyright © 2011 OpenText Corporation. All Rights Reserved.spacer About Metastormspacer Privacyspacer Legalspacer Site Mapspacer RSSspacer Contact Us
Microsoft Gold Certified Partner
Powered by Windows Azure
line spacer line