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: Using Application.Forms in 6.2
Richard
Posts: 33
 
Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 10:27 AM
fiogf49gjkf0d
I have a form that I want to get values from another open form, so I thought "Hey! I'll just use Application.Forms()." Sounds good, and I know it works because SLX uses it in the Potential Matches form. But it doesn't work for me, instead I get a syntax error "Error at line: -1, character: 1". I found that any use of Application.Forms... would get this result (although the Potential Matches checks out fine), even if it's a single line as in my new, single-line script on a manage form:

intCountForms = Application.Forms.Count

that's it. That's the whole script and it won't pass the syntax check although I can't see why it won't.

Any clues? Thanks.



[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 1:37 PM
fiogf49gjkf0d
if all you're wanting to do is get a reference to another form, just use something like this:

Dim frm

Set frm = Application.Forms("Famly:FormPluginName")
If Not frm Is Nothing Then
frm.Edit1.Text = "Some value"
'etc...
End If


Make sense? Did I miss something you were trying to do?
[Reply][Quote]
Richard
Posts: 33
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 1:56 PM
fiogf49gjkf0d
That's actually what I started out trying to do. Sadly, I found that using Application.Forms would bomb.
As a test I created a manage form with no controls and this as the script:

option explicit
dim oFrm
set oFrm = Application.Forms("Personal:MyForm")

I found that the Set oFrm line wouldn't pass the syntax check ("Error at line: -1, character: 1"). If I comment out the last line, it works, but that's just to affirm what caused the error.

I'd certainly like this to work as I can see that it's very useful.

I tried this same thing on a version 7 installation with the same result, so I figure that I'm missing something.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 1:58 PM
fiogf49gjkf0d
You posted this code:

option explicit
dim oFrm
set oFrm = Application.Forms("Personal:MyForm")


Is that exactly as you have it in your script? Is the code contained inside a sub or function?
[Reply][Quote]
Richard
Posts: 33
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 2:18 PM
fiogf49gjkf0d
Yes, exactly. Pretty amazing, isn't it?

These really are the only three lines in a newly-created manage form. No other changes have been made to the form.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 2:21 PM
fiogf49gjkf0d
Quote:
Originally posted by Richard

These really are the only three lines in a newly-created manage form.


That is your problem. Move the code inside Sub Main and you should be fine.
[Reply][Quote]
Richard
Posts: 33
 
Re: Using Application.Forms in 6.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Oct 06 2:41 PM
fiogf49gjkf0d
Live and learn...
Thank you again, Ryan.
[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 6:33:22 PM