11/26/2024 12:26:28 PM
|
|
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!
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.
|
|
|
|
Calling a process from a SalesLogix Script
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, |
|
|
| |
|
Re: Calling a process from a SalesLogix Script
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.
|
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|