Normal Topic Calling Mass Update from within Mass Update (Read 731 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Calling Mass Update from within Mass Update
Jan 6th, 2006 at 9:26pm
Print Post Print Post  
I think the programming guide suggests not to do this, so is there a way to load a mass update from within a 'completed' mass update?

Something like:

...at the end of Mass Update 1

if @formresultsetottal("myform") = @formresultsettotal("myform") then vsuccess = @loadmassupdatespec("Export")
if vsuccess = 1 then vsuccess = @selectTreeItem("Search Update Menu!Results Commands!Mass Update")

would that work...or is it possible to 'restart' a mass update with different sbasic programming to run on the second 'pass'?

THanks,
Steve
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Calling Mass Update from within Mass Update
Reply #1 - Jan 6th, 2006 at 9:42pm
Print Post Print Post  
No that would not work. Calling a Mass Update from inside a Mass Update just is not going to work. What you can do I believe is have a command button that runs both Mass Updates. It will run the first one and then the sBasic will naturally wait until the Mass Update is done and then it will run the second one. So your code would be something like.

Code
Select All
Var vsuccess as Int
vsuccess = @loadmassupdatespec("Import")
if vsuccess = 1 then vsuccess = @selectTreeItem("Search Update Menu!Results Commands!Mass Update")
if vsuccess = 1 then vsuccess = @loadmassupdatespec("Export")
if vsuccess = 1 then vsuccess = @selectTreeItem("Search Update Menu!Results Commands!Mass Update")  



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Calling Mass Update from within Mass Update
Reply #2 - Jan 6th, 2006 at 9:44pm
Print Post Print Post  
I used to do that, but the programming in the mass update changes so frequently, that I wanted to avoid having to open Sdesigner to make changes....plus long ago, Erika suggested using Mass Updates to run large programming on batches of records (like exports, etc.)

I'll stick with the command buttons and come back to this down the road.

Thanks for your response.

Steve
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Calling Mass Update from within Mass Update
Reply #3 - Jan 6th, 2006 at 10:20pm
Print Post Print Post  
Hello Steve,

You can still change the Mass Updates without going into designer, but what you can not change is which ones run when you click a command button.

You could write a loop on a command button that would prompt you to enter the name of a Mass Update and CANCEL to quit. If a valid Mass Update spec name is entered then that Mass Update is run. Once it is done running you would again be prompted to enter the name of a Mass Update and CANCEL to quit. Just a thought.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Calling Mass Update from within Mass Update
Reply #4 - Jan 6th, 2006 at 10:31pm
Print Post Print Post  
Typically, both mass updates take a few hours to complete, so I want to avoid the 'prompt for user input' in between the two. (I'd like to press one button, and let it work while I sleep.) Smiley

I've made a compromise for the time being. The command button launches a mass update (easily editable in runtime), then the second part of the program runs from the command button when the mass update is finished.

It will get me by for the time being.

Thanks again for your insight.

Steve
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Calling Mass Update from within Mass Update
Reply #5 - Jan 6th, 2006 at 10:36pm
Print Post Print Post  
Hello Steve,

Well I believe 2.0 has a command named RunMassUpdateSpec() that runs a Mass Update without the user having to click anything, so you have something to look forward to.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged