Hi experts,
I need to insert some records to a temp DB table.
If it finds any duplicate value it should give an error message and end the entire process.
Kindly suggest me a solution.
Thank you.
You can't expect us to deal with requirements that you didn't mention...
How errors are presented is handled by the system, depending on how the code is executed. You'd need to run your code asynchronously.
You can learn more in Messaging system for finance and operations apps > Will my message end up in a message bar or in the Action center?.
Hi Martin,
I already tried the above approach.
But the problem is it's popping up the error message in the full screen.
I don't want this kind of error.
Just need to give a error in the notification list
Then give if and else. In if check if same record exists. If exists then throw some error. If it doesn't have duplicate record gets inserted.
Also you can try keeping a primary key for table which doesn't need any conditions.
Also you can write validate write at table level and while inserting records, you can explicitly call validate write and then insert the value
Anitha's idea to leave the whole thing to standard logic is a good one.
Regarding your question. if you want to abort execution, simply throw an exception. For example:
throw error("Error message");
Hi Vidhushan,
Can you include index in the table. Error will be displayed if there are any duplication.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156