Get RowVersion During Plugin Execution - dynamics-crm

I'm attempting to get the RowVersion of an entity that was retrieved in a CRM Plugin. It is always being returned as an empty string. Is the RowVersion not actually returned when a request is from a plugin already on the server?

Talked to Matt Barbour at ExtremCrm2015 and he said this is a bug that will be resolved in CRM hotfix in the near future.

Related

After upgrade from Dynamics CRM 2011 to CRm 2016 experiencing weird issue with forms and plugins

Client company just upgraded to 2016 from 2011. I've been testing the plugins to make sure they all still function and I've finally (after much frustration) figured out what is happening, but no idea why or how to resolve this.
I have several plugins and they all function exactly as expected - as long as the updates to the data are not run through the forms.
Let me explain:
I have plugins (Synchronous) that trigger on a change to a field. If the field is changed via a workflow, or some other coded process, everything runs just fine.
But when I update the field on the form it's self. It fails with a very generic error (below).
I support a couple of other clients already on 2016, and I'm not experiencing this same problem. So I'm not even sure where to begin. I've been going crazy here the last couple of days to check the code. But it only happens when updating the field on the form. Every other method of updating the data that I have tested works with no errors.
I also have another issue. When the field is updated (through a test workflow), it runs and updates a child record. The child record then has a workflow that runs to deactivate the record. The workflow says it ran and deactivated the record, but it never deactivates).
Anyway. if ANYONE has ANY idea at all about what could be causing this. I would love to hear it. I'm at my wits end on this.
Thank you in advance.
I've tested the code and had it run successfully, as long as I don't update the field through the form. To test this I created some test workflows that update the data, they successfully run and the plugins fire off with no problems.
EntityReference contact =
(EntityReference)preImageEntity.Attributes["ipmahr_contact"];
QueryExpression cn = new QueryExpression("ipmahr_recertification");
cn.ColumnSet = new ColumnSet("ipmahr_contact", "statecode");
cn.Criteria.AddCondition("ipmahr_contact", ConditionOperator.Equal,
contact.Id);
cn.Criteria.AddCondition("statecode", ConditionOperator.Equal, 0);
EntityCollection results1 = server.RetrieveMultiple(cn);
if (results1.Entities.Count > 0)
foreach (Entity a in results1.Entities)
{
a.Attributes["ipmahr_deactivaterecertificationrecord"] = true;
server.Update(a);
}
The code is pretty straightforward in most cases, and works fine as long as things aren't updated on the form.
Here is the error: Exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: System.ServiceModel.CommunicationObjectFaultedException: #595EB751 (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault)., Correlation Id: fd1a79ca-c846-407b-b578-ac9207d6dd0e, Initiating User: 274d55dc-3f4d-e811-b30f-0050569142af Exiting Recertifications.Main.DeactivateUsedRecertificationsonEndDateChange.Execute(), Correlation Id: fd1a79ca-c846-407b-b578-ac9207d6dd0e, Initiating User: 274d55dc-3f4d-e811-b30f-0050569142af
New information. I have found that not all the plugins I've written have an issue on this server. This is good. But I also found that there is a commonality on those plugins that do fail.
Any plugin using a Query Expression fails with the generic error. Adding robust error checking didn't show anything (once error checking was added, it just didn't run anything, and didn't produce any errors in the logs). Trace logs didn't show anything significant either.
So now I'm wondering if there is something in the way the Query Expression is formatted, or if there is an issue with the SQL. I mention SQL because I found this morning that if I create fields too fast, I get a generic SQL error. Wait a minute and I can create new fields without a problem.
I think it likely that this plugin is not actually failing based on the error you are receiving and the fact that it happens conditionally. More likely, your server.Update(a); call is resulting in a failure within a secondary plugin or workflow action triggered by update of the Recertification record.
- Comment out that line and verify that the plugin works
- See if you can reproduce a failure by directly updating that field on the Recertification record
- Review plugin/workflows running against the Recertification entity
Most likely this has one of the following root causes:
- A security issue based on different executing users between the form update or workflow update
- Other tangential fields are being updated by one or the other of those two methods which subsequently cause different behavior in a secondary plugin/workflow

Error: Found a string attribute with unrecognized format

