Hello, Community!

I have a two input fields: Occupation and Company name. I want to check, if they are empty or already filled. If they are empty, I need to fill them with default values from the database, if not - leave as present. If field is not empty, it still updates its default values and rerecords it in a database. 

The check should be performing after weclick on 'Save' button, so the 'Save' screen action would trigger. How can Imodify a 'False' statement, so it wouldn’t update to default values?


Thank you in advance! 

Hello Altynshash,


Input widgets have a variable bound to them, right? Have you tried assigning your desired value in that variable? I believe that will resolve your issue. Another thing, from what I know you will need to use ajax submit for your save action.


Hope this helps!

- Emman

Hello Altynshash,

there is two way to achieve your functionality-

first Emman Si said is right u can follow this process

second is ,if you are using form widget with attributes than you have option to provide default value in your entity attribute just like below image. 


hope this will help you.

Regrads

Rahul Sahu

Hi Altynshash,


Hope you have bound input fields Occupation and Company name variable. In your action, you can validate both variable has any value with IF clause. You need to check both variable separately then anyone variable doesn't contain any value assign them from database. 

I have attach one screen shot which will clear what i am explaining to you. 



Hope i am correct.