Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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: Cannot launch custom Data Form from menu or toolbar
Konstantin Vishnevsky
Posts: 97
 
Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 9:56 AM
fiogf49gjkf0d
Has anyone encountered this problem in v7.0?

If I create a custom Data form and make either a menu item or a button on toolbar to launch it, I get an error saying that form cannot be found. Any system forms will launch fine. Talked to developers from PSG group, and their only suggestion was to use Manage form instead of Data. Of course the disadvantagee is that I cannot specify BaseTable for Manage form and it takes much more code to save data from it.
[Reply][Quote]
John Rogerson
Posts: 7
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 10:23 AM
fiogf49gjkf0d
This has always been the case. Never been able to call a data view directly from Menu/Toolbar.

I've not tried this myself but can't think of a reason why it wouldn't work. Instead of calling the form, create a script which has a ShowViewForRecord in it. Calling scripts isn't a problem and ShowViewForRecord doesn't cause problems so this workaround should do what you want.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 10:24 AM
fiogf49gjkf0d
You cannot launch a data form directly from a menu or toolbar. The reason is that a data form needs "context". That is, it needs to know how to bind everything. Since it does have a base table, it needs to know "for which record" it is loading (or for a new blank one). When a plugin is launched from a toolbar or menu, it is the same as launching it with Application.BasicFunctions.DoInvoke. You can't launch a data form with DoInvoke.

To launch a data form, you must use ShowViewForRecord instead (so you can pass to it the ID for the row to bind to on the base table, or a blank ID for a new record). So, what you'll need to do is have the toolbar button launch a script and the script launch the data form using ShowViewForRecord. Make sense?

To see more about ShowViewForRecord take a look here: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=48
[Reply][Quote]
Konstantin Vishnevsky
Posts: 97
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 11:13 AM
fiogf49gjkf0d
Forgive me for being such a "Hard head", I'm a beginner

I have created a script with following code:

'C_HARDWARE- Table name, C_NEW_HARDWARE - Data form used to enter new hardware information into the table
Function CallDataForm
Application.BasicFunctions.ShowViewForRecord C_HARDWARE, C_NEW_HARDWARE
End Function


I have assigned the script to the button on the toolbar, however when I click on the button, nothing happens. What am I doing wrong?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 11:26 AM
fiogf49gjkf0d
What is the name of the form plugin?

What family is it saved in?

What is the name of the table?

Are you wanting to launch the data form for a particular record, or to insert a new one?

Refer back to the article I mentioned to see the syntax for the ShowViewForRecord function. You are missing some parameters (it takes 4) and the parameters must be passed as strings.
[Reply][Quote]
Konstantin Vishnevsky
Posts: 97
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 1:46 PM
fiogf49gjkf0d
Name of the plugin is: C_NEW_HARDWARE

Name of the script is: OpenDataForm

Table name is: C_HARDWARE

Saved in PERSONAL

I am trying to launch the Data form to insert a new record into the table

Function CallDataForm
Application.BasicFunctions.ShowViewForRecord "C_HARDWARE", "PERSONAL:C_NEW_HARDWARE", ""
End Function

The hint for ShowViewForRecord shows: Table name, View Name, ID
I have tried with double quotes and without, still, no result at all.

The Action for a toolbar button set to "Active Script" and Argument is: Personal:OpenDataForm
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 1:59 PM
fiogf49gjkf0d
When the script is invoked the Sub Main will be executed, not your CallDataForm function. Change the code to this:

Sub Main
Application.BasicFunctions.ShowViewForRecord "C_HARDWARE", "PERSONAL:C_NEW_HARDWARE", ""
End Sub
[Reply][Quote]
Konstantin Vishnevsky
Posts: 97
 
Re: Cannot launch custom Data Form from menu or toolbarYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Dec 06 2:03 PM
fiogf49gjkf0d
Slapped myself on the forehead!!!

It worked! Thanx 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/27/2024 12:44:55 AM