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: Calling functions
Andrew Grandin
Posts: 272
 
Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 3:43 AM
Hi all, i have a function on in sales process script that i am trying to call in another form. i thought functions were public as i already have this function being called from the SP_SalesPorcessFunctions script but i keep getting a 'variable undefined' error when trying to call it from my form. Am i getting the concept of calling functions wrong?
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 9:13 AM
You probably need to "Include" your script so that the functions that you are trying to execute become available.
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 9:31 AM
But the function is inside the script on a form plugin, which cant be included like script plugins.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 9:46 AM
Then you need to either copy it over to the other form (so you have it on both places), or move it to a Script and then include the script on both forms.

[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 9:52 AM
that was my first thought but the function is using variables that are declared and populated in the form it is currently in. If i copy it over its a bit beyond my expertise how to get the variables to come with it.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Calling functionsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Aug 09 9:58 AM
Got it.

Are you trying to invoke the function on the form + having it do somehting against the form where it is being hosted?
Or are you just trying to do a similar thing on a separate form?

If a function depends on items within the Form it is being hosted, then it is not likely that you can port it to other functions.
Now, if you are just trying to call a Function on a different form, then you could do so by getting a reference to that form and call it that way. Again, it depends on what the function does.

If I have a Form called X with a Function called "EnableControls" which enables all controls on it, and I want to call it from a different form, then I will need to get a reference to Form X and call the function. (Off course, it will enable the controls on Form X, not on the calling form).

Now, If I have a Function called GetOverallDiscount which figures out a Discount Percentage given an OpportunityID, I would put it on a script and make sure that it didn't rely on any specific Form controls. Then I could include that script on any form and be able to quickly acquire a Discount Percentage.
[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 12:30:08 PM