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!
|
|
Closing a form in script
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
|
|
|
|
Re: Closing a form in script
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 |
|
|
|
Re: Closing a form in script
Posted: 01 Feb 10 8:19 AM
|
sorry all, ridiculously easy answer.
had to use objMainView.showModal instead of just .show!!!!!! |
|
|
|