Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Using Javascript updating multiple records of another entity. I could not figure out how to do it

$
0
0

I am using Javascript and CrmServiceToolkit function. I could get all the related records of Entity B from my current Entity A.

But I Need to update the same fetched records of Entity B. I am not able to do it. Any help and updation of code will be great help.

Below is my code. It is working fine.

Also I referred http://danielcai.blogspot.de/2010/01/crm-web-service-javascript-toolkit.html

--------------------------------------

function customerrefrencedis () { // Retrieve all contacts whose first name is John. var firstname = Xrm.Page.data.entity.attributes.get('aw_displayname').getValue(); var query = "<q1:EntityName>new_rotoraborts</q1:EntityName>" + "<q1:ColumnSet xsi:type='q1:ColumnSet'>" +    "<q1:Attributes>" +       "<q1:Attribute>abaxis_showname</q1:Attribute>" +        "<q1:Attribute>abaxis_showname</q1:Attribute>" +    "</q1:Attributes>" + "</q1:ColumnSet>" + "<q1:Distinct>false</q1:Distinct>" + "<q1:Criteria>" +    "<q1:FilterOperator>And</q1:FilterOperator>" +    "<q1:Conditions>" +       "<q1:Condition>" +          "<q1:AttributeName>abaxis_showname</q1:AttributeName>" +          "<q1:Operator>Equal</q1:Operator>" +          "<q1:Values>" +             "<q1:Value xsi:type='xsd:string'>" + firstname + "</q1:Value>" +          "</q1:Values>" +       "</q1:Condition>" +    "</q1:Conditions>" + "</q1:Criteria>";

var retrievedContacts = CrmServiceToolkit.RetrieveMultiple(query);

alert(retrievedContacts.length);

for (i = 0; i < retrievedContacts.length; i++) { alert(retrievedContacts[i].getValue('abaxis_showname')); alert(retrievedContacts[i].getValue('statecode')); } }


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>