Dynamics CRM suppress record unavailable exception - dynamics-crm-2011

Is there a way to suppress/handle the "Record Unavailable" exception using a plugin/JavaScript. When a user tries to open a record that no longer exists,
I want implement a custom process to proceed. We are using Dynamics CRM 365.
Thanks in advance

Implemented a workaround using a similar approach outlined in this article. Essentially, I check to see if the record exists in the retrieve message and then trigger a custom action if it did does not exist anymore i.e recreate the record.
https://ameedsheikh.wordpress.com/2015/08/24/integrate-lob-data-details-in-crm-without-loading-large-data-volumes/#comment-178

Related

Customize the Add Location Box : Dynamics CRM 2016

I have a requirement where I need to auto fill the values in the Add Document Location Box when a User clicks on Documents in the Dynamics CRM 2016. I don't think there is an out of the box way to do this. Any hints or suggestions are appreciated.
I tried creating a sharepoint document location record on creating the record. When I click on Documents, it tries to find the URL for the location and gives an error that the location does not exist. I had hoped that the sharepoint folder will be created once the Sharepoint document location record has been created and associated with the record but that is not the case.
In case you have ever faced this problem, or if you have an alternative solution, please let me know.
Thanks!
In CRM 2016 you can enable server-based SharePoint integration. As a side note, in previous versions of CRM the List Component was required for the functionality you describe, but that is now deprecated.
When clicking on Documents on a SharePoint enabled record, you will see a popup similar to the following after enabling the server-based SharePoint integration:

InvalidPluginExecutionException dialog does not show up - CRM 2011

I have a Plugin on the Creation, Updating, and Deletion of the OpportunityProduct entity in the CRM 2011. I want to through exception on the success of some operations, means want to display dialog. It is working fine for Update and Delete. But it is not working fine for the Creation of OpportunityProduct, it is not throwing exception in the dialog. It is showing Exception: “An error has occurred, Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solution or contact your organization’s Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.”
Message : Create
Primary Entity : opportunityproduct
Action: Pre-Operation
Execution Mode: Synchronous
I think this is an internal issue that relates to how CRM treats compound entities such as opportunity product.
To verify this behavior you should put breakpoint in your code and inspect the context depth and parent context to understand if the create event is indeed a child process or the opportunity.
If so you might be able to re-register the plug-in the opportunity and try to somehow throw the error from there.

How to edit Workflow steps via API?

In my solution I have a workflow where one step contains a reference to Queue. After importing this solution on another CRM instance this workflow could not be activated because it contains an invalid reference - Queue can not be resolved. Queue with same name is created on new CRM but resolving is probably based on record Guid.
Now, I'm wondering, is there a way to edit workflow steps using CRM SDK? Whole process of CRM solution deployment is automated. And I want to remove all manual work. Some example would be great :)
Thanx in advance!
There are 2 things you can do if you are having issues with the Guids not matching in a workflow lookup when deploying from one environment to another.
Use the API to create those records referenced in the WF. When you create a record you can actually specify the Guid that it uses as the id. So write a tool or see if one exists already that will create some default data for your environment.
Use a configuration entity with references to all the EntityRefrences needed in your WFs. Then you can create a custom workflow activity to retrieve the configuration entity record (there should only ever really be one) that contains all the references in that environment.

How to differentiate a programmatic delete from an application delete in crm 2011 plugins

I have an entity with a pre delete plugin. Is it possible to differentiate in the plugin if the delete request has been issued manually in crm or programmatically using the crmservice from the sdk?
As far as I know is not possible to differentiate inside a plugin a request made by web interface from another made using the sdk.
You could infer it from other information.
If you know a particular user who will always be performing the delete (e.g. a service account), then you could inspect IPluginExecutionContext.InitiatingUserId.
Or you could have a 'delete by service' field, don't put that field on the form, then before you issue your delete via the crmservice, update that field to a known value. Then your plugin can just inspect that field.
Not quite as elegant as inspecting an origin field, but you should be able to perform the logic you need.

Error When Creating Record from Related Entity

I have a custom entity related to Account.
When I create a record of the custom entity from the Account an error message is shown:
Error
An error has occurred....
If this continues, contact your system administrator.
There is no problem creating the record from the entity itself.
There is a JavaScript function registered on-save of the custom entity that prevents the save if the record is a duplicate.
Why does the create/update not work from the related Account?
Although I agree with #PedroAzevedo's idea to turn tracing on, I disagree with his method because the CRM Diagnostic tool is a lot easier: http://crmdiagtool2011.codeplex.com
I'd also check for a plugin registered on the update of the Account Entity. It may be failing there, which would account for why it does work on the entity form itself...
Active the trace and see full error description. Another thing you can check is the security role, if you have permissions for the action AppendTo at Account.
The problems is IE 10. I installed Windows 8 last night and do not yet have update rollup 12 installed.
The same error occurs when I try to add a contact to the Account.

Resources