Answered by:
Fetching Account ID?

Question
-
Hi all,
I want to fetch account id at the screen level and in onload , can any body suggest how to do it,
This is very much required for me
Thanks and Regards
Ravi
Wednesday, October 5, 2011 8:31 AM
Answers
-
Or if you don't need to store the value, in onload event:
Xrm.Page.getAttribute("prefix_thecustomattribvute").setValue(Xrm.Page.getId());
My blog : http://mscrmtools.blogspot.com
All my tools for Dynamics CRM 4.0 on my dedicated site: MSCRMTools Repository
Upgraded tools for Dynamics CRM 2011!
View Layout Replicator | Searchable Property Updater | Ribbon Browser | SiteMap Editor | JavaScript Web Resource Manager | Role updater- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
Wednesday, October 5, 2011 8:45 AMModerator -
Hello Ravi,
You can use following script - Xrm.Page.getAttribute('originatingleadid').getValue()[0].id
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:06 PM
Wednesday, October 5, 2011 9:19 AMModerator -
Hi,
You can get the Lead Id (Orignating Lead ) from Account Entity by Account Id using Retrieve request over SOAP or REST , you may also refer the followign Url for step by step guide: http://worldofdynamics.blogspot.com/2011/06/microsoft-dynamics-crm-2011-retrieve.html
For using REST you may refer: http://msdn.microsoft.com/en-us/library/gg334427.aspx
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 Wednesday, October 5, 2011 10:26 AM
- Edited by Jehanzeb.Javeed Wednesday, October 5, 2011 10:28 AM
- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
Wednesday, October 5, 2011 10:26 AM
All replies
-
Hello Ravi,
I can suggest following:
1. Add custom varchar field to account entity.
2. Develop plugin which will handle Create message, grab id of created account and update field created at first poing with ID.
After it you will get the possibility to insert ID field to any view and place it to editing form.
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Andrii ButenkoMVP, Moderator Wednesday, October 5, 2011 8:36 AM
- Edited by Andrii ButenkoMVP, Moderator Wednesday, October 5, 2011 8:36 AM
Wednesday, October 5, 2011 8:36 AMModerator -
Or if you don't need to store the value, in onload event:
Xrm.Page.getAttribute("prefix_thecustomattribvute").setValue(Xrm.Page.getId());
My blog : http://mscrmtools.blogspot.com
All my tools for Dynamics CRM 4.0 on my dedicated site: MSCRMTools Repository
Upgraded tools for Dynamics CRM 2011!
View Layout Replicator | Searchable Property Updater | Ribbon Browser | SiteMap Editor | JavaScript Web Resource Manager | Role updater- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
Wednesday, October 5, 2011 8:45 AMModerator -
Hi Tanguy,
I have a doubt
does Xrm.Page.getId() - return account id of an account.
can you please tell me.
Thanks and Regards
Ravi
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, October 5, 2011 9:05 AM
- Unmarked as answer by Andrii ButenkoMVP, Moderator Wednesday, October 5, 2011 9:05 AM
- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
- Unmarked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
Wednesday, October 5, 2011 8:55 AM -
Hello Ravi,
Please check following url - http://technet.microsoft.com/en-us/library/gg334720.aspx#BKMK_getId
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
Wednesday, October 5, 2011 9:06 AMModerator -
Hi Andriy,
Thank you very much,
actually my requirement is like this
Using Account id - i want to fetch lead id - and get into lead entity and fetch lead type( custom field)
now in the account entity there is field originating lead id - it is lookup, how can fetch lead id?
do you have any idea
Thanks and Regards
Ravi
Wednesday, October 5, 2011 9:10 AM -
Hello Ravi,
You can use following script - Xrm.Page.getAttribute('originatingleadid').getValue()[0].id
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:06 PM
Wednesday, October 5, 2011 9:19 AMModerator -
Hi,
You can get the Lead Id (Orignating Lead ) from Account Entity by Account Id using Retrieve request over SOAP or REST , you may also refer the followign Url for step by step guide: http://worldofdynamics.blogspot.com/2011/06/microsoft-dynamics-crm-2011-retrieve.html
For using REST you may refer: http://msdn.microsoft.com/en-us/library/gg334427.aspx
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 Wednesday, October 5, 2011 10:26 AM
- Edited by Jehanzeb.Javeed Wednesday, October 5, 2011 10:28 AM
- Marked as answer by E Ravi kumar Wednesday, October 5, 2011 12:07 PM
Wednesday, October 5, 2011 10:26 AM