Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, June 18, 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: Passing parameters to a custom form
Ron LeSieur
Posts: 16
 
Passing parameters to a custom formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 May 07 4:35 PM
fiogf49gjkf0d
HELP!!! I have a custom managed form that is associated with the Opportunities form in SalesLogix. I am calling this form from a command button on the Opportunities form, but my objective is to have that custom form (form B) call another custom form (form C) when an add or edit function is initiated from a datagrid on form B. At that time, I would like to pass some information into form C from form B.

I have been trying to use logic from the Managed Product and Add Edit Product forms. The CallEditProductView sub in the Manage Product form calls the Add Edit Product form and processes the Init function on that form.

I've tried to copy that logic and I can get form B to call form C, and pass information; but when I close form C, expecting to return to form B, I find another instance of form C is opened. When I close the second instance of form C, I get back to form B. What am I missing?

I have pasted the calling logic below, as well as the Init function of the receiving form.

FORM B CALLING LOGIC:

sub cmdEditDetails(Sender)
dim objMainView, objDetail
dim strOppID
dim strMode
dim strProduct
dim strOppDetailID

'save current location in the datagrid to return to
strOppDetailID = dtgCarload.GetCurrentField("ID")

set objMainView = application.MainViews.Add("Opportunity:UPDSAddEditOppDetails_new", 0, False)
objMainView.BorderStyle = 3
set objDetail = objMainView.DetailsView

strOppId = application.BasicFunctions.CurrentOpportunityID
strMode = "Edit"
strProduct = "Carload"

objDetail.edtProduct.Text = "" & rtrim(strProduct)
objMainView.Caption = application.Translator.Localize("Edit Details")

'initiate the new form
objDetail.Script.Init strMode, strOppId, strProduct

if objMainView.ShowModal = mrOK then
dtgCarload.Refresh
'Set focus back to new/edited product
dtgCarload.Selection.Add(objDetail.Script.GetProductID)

if Not blnRefreshViews then
blnRefreshViews = objDetail.Script.UpdateOpportunities
end if
end if

set objDetail = nothing
set objMainView = nothing

end sub

FORM C INIT FUNCTION:

function Init(Mode, ID, Product)
blnUpdateOpps = False

strModeIn = Mode
strOppIDIn = ID
strProductIn = Product

End Function


I've noticed that the following command seems to be creating one instance of form C without the data from form B:

set objMainView = application.MainViews.Add("Opportunity:UPDSAddEditOppDetails_new", 0, False)

This next command is creating the second instance of form C, and it has the data from form B:

if objMainView.ShowModal = mrOK then

When I leave out the IF command above, I only get one instance of form C, but it does not have the information from the calling form. If I leave out the first command, then everything falls apart.

I obviously missed something, and I've spent way too much time on this already. I've also called SalesLogix Tech Support without getting a resolution. I can't afford to pull out any more hair. HELP Please!
[Reply][Quote]
Lane
Posts: 121
 
Re: Passing parameters to a custom formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 May 07 10:16 PM
fiogf49gjkf0d
Look at these lines in the Opportunity: Order Detail
--On ADD
strSalesOrderID = Application.BasicFunctions.GetIDFor("SALESORDER")
objMainView.SetDataMode 1, strSalesOrderID
objDetail.CurrentID = strSalesOrderID
--On EDIT
objMainView.CurrentID = grdSalesOrders.GetCurrentField("SALESORDERID")
[Reply][Quote]
Ron LeSieur
Posts: 16
 
Re: Passing parameters to a custom formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 May 07 12:16 PM
fiogf49gjkf0d
Lane,

Thank you for the response, but I found that the Order Detail form that you referenced was basically using the same logic as the one that I had already modeled. I was still getting a phantom blank form begin opened in addition to the form with the data.

Another call to Tech Support finally led to the answer. As I suspected, it was actually rather simple in the end. I had set the Add, Edit, Delete Options in the calling datagrid and set a form name in the Edit View property. The form was being called twice, once by my code, and once by the Edit View property. When I blanked out the Edit View property on the data grid, that problem was resolved, but I no longer had access to right click on the data grid and select edit, so I am now using command buttons to activate the add and edit functions.

It is now working as envisioned, and I learned plenty!
[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): 6/18/2025 2:30:42 PM