11/30/2024 3:35:28 AM
|
|
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 usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Toolbar And Form Connection
Posted: 03 May 08 10:57 AM
|
I'm trying to connect a toolbar icon with a custom-made form and cannot connect the two through the "Argument" box on the standard toolbar plugin. How do I do this? (I'm a new slx developer.)
Here's some more info to help: I have both toolbar icon and form, frmAddRadioEntry, created. I can see my toolbar icon in the slx client. When I press it, it says "Unknown Function Number: -1" Meaning, it's not connected to something. I want my form, frmAddRadioEntry, to pop up when this icon is pressed.
I can see how other toolbar items are argumented: Function Insert:ContactAccount, Function Insert:Opportunity, etc. How do I bridge my gap?
|
|
|
|
Re: Toolbar And Form Connection
Posted: 04 May 08 3:59 AM
|
Hi Mark,
Firstly, the form needs to be a Managed Form - you cannot directly open a data linked form from a toolbar button.
Next, the name that you have given the form - frmAddRadioEntry - is not relevant, what you need is the name and family that is has been saved as - e.g. "System:Add Radio Entry". Then you could call it from a button by setting the type to be "Form" and the argument to be "System:Add Radio Entry".
If you want it as a function, and if you want to launch a data linked form then this is the way to go, you will have to add a new Global Script to create your function and write the necessary code to handle launching the add form.
If you are very new, I can recommend a good book
Cheers,
Stephen
|
|
|
| |
| |
|
Re: Toolbar And Form Connection
Posted: 04 May 08 10:56 AM
|
Stephen,
I'd love to hear more about that. I must have missed something and I could use a shortcut or two in my bag of tricks. |
|
|
|
Re: Toolbar And Form Connection
Posted: 04 May 08 3:39 PM
|
Hi Mike,
Below is an extract from the DevLogix WorkBook (available from www.cafepress.com/devlogixshop). This shows how to new System Function. Once it is there, it can be called as a function called "InsertWidget". This is all you need to do.
Stephen
Create a new System Function SalesLogix allows us to define our own system functions that can be invoked by name.
Step-by-Step 1. From the File menu, select “New Plugin” – “Global Script”.
2. A number of default functions are displayed – delete these.
3. Insert the following code:
Option Explicit Function OnBeforeFunctionExecute_InsertWidget _ (functionNumber, functionName)
End Function
4. Copy the whole of the “Invoke Add Widget” script between the “Sub Main” and “End Sub”. Paste this into the new Function:
Option Explicit Function OnAfterFunctionExecute_InsertWidget _ (functionNumber, functionName) Dim iRes
iRes = Application.BasicFunctions.ShowViewForRecord _ ("WIDGET", "System:Widget Detail", "")
if iRes = mrOK then Dim ID ID = Application.GlobalInfo("NEWWIDGETID")
' Load the passed ID in the Main View Dim MV Set MV = Application.MainViews.Add _ ("System:Widget Details", 1, True)
MV.ShowIDsAsLookupResult ID,ID End if
End Function
5. Save the Global Script as “Global Widgets” in the System family.
|
|
|
|
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!
|
|
|
|
|
|
|
|