Answered by:
CRM 2011: Can I change the contact address1_addressid?

Question
-
Hi,I'm developing an address management system for my company's CRM 2011 On-Premise. I am trying to change the address record that a contact record is pointing to for its address1 values. In JavaScript I used
Xrm.Page.getAttribute('address1_addressid').setValue(newValue);
The code runs without errors, but when I try to save the contact form, it then gives me a SQL Error (ever so helpful 'Generic Error'!). The form isn't saved.Like I said, the code ran fine, so I'm wondering if this is something I'm not allowed to do and SQL is stopping me??KirstenMonday, June 13, 2011 3:41 PM
Answers
-
Hi,
You can not set the value of 'address1_addressid' as system set it automatically, i am afraid it is not possible to change without accessing database or you may try via plugin. You may also see the post for setting GUID attributes values:
http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/75be6e7a-77ab-42f9-a7ba-d2cb99fcd4cf
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".- Proposed as answer by Jehanzeb.Javeed Monday, June 13, 2011 4:35 PM
- Marked as answer by Jim Glass Jr Monday, June 13, 2011 5:10 PM
Monday, June 13, 2011 4:35 PM
All replies
-
Hi,
What are you passing in the newValue? it would be better if you can write the full code.
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".Monday, June 13, 2011 3:53 PM -
Hi Jahanzeb,
Thanks for your response!
I am passing in the customeraddressid retrieved from anther address record. I'm afraid my full code doesn't show this but I am passing a value such as:
var newValue='{8caf1486-1f91-e011-9bcb-0026b97f0342}';
Xrm.Page.getAttribute('address1_addressid').setValue(newValue);Kirsten
Monday, June 13, 2011 4:04 PM -
Hi,
You can not set the value of 'address1_addressid' as system set it automatically, i am afraid it is not possible to change without accessing database or you may try via plugin. You may also see the post for setting GUID attributes values:
http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/75be6e7a-77ab-42f9-a7ba-d2cb99fcd4cf
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".- Proposed as answer by Jehanzeb.Javeed Monday, June 13, 2011 4:35 PM
- Marked as answer by Jim Glass Jr Monday, June 13, 2011 5:10 PM
Monday, June 13, 2011 4:35 PM -
Thanks for helping me out and letting me know what I can't do!
I'll have a look at that forum thread you linked too - looks useful.
Kirsten
Tuesday, June 14, 2011 8:35 AM