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!
|
|
MsgBox Prompt
Posted: 30 Apr 07 10:50 AM
|
fiogf49gjkf0d Is there a way i can prompt the user with a message box style prompt, but allow them to choose either yes or no? choosing "yes" would continue processing the procedure they're in, "no" would exit.
Thanks, Jim
|
|
|
|
Re: MsgBox Prompt
Posted: 30 Apr 07 11:42 AM
|
fiogf49gjkf0d I believe the MsgBox is an inherent VBScript function. Here's a rundown of what it does from my fav VBScript reference site: http://www.devguru.com/technologies/vbscript/13955.asp
MsgBox can be called as a sub, or you can set a variable to it's return (integerReturn = MsgBox("Blah"). You simply read the variable for the Yes or No response and continue processing accordingly.
One caveat: SalesLogix behaves slightly differently. For example to get a MsgBox with just the OK button, I have to use the VbYes constant for the buttons. You may have to tweak the numbers/constants to get the desired effect. The return constants don't exhibit this problem, so VBOK will really register the OK button. |
|
|
|
Re: MsgBox Prompt
Posted: 30 Apr 07 12:18 PM
|
fiogf49gjkf0d You'd use:
If MsgBox("Do you want to do it?", 36, "Question") = 6 Then ' do something End If
The 3 parameters used for MsgBox are: 1) Question text 2) 36 = The values for vbYesNo (4) and vbQuestion (32 - gives it the question icon on the prompt) added together 3) Title of the prompt
Return value is a 6 (vbYes) if they hit Yes.
You will find the official VBScript docs invauable to find this sort of thing out for SLX scripting. As Jeremy mentioned, the VBScript used in SLX is just plain old VBScript, nothing specific to SLX. You can grab the VBScript docs here: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=30 |
|
|
|
Re: MsgBox Prompt
Posted: 30 Apr 07 1:44 PM
|
fiogf49gjkf0d Thanks so much! that is exactly what i was looking for. |
|
|
|
Re: MsgBox Prompt
Posted: 30 Apr 07 5:43 PM
|
fiogf49gjkf0d In v7.0.x take a look at the SalesLogix provided vbscript: SYSTEM:SLX Util
There's a whole series of "wrapped" msgBox" setups that you can use.: ShowError ShowErrorEx ShowErrorFmt ShowMessage ShowMessageEx ShowMessageFmt ShowWarning ShowWarningQuestion Just "include" the script anad have a nice day!
-- rjl |
|
|
|