Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, March 29, 2024 
 
How to Launch a Contact Process via Script  
Description:  This article describes the steps to launch a contact process programatically. Sample scripts in both VBScript and legacy basic are included.

Category:  Architect How To Articles
Author:  Walter Shpuntoff
Submitted:  8/29/2006
   
Stats: 
Article has been read 14843 times

Rating: - 4.8 out of 5 by 5 users
 

fiogf49gjkf0d
How to Launch a Contact Process via Script

This article will outline the steps to schedule a contact process programatically. The technique creates the stub in the process table that will cause it to launch the next time the user in question scans for processes.


Launch a Process

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

    FIELDVALUE
    PROCESSIDNew Record ID for the PROCESS table
    TARGETIDContact ID for the process
    TARGETNAME   Name of the contact references by contactid
    NAMEName of the contact process plugin
    FAMILYFamily of the contact process plugin
    STATUSValue = '2'
    NODEValue = '@PROCSTART'
    BASEDONPluginID for the process you are launching
    SUSPENDEDValue = '0'
    NEXTACTIONValue = Now()
    STARTDATEValue = Now()
    LASTACTIONValue = Now()
    USERIDThe UserID you wish to trigger the process for
    STARTERIDThe UserID you wish to trigger the process for

  2. After you have created the process entry, you will need to update the data field 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 view for the scheduled process.
    Note: The SQL statement outlined above will only work for legacy versions. Using v6 or higher the SalesLogix OLEDB Provider will fail to parse the statement. Instead use a Recordset to read the value from the plugin table to the record on the process table. See sample script for an example.

  3. Scan

    If the process was scheduled for the current user, you can trigger a process scan by executing the following:

    Application.BasicFunctions.DoInvoke "Function", "Tools:ScanProcessesAll"

    This will finish the launch. If you scheduled it for a different user, the process will launch the next time their 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.


Look for the sample scripts referenced in the related articles section below (Legacy version by Walter Shpuntoff and VBScript version adapted by Ryan Farley)

 

About the Author

  Walter Shpuntoff
Black Radish, LLC

How to Take Amoxicillin

buy amoxicillin
fjrigjwwe9r1SiteUser:UserBio
fiogf49gjkf0d


View online profile for Walter Shpuntoff
 

[ back to top] [ send to a friend]  

Rate This Article you must log-in to rate articles. [login here] 
 
Please log in to rate article.
 

Related Articles 
 - How to Launch a Contact Process via Script - Sample Code - Submitted by: Walter Shpuntoff

 

Comments & Discussion you must log-in to add comments. [login here] 
 
Author Article Comments and Discussion
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: How to Launch a Contact Process via Script
Posted: 8/29/2006 12:25:56 PM
fiogf49gjkf0d
I know you wrote all of this 4 years ago, but it's still as good now as it was then! Thanks Walter!
 
 

       Visit the slxdeveloper.com Community Forums!
Not finding the information you need here? Try the forums! Get help from others in the community, share your expertise, get what you need from the slxdeveloper.com community. Go to the forums...
 



 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): 3/29/2024 7:36:45 AM