CRM 4.0: update multiple accounts but don't change owner
-
18. dubna 2012 20:49I want to edit multiple account records. however, doing this also changes the owner to the person doing the update. Why is that? Is there a way to not have the owner update?
Všechny reakce
-
18. dubna 2012 20:58Přispěvatel
Hi,
This is not the default behaviour of Dynamics CRM - are you sure that there is not some custom workflow/plugin assigning records to the modifiedby user?
hth,
Scott
Scott Durow
Read my blog: www.develop1.net/public
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful" -
18. dubna 2012 22:47
There is an onload event on the form. I don't know what the code means but it says retrieve userid. Could this be the issue? This is part of the code:
// retrieve userid
var soapBody = "<soap:Body><Execute xmlns='http://schemas.microsoft.com/crm/2007/WebServices'><Request xsi:type='WhoAmIRequest' /></Execute></soap:Body>";
var soapXml = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>";
soapXml += GenerateAuthenticationHeader();
soapXml += soapBody;
soapXml += "</soap:Envelope>";
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("POST", "/mscrmservices/2007/crmservice.asmx", false);
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlhttp.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Execute");
xmlhttp.send(soapXml);
xmlDocUser=new ActiveXObject("Microsoft.XMLDOM");
xmlDocUser.async=false;
xmlDocUser.loadXML(xmlhttp.responseXML.xml);
var userid = xmlDocUser.getElementsByTagName("UserId")[0].childNodes[0].nodeValue;
soapBody = '<soap:Body><Retrieve xmlns="<entityName>systemuser</entityName><id>'+userid+'</id><columnSet">http://schemas.microsoft.com/crm/2007/WebServices"><entityName>systemuser</entityName><id>'+userid+'</id><columnSet xsi:type="ns1:AllColumns" xmlns:ns1="</Retrieve></soap:Body>'">http://schemas.microsoft.com/crm/2006/Query"/></Retrieve></soap:Body>';
soapXml = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"; -
19. dubna 2012 3:36
Hi,
Scott might be right. You are getting the user id. is that all the code you have in your javascript. May be you are populating this userid in the owner field on the onchange of some field. As you are retrieving the user id, so I guess you should be using it somewhere.
Also try to edit and update one account record. Make sure user who is not the owner update this single account record. Then check whether the owner has changed? If it has, definitely there is this code running somewhere.
Also, I know you must be looking at the correct field, but just to make sure you are looking at owner field and not modifiedby field.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
-
19. dubna 2012 3:56
HI Kbearhome,
Can you tell me the way, that how you updated the multiple account records.....
Pavan
-
19. dubna 2012 12:34
Hi kbearhome,
I had a similar issue when I was importing data in bulk using the Data Import Wizard. Before doing the actual import I was able to select any user in the CRM as the owner for that specific batch of data and once imported the "modified by" field for that set would show my name, i.e. the user doing the import. This is all very correct as per the CRM's default functionality. But after a while many of those records' "modified by" field was changed to "System" and no more the user who actually modified the record. There were no javascripts which could have possibly done this and there were no plugins or custom workflows associated with the specific entity. My BA and me were going nuts trying to figure out the root cause for this weird behaviour and after much prodding we were able to point it out. There was a callout written by my predecessor which was copying some of the default attributes' value to custom attributes. Just looking at the front-end it was hard to diagnose.
I am guessing you could be having a similar issue and sorry about the long story !!
All the best.
Regards,
Ankur
-
19. dubna 2012 16:46
Thank you for the responses. After doing a better job of testing, I found that it isn't changing the owner. I must have picked accounts that that particular user already owned (duh!). It added to the confusion that on the multiple edit screen, the owner is set to the user. In the screen below, Sheila is a dummy user and doesn't own anything. So sorry for my carelessness.