Answered by:
Field Mapping via JS?

Question
-
Hi All,
Just wondering if it's possible to do the following via JavaScript. In this scenario we have Service Users (Contact entity) who receive one or more Service (custom entity) that is evaluated every 6 months (Service Evaluation - custom entity). So their relationship is as follows: Contact - 1:N - Service - 1:N - Service Evaluation (with no direct relationship between Contact and Service Evaluation).
What I want is to display the Service User's (Contact's) full name and address on the Service form as well as on the Service Evaluation form, via JS. Is it possible? If yes, could someone explain it how, or point me to a thread that explains it how.
Thanks,
Viktor
Friday, January 10, 2014 9:54 AM
Answers
-
Hi Viktor,
it is possible, this because (as you described your scenario) you have inside Service Evaluation a lookup pointing to the parent Service record, and inside Service a lookup pointing to the Contact.First you need to create the additional fields that will hold the full name and the address on Service and Service Evaluation entities, after you can query CRM using oData.
I can't write you a full script, but you can start from these examples:
http://www.crmanswers.net/2013/07/set-accounts-primary-contact-as.html
http://www.crmanswers.net/2013/04/get-current-users-full-name-with.html
both use oData to retrieve data, you need to combine them and adapt to your entities.
My blog: www.crmanswers.net - Rockstar 365 Profile
- Proposed as answer by Payman BiukaghazadehEditor Friday, January 10, 2014 12:04 PM
- Marked as answer by viktor.j Friday, January 10, 2014 12:39 PM
Friday, January 10, 2014 10:04 AM
All replies
-
Hi Viktor,
it is possible, this because (as you described your scenario) you have inside Service Evaluation a lookup pointing to the parent Service record, and inside Service a lookup pointing to the Contact.First you need to create the additional fields that will hold the full name and the address on Service and Service Evaluation entities, after you can query CRM using oData.
I can't write you a full script, but you can start from these examples:
http://www.crmanswers.net/2013/07/set-accounts-primary-contact-as.html
http://www.crmanswers.net/2013/04/get-current-users-full-name-with.html
both use oData to retrieve data, you need to combine them and adapt to your entities.
My blog: www.crmanswers.net - Rockstar 365 Profile
- Proposed as answer by Payman BiukaghazadehEditor Friday, January 10, 2014 12:04 PM
- Marked as answer by viktor.j Friday, January 10, 2014 12:39 PM
Friday, January 10, 2014 10:04 AM -
Thanks a lot Guido, indeed, oData is what I'm looking for. Much appreciated!
Here is a good article with a bit more explanation for those interested: http://deepakexploring.wordpress.com/2011/10/20/odata-and-jscript-in-crm-2011/
Friday, January 10, 2014 12:39 PM