cancel
Showing results for 
Search instead for 
Did you mean: 

Insert new record in MDF existing data should not be given twice

SasiKumar
Explorer
0 Kudos
818

hello,

I have a requirement from the client where for one custom MDF if the data is saved and when we need to insert a new record in that same data cannot be given twice if so then the error message should populate.

If anyone know the solution or any suggestion then it would be a big help.

P.S: I created a two objects one is parent and another one is child. the fields are in child object and the rule that I wrote is also for child object.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

nlgro023
Active Contributor
0 Kudos

If it is effective dated, did you consider the allowing multiple changes on the same date option on the mdf object of the parent? That should then not prevent it (I assume now it could be effective dated, but you could be upserting a record on the same day which may not be possible without the setting).

SasiKumar
Explorer
0 Kudos

Hi Jasper, Thanks for responding

It is indeed Effective dated. My requirement is that the child object is associated with the parent so that we can give data of the fields multiple times. we can give multiple record of the same date and system can take it but if the data repeats more than one time then the system should not take it.

lets say that the field is for education details then for high school the employee will give one date and for college they should not repeat the same date. If so then an error should populate.

Please let me know if you have any idea.

Thank you.

nlgro023
Active Contributor
0 Kudos

Ah so it wasn't providing an error, but you basically want there to be an error after a certain threshold?
I think you'd need an onsave business rule then that uses the function Sum of Collection Field Values() correctly. With that function you could try to check if a certain has a higher Sum of Collection Field Values than 1 and if so it should give the error. I think you'll want that on the parent object.

More details on it are described here:
Sum up values of MDF object on parent object | SAP Blogs