Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Inserting Calculated Result after Get(lastmessagechoice)

I'm running a script which asks the user to select 1 of 3 choices from the custom dialog box.  I want to set the field value based on the response.  I'm using - If get(lastmessagechoice) = "1" select field = "order".  However the result I get is that a "0" is inserted into the field rather then "order"

Appreciate any help

Thanks

0
Metius
Asked:
Metius
  • 2
1 Solution
 
billmercerCommented:
I assume you meant "Set Field" not "Select Field?"

It sounds like the field is defined as a number rather than a text field. That will cause it to display a zero when you insert a text value into it. Change the field's definition to be a text field.

Another suggestion:
Instead of using a series of script steps to check the lastmessagechoice and set the field, you can do the whole thing in a single step using the a set field script step to assign the field the value of the Case() function, like this:

Case ( get(LastMessageChoice) = 1; "Order"; get(LastMessageChoice) = 2; "Second Option"; get(LastMessageChoice) = 3; "Third Option)
 
0
 
lesouefCommented:
why do you use a custom dialog box to define a field? why don't you make that field displayed directly as a radio button?
0
 
MetiusAuthor Commented:
Thanks for the response .... the case function is very neat.  Thanks
0
 
lesouefCommented:
indeed, but that's more clicks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now