Preventing duplicate data

Preventing duplicate data

  

Platform version 9.0.1.75 on-premise.

Good Day hope all is well, I need assistance in terms of preventing to save duplicate data into an entity I currently have a form whereby I fill in the patients details and I click on the add appointments button but after committing to the db when I check the aggregate I notice that duplicate data has been committed to my entity.

(1)Screen dump of my form.

(2) Screen Action.


(3) Duplicate data save into entity


Your feedback and assistance will be highly appreciated.

Warm Regards

Dumi

After the GetMedicalScheme.Empty check, if it is false, you do 2 "create or update" actions. My guess is that you are setting some id to the wrong value and you actually create two entries, instead of updating them

Hi Dumi,

Based on your screenshots, I see you check if there  are any Medical Scheme Names in the database and then if the query is not empty, you create or update, assign the medical scheme name to a local, and then hit another create or update action. 

Depending on what variables are being passed into these calls, could this be what is causing your duplicate data? 

I think you do not want to be going to that second update or create call from the not empty branch.

Let me know if this is the cause,

Justin

Hi,

well, you are calling twice the createorupdate-action if it's a new record.

so either dont do that or 'make sure you fill in the id after the first create.

or make it more clearer and set the right createorUpdate to Create and the 2nd one to Update


Hi All, 

Thanks a lot for your responses the thing is that I have two different entities for storing medical aid details

Refer to the below screen dumps.

(1) First CreateOrUpdate 


(2)Second CreateOrUpdate 


(3) First Assign Widget


(4) Second Assign Widget


 Is the issue on my assign widgets?

Warm Regards

Dumi


I can't see any of the screenshots. Can you reupload?

Justin Babel wrote:

I can't see any of the screenshots. Can you reupload?

Hi Justin Apologies For that refer to the Attachments.



Second Screen Shot

FirstCreateOrUpdate

SecondCreateOrUpdate