I am building offline functionality for an app, the app has to support the functionality of CRUD operations for a CDS entity.
The entity has various field types which includes text, whole number, option sets and Lookup. Using form with Edit mode requires me to use the Data source, but as i am storing into a collection, so i have decided to use the scrollable screen with all the controls added and individually binding(Option set, Lookup types) them with local collections.
The issue i am facing is showing the screen for Create and Edit. I want to display empty screen if Create is clicked, show the screen loaded with control values if it is an edit of the record selected from Gallery. For some reason, the Gallery has it's first record selected automatically. So setting the control's default as Gallery.Selected.Field is always showing the data even for Create record.
I am passing a varible from Gallery screen to Edit screen to identify Create/Update, using conditional Default for text boxes works fine, but not for combo boxes/Radio buttons.
Is that approach right? Any thoughts on what should be set for combo boxes/Radio buttons.
Solved! Go to Solution.
Hi @jk264 ,
Could you show more error information?What is your issue with Combo Box/Radio Button?
What is the data source of Combo Box/Radio Button? Do you mean you use an individual collection to store Option set which is used for Combo box?
Judged from you context, do you want to know how to change the default value of Combo box/Radio button between the modes of ‘create’ and ‘edit’?
Maybe you can refer to the following formuals:
TO Combo box:
Set the DefaultSelectedItems property of combo box as below:
If(CorE = "Edit" , Gallery1.Selected.Variety)
To Radio button:
Set the default property of Radio button as below:
Please have a try and check if it will solve your problem.
Thanks for your response, combo box is working fine, i didn't realise there is a property called DefaultSelectedItems, i was setting the Default. But the radio button still an issue, i am binding a local collection which is of type Option set. So if i set the Default to If(UpdateRecord=true,galleryOffline.Selected.Turbulence,""), it is complaining on the "" because of data type mismatch.
How do you clear it?
The Default of Radio button must be the value, not record.
so we should use a ''.'' behind the galleryOffline.Selected.Turbulence to add the value parameter.
you can refer to my test formula:
To Radio button:
Set the Default property of Radio button as below:
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200