I am new to CRM. I have a requirement where I have an "account" entity and a "contact" entity. In contact form I have a lookup field for searching account name which is stored in account entity. When I select an organization through lookup, the contact number of that organization should be fetched and saved in another field in contact form. I need to do it with fetch XML.
Asked
Active
Viewed 1,385 times
-3
-
Why does it need to be done with FetchXML? This would be possible to do with a BPF. – Jonas Rapp Sep 24 '17 at 17:12
-
Yes Jonas I can do it with BPF or even workflows. I have done it using javascript oData. But now the requirement is to be done with fetchXML – Bunny Sep 25 '17 at 03:16
-
Is this 2016 or later ? FetchXML should be left behind to rot, WebAPI is there now to make our life easier and our code work better. The only answer I can come up with is "tell your boss to stop wasting your time with FetchXML". More seriously: SOAP endpoints are going to vanish and only the WebAPI will stay, so it's not worth the effort. – Alex Sep 25 '17 at 09:27
-
You can still use FetchXML with the WebAPI endpoint... ;) – Jonas Rapp Sep 25 '17 at 18:38
1 Answers
-1
Option 1: You can do a no-code solution by mapping fields between account & contact.
Option 2: If you don't want a physical copy of field value in both entity, use Quick view form of Account lookup to just display the fields in contact without storing redundant data.
Option 3: If you still want to store the value onchange of account, retrieve it & set it in contact field. This step by step guide will help you to build fetchxml & use it in JS. Your question doesn't say if you are stuck in query or any error.

Arun Vinoth-Precog Tech - MVP
- 22,364
- 14
- 59
- 168
-
Wouldn't this only apply to new contacts created from the account ? OP wants to pick a parent account from the contact and copy a field over (IIRC) – Alex Sep 25 '17 at 09:27
-
Thanks Arun I tried your solution. But Alex also got it right. The same thing is happening. – Bunny Sep 25 '17 at 13:10
-
did you explore solution 2 & 3 ? 1st will not work in all scenarios – Arun Vinoth-Precog Tech - MVP Sep 25 '17 at 13:20