In File Options, select the auto-enter tab and put the text "Oranges" without enclosing quotes into the data box.
Or use the calculation option with:
GetValue ( ValueListItems ( Get ( FileName ) ; "YourValueListNameHere" ) ; 2 )
to auto-enter the second item from the list.
This second item will update automatically to enter different data into newly created records each time the second value that appears in the value list changes.
Okay, I'm gonna make things a bit more complicated here...
Your formula did help, and makes sense - thank you! Here's the actual, more complicated issue I'm trying to solve...
I have a global field with a dropdown list of frequented layouts. I studied a FM solution and figured out how to attach a script trigger to the field so that when I choose "Customers" in the list, it takes me to the Customer layout, when I choose "Orders" it takes me to Orders etc. etc. Works like a charm.
The problem only occurs when I use the standard status toolbar menu instead of my global field. So let's say I'm in Orders, and instead of using my field, I use the toolbar dropdown menu to take me to Customers. On that layout, the global field still reads "Orders" even though I'm in the Customer layout now.
I thought I could add a step in the script to change the global field info upon entering a particular layout - hence my original question. If that is the answer, I'm struggling to modify it within the script trigger. Wondering if there's a simpler option now? (I keep going back to that FM solution and I can't find the answer there.) Stumped.
The OnLayoutEnter trigger can certainly perform a script to do this.
It can be a single set field that explicitly set's the field to a value. That requires one script for each layout.
But you can also use a single script with all the layouts:
If the layout's name matches the value in the value list, you can use:
Set FIeld [ Table::GlobalField ; Get ( LayoutName ) ]
And if they do not, you can pass the desired value as a script parameter to the script and use:
Set Field [Table::globalField ; Get ( ScriptParameter ) ]
I went with the OnLayoutEnter trigger and it works beautifully. Thank you!!
Guess I didn't even realize that. I'm self-taught, so while I've been able to make things work eventually, actual terms are still pretty foreign to me! I appreciate your help.