Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 2025 
 
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: Another sales process question
Andrew Grandin
Posts: 272
 
Another sales process question Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 09 4:24 AM
Hi All,

Ill keep it short and sweet, i want to display a message box once the user has completed the final step in a sales process. It will used as a reminder to close the opportunity. Im having trouble figuring out how to tell when it is the final step that has been performed.

Thanks in advance
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Another sales process question Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 09 10:47 AM
The DoCompleteStep function gives you the SALESPROCESSAUDITID of the step being completed. So, somewhere in your code you could do the following:

METHOD 1: Use the Highest Stage and Highes Step for last stage
-- Get the Number of the Last Stage and retrieve and store in variable called: lastStageNo
SELECT MAX(STAGEORDER) FROM SALESPROCESSAUDIT WHERE ENTITYID = myOppID
-- Get the Number of the Last Step for the Last Stage and store in variable called: lastStepLastStageNo
SELECT MAX(STEPORDER) FROM SALESPROCESSAUDIT WHERE ENTITYID = myOppID AND STAGEORDER = lastStageNo

'Then verify if the SalesProcessAuditID you got matches the last step:
SELECT SALESPROCESSAUDITID FROM SALESPROCESSAUDIT WHERE ENTITYID = myOppID AND STAGEORDER = lastStageNo AND STEPORDER = lastStepLastStageNo
-- If the ID returned here matches the ID that you got passed into the function, then this s the last step.



METHOD 2 - Use the Sequence field
' The other way around it is to get the step with the highest order:
SELECT TOP 1 SALESPROCESSAUDITID FROM SALESPROCESS WHERE ENTITYID = myOppID AND PROCESSTYPE = 'STEP' ORDER BY SEQ DESC
' If the ID returned matches the ID passed into the function, then this is the last step.
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Another sales process question Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jul 09 4:05 AM
Sounds great Raul ill give it a go
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Another sales process question Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Jul 09 4:59 AM
Hi Raul,

Ive gone through your SQL in the Server Management Studio and everyhting seems to work out great. All i have to do is implement it in the script

As always thanks for your great help
[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 © 2025 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): 8/29/2025 8:17:47 AM