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!
|
|
Open a new form when field changes on accoutn detail view
Posted: 14 Feb 08 11:30 AM
|
Hi, I would like to have a form open up when account type value i changed to "Partner" and make all the fields on the form required. I created the form and made the fields required. I do not know how to force the form to open up when a value on the account detail view is changed. Any ideas?
Thanks!
|
|
|
|
Re: Open a new form when field changes on accoutn detail view
Posted: 14 Feb 08 11:59 AM
|
I'm probably missing something here - it sounds too easy. You need to monitor for the OnChange event of the Account Type Control
Within that function, you need to do a simple check:
Sub onCtrlChange (sender) If ctrl.Text = "Partner" and lastCtrl.Text <> "Partner" then lastCtrl.Text = "Partner" ShowForm end if End Sub
The lastCtrl control is to ensure that the text of the control has actually changed. The OnChange event fires off whenever the control may have changed - so you want to be careful not to show the form too frequently.
ShowForm is a subroutine which handles initialization, display, and saving of the child form, where necessary.
Hope this helps Brian
|
|
|
|
Re: Open a new form when field changes on accoutn detail view
Posted: 14 Feb 08 12:15 PM
|
forgive me if i am asking stupid questions. I am new to this. 
How do i identify which form i want to show when i put in ShowForm? I am also getting the following error message: an error occurred... type mismatch: 'ShowForm' |
|
|
|
Re: Open a new form when field changes on accoutn detail view
Posted: 14 Feb 08 1:08 PM
|
Here is the code, i am also getting an error message about last variable:
Sub pklTypeChange(Sender)
if pklType.TEXT = "Partner" and lastpklType.TEXT <> "Partner" then lastpklType.Text = "Partner" Msgbox "Please Populate Partner Information.", 0+vbExclamation, "Missing Required Field" ShowForm End if
End Sub |
|
|
|
Re: Open a new form when field changes on accoutn detail view
Posted: 14 Feb 08 1:17 PM
|
ShowForm isn't a variable, it's a function placeholder that I declared to call the show window functionality of the form you've created. It may have a variable/saleslogix function blocking it, so you may need to use a new name for this function
It needs to look like this:
Sub ShowForm Dim objMainView Set objMainView = Application.MainViews.Add("System:YourFormName", 2, False) 'DNL objMainView.Show End Sub
Also keep in mind that your form will not be using standard control bindings when you save the results. You'll have to manage loading and saving the controls from the script.
If you're not sure how to do that, what I would recommend is instead of using the form you've created, use the Account Details form that this is already built on and show/hide the controls that you would display on the form instead (using ctrl.Visible = true; ctrl.Visible = false) |
|
|
| |
|