Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, July 8, 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: Closing a form in script
Andrew Grandin
Posts: 272
 
Closing a form in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Feb 10 4:32 AM
I created a new Data Form and have tried using the same script i use elsewhere in SLX for closing the form on a button press but nothing happens. Is there a problem using the following code with a data form?:

Sub CloseMyForm(formName)

dim thisviewname
dim thisviewid
dim strthisform

dim i
dim mvcount
dim myformindex
dim myFormCaption
dim MyFormName

myFormName=formName
mvcount=application.Forms.Count
myformindex=-1
for i = 1 to mvcount -1
thisviewname=Application.Forms.Item(i).Name
if trim(thisviewname)=myFormName then
myformindex=i
end if
next

if myformindex > -1 then
Application.Forms.Item(myformindex).ModalResult=mrCancel
end if
end Sub

'Called using.............:

Sub Button2Click(Sender)
CloseMyForm("frmProdEdit")
End Sub

[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Closing a form in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Feb 10 5:40 AM
It may also bhe a problem with the way i open the form:

Dim objMainView, objDetail
Dim strWhere
Dim id
id = grdProducts.GetCurrentField

Set objMainView = Application.MainViews.Add("Opportunity:edit_prod_test", 2, false) 'DNL
objMainView.CurrentID = id 'DNL
objMainView.Caption = Application.Translator.Localize("Edit Opportunity Product test")
objMainView.BorderStyle = 3
Set objDetail = objMainView.DetailsView

objMainView.Setdatamode 0, grdProducts.GetCurrentField("OPPPRODUCTID") 'DNL
objMainView.show
Set objDetail = Nothing
Set objMainView = Nothing
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Closing a form in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Feb 10 8:19 AM
sorry all, ridiculously easy answer.

had to use objMainView.showModal instead of just .show!!!!!!
[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): 7/8/2025 12:23:45 PM