Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have registered a Plugin onCreate of account. My requirement is to Check Duplicates on User Records if Record already exists in Admin Records.
Example : User Create account with name="Mark". If Admin Records already have Account with name "Mark", It must throw an error to User, else Save the Record
Now, I am getting An unexpected error occurred from ISV code. Error on Save Form
Here Is the code I used
Can you attach to debugger? You can use plugin profiler if you cant attach from visual studio.
You can check which line throws error. Also try to put traces in your code and enable your plugin trace logs to check these traces.
This is how platform handles serverside errors on the frontend and you have nothing to do with it.
I guess my Error handling seems wrong. Is it?? If not, can you suggest me how can I save records if User Records matches with Admin Records "name" and throw error if it does not match
I believe it is wrong because:
if (str1 == str)
Console.WriteLine("Sorry Equal Record Found");
throw new InvalidPluginExecutionException("It seems the record of this Name already Exists!!");
in this code you validate if name already exists and throw an exception if so and... this exception caught and rethrown here:
catch (InvalidPluginExecutionException e)
// catch exception
throw new InvalidPluginExecutionException("An error has occurred: " + e.Message);
Just remove external handling of exception and it should start working.
What can I do to save records if there is no duplication.
As in if(str!=str1)??. Note: I am calling it on Preoperation
if(str!=str1) - you don't have to do anything. System will save the record if you don't throw any exception.
If there is no duplicate, you let system save the record so no need to add code for that.
Make sure you have not activated OOB duplicate detection rules otherwise you will get warning on save of record if rule satisfy the conditions.
Thanks All, Though all of the above suggestions made the error to went off. But I am getting the Duplication check message for every String I enter in UserRecord , Even if Strings are not Equal , It must get Saved, but it isn`t.
Business Applications communities