im currently using MSCRM Toolkit for Dynamics 365 and wanted to export Audit reports.
When using the Audit Export Manager
On a CRM Online 2016 Update instance
While executing the "(Re) Load Source Structure" command
the following error message is received:
Error: Found a string attribute with unrecognized format.
How can i resolve the issue stated above so that i can load the entities, etc. to make audit export possible?
Here is the screenshot of the error, though we put the needed credentials still same error we still get.
Please help, we have presentation to come hope that professionals in Dynamics365 or those that have answers to my question can help
I came across this with MetadatDiagramConsole.exe as well when trying to pull from Dynamics365 online environment. I found changing RetrieveAsIfPublished to true worked.
Also the wonderful toolbox team has posted an updated version recently that worked for others trying the audit process you mention.
https://mscrmtoolkit.codeplex.com/releases/view/630624

Error: 5080 : Form transaction registration failed - tried previous answers

I have searched the answers to similar questions asked about this SagePay error, and checked that the fixes don't appear to apply to my problem.
Specifically:
I am using a correct 2-letter country code for BillingCountry and DeliveryCountry.
I am POSTing VPSProtocol, TxType and Vendor as well as the Crypt value.
I have re-checked that I am using the correct encryption key from the MySagePay test portal.
Now I was using http://localhost:8084/app/success and http://localhost:8084/app/failure for my success and failure URLs, since I thought that although these are (obviously) not visible externally, it shouldn't matter since SagePay is re-directing at the end of its part of the transaction. (Is this assumption correct, or do these URLs need to be externally accessible?) Some of the answers have thrown doubt on this, so I changed them to an external website I own, and I still get the same error.
Another line of thought is that the client I am developing for has already gone live, and there seem to be hints that once you have gone live, you no longer have access to the test server (Is this true?)
Is there anything else I should be checking? (Additional info: I'm using the SagePay api (sagepay-api-1.2.2.0.jar and related libraries) to validate the form contents and encrypt them.
I used the integration from https://github.com/tolzhabayev/sagepayForm-php
I had this error (5080) and spoke to SagePay support and they guided me to the MySagePay portal where you can view Invalid transactions to be able to troubleshoot this error easily!
Hope this helps someone.
Chris Rickards
I had exact same problem and I tried everything that you described as well, one day after I found that the problem was in "VendorEMail" field, it had 2 email addresses separated by ;, once I removed second and left only one email everything worked.

XRMServiceToolkit is not working as Expected after upgrading MS Dynamics CRM 2015 to 2016

I have upgraded MS CRM 2015 to 2016 and it is working fine. We are using XRMServiceToolkit(2.2) javascript library to fetch data from server.
The main problem is we are getting logical name in name attribute and logical name is blank, whereas earlier we use to get value of the field in name attribute and field name in logical name. Please refer the screenshot for better understanding.
Below is the screenshot from MS CRM 2016 :
Below is the screenshot from MS CRM 2015 :
I have searched online but couldn't find anything related to this. I tried making change in the library but it lands up into other errors. If I check the XML response from the server in 2015 :
<b:value i:type="a:EntityReference">
<a:Id>0698841a-e9cf-e511-9420-fcaa14b7a801</a:Id>
<a:LogicalName>ccs_category</a:LogicalName>
<a:Name>MORTGAGE</a:Name>
</b:value>
in 2016 :
<b:value i:type="a:EntityReference">
<a:Id>0698841a-e9cf-e511-9420-fcaa14b7a801</a:Id>
<a:KeyAttributes xmlns:c="http://schemas.microsoft.com/xrm/7.1/Contracts" />
<a:LogicalName>ccs_category</a:LogicalName>
<a:Name>ORGANIZATION</a:Name>
<a:RowVersion i:nil="true" />
</b:value>
I think this could be a reason for this problem but I don't know how to resolve it.
I hope you've solved this issue.
I will post the answer for everyone else who might be experiencing this issue.
As stated in the project description page, since Dynamics CRM 2015 Update 1, you should use the 2.2.1 version of the library.
This is the link to the download page: XrmServiceToolkit v2.2.1.
Also keep in mind this issue. I don't know if the publisher has already solved it.
Last but not least, you should keep in mind that from Dynamics CRM 2016, the OData endpoint has been deprecated (it still works but will stop working in future releases) and the supported way to query OData endpoint is through the Web API.
You can find a starting point to query CRM data here.
Cheers.

Entity Framework insert error ("The Version field is required.")

I am using Silverlight 4 and RIA services. When I try to insert into my database, I get the following error:
"Submit operation failed validation. Please inspect Entity.ValidationErrors for each entity in EntitiesInError for more information."
Upon inspecting the ValidationErrors, I see:
"The Version field is required."
Isn't the Version field updated and maintained by the framework? If so, why is it null? If not, how am I supposed to set it?
This is apparently a bug with in Silverlight 4. Hopefully it will be fixed in the final release.
It can be fixed by simply setting [Entity].Version = new byte[0];.

Resources