tag:blogger.com,1999:blog-5472436831307966815.post364438801880610341..comments2024-03-20T00:30:07.883-06:00Comments on Daniel Cai's Blog: Use CRM Web Service Toolkit to Implement Associate/Disassociate/SetState FunctionsDaniel Caihttp://www.blogger.com/profile/05461949321689249420noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5472436831307966815.post-45389591230193018202011-07-11T03:51:42.556-06:002011-07-11T03:51:42.556-06:00I have one doubt.
I am trying to update the state...I have one doubt. <br />I am trying to update the statecode and statuscode on the click of a button. <br />I am just confused as to where to place the above code. It is in XML right? Can it be placed in a javasciprt? <br />If not, does anyone know how to update the status using javascript code?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-53445367751088525232010-05-26T06:35:18.674-06:002010-05-26T06:35:18.674-06:00Thanks vlad007 for pointing out the error. I have ...Thanks vlad007 for pointing out the error. I have corrected the code. <br /><br />As I said, I didn't unit test the code, I basically followed the SDK document to come up the code. However the request XML that I made up was not in the right sequence. <br /><br />You can also send me email if you have trouble to paste code when commenting. <br /><br />Thanks vlad007 again, you are indeed a 007 man.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-41554589813860383622010-05-26T04:49:03.116-06:002010-05-26T04:49:03.116-06:00setState = function(entityName, id, stateCode, sta...setState = function(entityName, id, stateCode, statusCode) {<br /> var request = [<br />"<Request xsi:type='SetStateDynamicEntityRequest'>",<br /> "<Entity>",<br /> "<Name xmlns='http://schemas.microsoft.com/crm/2006/CoreTypes'>", entityName, "</Name>",<br /> "<Id xmlns='http://schemas.microsoft.com/crm/2006/CoreTypes'>", id, "</Id>",<br /> "</Entity>", "<State>", stateCode, "</State>",<br /> "<Status>", statusCode, "</Status>",<br />"</Request>"<br />].join("");<br /><br /> return CrmServiceToolkit.Execute(request);<br />};Anonymousnoreply@blogger.com