Skip to main content
6-Contributor
December 28, 2022
Solved

Values entered are removed incase user tries to save by leaving some mandatory field empty

  • December 28, 2022
  • 2 replies
  • 1713 views

Hi,

The values are removed if all criteria's are not fulfilled. Is there any way to keep the old values if criteria is not met and remove the values once values are saved in table.

 

Thanks,

Asarsh

 

AA_10034462_0-1672219242562.png

 

Best answer by pshashipreetham

Hi @AA_10034462 ,

On Press of Submit button, create a service that checks the validations. If the Service put's any output(which means something is wrong), connect the Service Output to a validator and, based on the Service output, make true or false in the validator. For example, reset all the widget values if there is no output(null).

Note: Evaluate the Validator on Service Invoke.

 

Thanks,

2 replies

17-Peridot
December 28, 2022

Hello,

 

I am not sure if I completely understand you issue, but lets see.

 

Are you, after pressing the "save" button clearing the fields with this widget property?

jensc_0-1672221878074.png

If not, then the values should stay in the fields.

 

If you could explain a little bit more about your issue, when it happens or a screenshot of the connections of some of the fields, it might help in finding the issue.

 

Thanks, 

Jens

6-Contributor
December 28, 2022

i have removed this feature ResetToDefaultValues from the save button still the values get removed.

17-Peridot
December 28, 2022

Hello,

 

Do you mean you have removed the "clicked" event of the save button to the ResetToDefaultValues of the fields and it is still resetting the values?

If so I would probably first look at the logs to see if there is any issues.

 

Also, I would check if the fields get their:

jensc_0-1672227067184.png

Properties set after running whatever service the save button is running. It could be that that service is returning empty values; i.e empty text strings.

 

If it is still an issue it could be worth creating a support ticket with PTC.

18-Opal
January 27, 2023

Hi @AA_10034462 ,

On Press of Submit button, create a service that checks the validations. If the Service put's any output(which means something is wrong), connect the Service Output to a validator and, based on the Service output, make true or false in the validator. For example, reset all the widget values if there is no output(null).

Note: Evaluate the Validator on Service Invoke.

 

Thanks,