Hi,
So Im trying to get this code to save below into my ri! field but no matter what I do it will not save. Can someone please tell me whats wrong here?
Discussion posts and replies are publicly visible
Hi
The expression in the saveInto parameter only evaluates when the user interacts with the component. Since you have made it as readOnly there is no user interaction hence so value is not populating. Can you explain your usecase?
Thanks for the quick reply! Ok so the user is selecting items from 3 drop down fields and whatever they select I want it to populate a readonly field. They cant make changes to this field. They can only change it from those 3 drop down fields... Once I get the 3 choices I need to save it into my ri!order,products, but how?
Below sample may be helpful for this case,
a!localVariables( local!firstItem_txt, local!secondItem_txt, local!thirItem_txt, local!combinedItem_txt,/*ri!orders.products*/ { a!sectionLayout( label: "Section", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Dropdown 1", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, choiceValues: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, value: local!firstItem_txt, saveInto: { local!firstItem_txt, if( or( isnull(local!firstItem_txt), isnull(local!secondItem_txt), isnull(local!thirItem_txt) ), {}, a!save( local!combinedItem_txt, joinarray( { local!firstItem_txt, local!secondItem_txt, local!thirItem_txt }, "," ) ) ) } ) } ), a!columnLayout( contents: { a!dropdownField( label: "Dropdown 2", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, choiceValues: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, value: local!secondItem_txt, saveInto: { local!secondItem_txt, if( or( isnull(local!firstItem_txt), isnull(local!secondItem_txt), isnull(local!thirItem_txt) ), {}, a!save( local!combinedItem_txt, joinarray( { local!firstItem_txt, local!secondItem_txt, local!thirItem_txt }, "," ) ) ) } ) } ), a!columnLayout( contents: { a!dropdownField( label: "Dropdown 3", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, choiceValues: { "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12" }, value: local!thirItem_txt, saveInto: { local!thirItem_txt, if( or( isnull(local!firstItem_txt), isnull(local!secondItem_txt), isnull(local!thirItem_txt) ), {}, a!save( local!combinedItem_txt, joinarray( { local!firstItem_txt, local!secondItem_txt, local!thirItem_txt }, "," ) ) ) } ) } ) } ) } ), a!textField( showWhen: not(isnull(local!combinedItem_txt)), label: "Result", labelPosition: "ABOVE", readOnly: true, value: local!combinedItem_txt ) } )