2 Replies Latest reply on Aug 4, 2011 1:06 AM by sbhex

    Drop-down menu default

    sbhex

      Title

      Drop-down menu default

      Post

      Hello everyone,

      I'm trying to create a script where when a user creates a new record in IWP mode, the Record Category field defaults to "Other". This field is a drop-down menu with a value list of different record categories.

      Here's the script I have so far:

      - New record/request
      - If [Record_Category = "" ]
      - Insert Text [Select; Record_Category; "Other"]
      - End If

      This doesn't appear to work in IWP mode.

      I've also tried a calculation within the Record Category field:

      If ( Self = "" ; "Other" ; Self )

      This works in FMP but not IWP mode!

      Any ideas where I'm going wrong? Any help would be much apprecited.

      Thanks

        • 1. Re: Drop-down menu default
          philmodjunk

          IF this is a new record, the category field will always be empty, so I don't see the need for an If step here.

          In any case, you might set a field option on category to auto-enter "Other" each time a new record is created. No script is then needed for this. You can just type in Other in the Data box as the Data to be auto-entered in each new record.

          (And I suggest using Set Field [Table::Record_Category ; "Other" ]  instead of Insert Text for cases where you want to use a script for this. The "insert" script steps require that the target field be present on the current layout. Set Field does not, so this makes it a bit more reliable than Insert.

          • 2. Re: Drop-down menu default
            sbhex

            Thanks Phil,

            I feel stupid that I didn't realise that.

            Thanks for your help.