Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I am using UpserRequest to Create or Update data. This works like a charm. Now, I need to implement some logic which prevents UpsertRequest from updating an existing records. For example, when a record's status is "Final", then the UpsertRequst shall not update this record.
Hi,You mean in console app you want to add some condition before performing upsert operation?
Thank you, Pradeep Rai.
Yes, I want to add a condition which controls whether an Upsert operation will succeed. Use case is as follows: I have created a custom entity, which has two options as Status Reason (statuscode): Draft and Final (statecode is Active). When I perform the Upsert Request I somehow want to prevent overwriting all entities which have statuscode == Final.
I can only see one way that is before Upsert try to retrieve the data by adding filter condition of Statuscode.
because upsert request take only one property "Target"(Entity Type).
Also, we can not add plugin on pre-operation of custom entity because Pre-operation is of sync type.
"pre-operation of custom entity because Pre-operation is of sync type."
What does that mean? A plug-in could actually work here
You can achieve this using Pre-operation plugin -
Check if Status is final - you can get the status field value using preimage
if it is true throw exception from your plugin.
But the problem is it will not allow user to update the record from UI/Data import if status old value if final.
Business Applications communities