Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Show Custom Dialog Script Step


Recommended Posts

Does anyone know if there's a way in a script to ask a question in a custom dialog box (or in some other way) and have the user be able to enter text to be saved as a variable?



Link to comment
Share on other sites



If I understand your question what you could do is create a temporary field in your table and make it use "Global" type storage. For this example lets call the field something like "gTempText". Now create you script, add the Show Custom Dialog script step and choose "gTempText" as Input Field #1. Next add the Set Variable script step and make the variable equal to the field "gTempText". Finally the last thing I would do is clear the "gTempText" field by setting it to "".

Link to comment
Share on other sites

Hi Cass0509:


Sure, we can come up with something that will work for you. You'll need a field (global, most likely) in which users can enter the data you're seeking. (I'll use gUserData for our discussion.) Then you'll set your variable to the value they entered in gUserData.


In ScriptMaker, add the Show Custom Dialog script step from the "Miscellaneous" category. Click the "Specify" button, and it will open to the "General" pane. Click the Input Fields tab to switch panes.


For "Show Input Field #1" pick the gUserData field. Then, enter any message you want displayed in the "Label" box. Next, go back to the "General" pane and name the buttons you want displayed.


Here's where it's important ...

(1) You can declare up to three buttons. In Browse Mode, these buttons will be displayed in the reverse order that you see them in ScriptMaker. (You probably know this.)

(2) However anytime you want users to enter data in a Custom Dialog, the Default Button must be the "triggering" button. IOW, neither Button 2 nor Button 3 can be used to set the gUserData field.


Next, add an If script step with the calculation Get ( LastMessageChoice ) = 1 to keep an eye on the Default Button.


Directly under this IF step, place a Set Variable script step. Enter the Name of your Variable ... Let's call it $UserDate here for our example. Then for the Value portion, click "Specify" and pick your gUserData field. Click OK. (I have to assume you know how Local Script Variables and Global Script Variables differ. If not, brush up on them through your FM Help. Perhaps you need to refer to this Variable in another script ... in that case, name it $$UserData.)


What happens next is kind of up to you ...

(1) It's good practice to clear out the Input field, so add a Set Field step. Select the gUserData field, then Specify the calculation as "" ... a pair of double-quotes. (Resist the temptation to use the "Clear" script step; it would require your Input field to be present on the current layout.) If you don't empty out your global field, the next time your user runs this script, the "old" data will still be showing in the Input field ... but perhaps you would want that to show their last entry.

(2) You could include an "Else If" step if you want to "trap" on Button 2 or Button 3.... Specify the calculation as "Get ( LastMessageChoice ) = 2" or such to fit your circumstances.

(3) You could include an "Else" step which lets users bail out of the script, canceling the whole process ... Else >> Exit Script.

(4) And of course you could include other Input Fields in your Custom Dialog. Each would need its own Set Variable routine.


With your Variable established, you can refer to it in steps further down your script. (If it's a Global script variable, it can be referenced anywhere throughout your solution.)


Hope this is the direction you were asking about. Let us know.

Link to comment
Share on other sites

Aw, dang it, Mr. Ted ... If I had reloaded the topic before posting, I'd have seen your response. Yours is so concise, and mine reads like a friggin' cookbook. Never Mind!

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Terms of Use