Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Calling a process from a SalesLogix Script
Keri
Posts: 17
 
Calling a process from a SalesLogix ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Aug 06 7:37 AM
fiogf49gjkf0d
A collegue of mine has a process that calls a script based on a certain criteria within that process, within that script there might be a need to call another process.

He is strugling to call the process,

Does anyone know the syntax for calling a process from within a script.

We looked at "DoInvoke" & "Application.BasicFunctions.StartContactProcess" but didn't have any luck with those.

One thing i was thinking is, it seems to be easier to wite the other processes within the script so the script does all the work - what do you guys think ?

Thanks,
[Reply][Quote]
Keri
Posts: 17
 
Re: Calling a process from a SalesLogix ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Aug 06 7:19 AM
fiogf49gjkf0d
Sorry to drag this up from the bottom, but does anyone know if it is possible to call a process from a script ?

Thanks,

Keri.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Calling a process from a SalesLogix ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Aug 06 11:03 AM
fiogf49gjkf0d
Hi Keri,

So what exactly was the problem when using StartContactProcess? That function does work, but maybe not in the way you want. It brings up the dialog and you might be looking for something more transparent.

If you want something more transparent, you could just write to the PROCESS table and then trigger a scan for the current user. The following was provided several years ago by another SLX BP (Walter Shpuntoff):

To launch a contact process via a script.

This technique creates the stub in the process table that will cause it to launch the next time the user in question scans for processes.

1) Create an entry in the PROCESS table as follows:

Field - what should go into that field

ProcessId - New record Id DBCreateIDfor("Process")
TargetID - contact id for the target
Name - name of the plugin
Family - family of the plugin
TargetName - Lastname/Firstname of Contact
Status - 2
Node - @PROCSTART
BasedOn - PluginId of the process you are launching
Suspended - 0

Set the following fields to be Now()
NextAction
StartDate
LastAction

Set both of these fields to the UserId of the user who you want the process to trigger for.

UserId, StarterId

2) After you have created the process entry, you will need to update the blob,

Update Process set Data = g.Data from Process P inner join Plugin G on (p.Basedon =  g.pluginid) 
where ProcessId = ......id of the process you just entered......


This will put the information into the record that is needed to do the graphical preview.

3) Scan

If the process was scheduled for the CurrentUser, you can trigger a process scan by

Invoke "Function",  "Tools:ScanProcessesAll"


This will finish the launch.

If you scheduled it for a different user, the process will launch the next time their Sales Client scans for processes.

Things to watch out for:

- If the StarterId and the UserId are different from each other, then the scanning process becomes uncontrollable. Whomever scans first will get the process.

- If you get an error when you scan, then your process table entry is bad and must be deleted.

- don't forget that the user needs to have access to the plugin. If you release the process to EVERYONE, then it should not be an issue. Just select from plugin where userid = 'SYST00000001' and you should get the right one.

- if you are launching a process for another user, make sure that user is set up to scan processes.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Calling a process from a SalesLogix ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Aug 06 12:28 PM
fiogf49gjkf0d
I got Walter's permission to post this as an article to the site: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=89

The sample code (which I translated to VBScript from Walter's original legacy basic version) are also posted. See http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=90

[Reply][Quote]
Keri
Posts: 17
 
Re: Calling a process from a SalesLogix ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 3:01 AM
fiogf49gjkf0d
Fantastic, thanks for those posts, i'll give them a try today
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 12:32:10 PM