1

We have a Dynamics CRM 2011 of Microsoft. In my Opportunity entity, I enter another entity data named special services.

Every Opportunity can have multiple special services, so Opportunity has 1:N relation with special services (opportunity as primary entity) We all know that Opportunity has 1:N relation with Quote and also Order, And Quote to Order has 1:N relation.

Now I want to display special services data I entered in Opportunity entity (same data entered) in Quote and Order Form via subgrid.(in onload of the page or onclick of saving data in opportunity)

It cannot be done with relations and also with quick view form since CRM 2011 does not support quick view form.

I must write a JavaScript for this purpose. I know how to insert JavaScript written into the form via this link.

But Can anybody give a sample like this? And guide me via guide line?

Alireza
  • 89
  • 2
  • 15

1 Answers1

0

Native Subgrid without direct relationship is not feasible.

If it’s just for display purpose, Add a HTML web resource that shows list of special services, you have to query the related special services filtered by parent opportunity to bind the data to HTML <table> <tr> <td> elements. Embed it in whatever entity you want by passing opportunity Id to filter. Read more

Another option is like discussed in community thread to design an opportunity form only with required subgrid & use that form in HTML webresource by entity form url.

Update:

I just took this as a challenge, this needs a lot of efforts to complete it. Still not 100% & look clumsy. I know this is not intended usage & I won't recommend this. May be you can give a <a href> link with the below url & user can open the form like window.open & see this indirect list.

You have to pass opptyid as querystring to HTML (or read from parent page) & then bind the built url to IFRAME within HTML web resource, NOT IFRAME in CRM form.

Displaying an entity form within an IFrame embedded in another entity form is not supported.

https://testvanilla.crm.dynamics.com/main.aspx?etn=opportunity&pagetype=entityrecord&id=%7B0B98C88E-C147-E811-A95F-000D3A1A9FA9%7D&extraqs=formid%3dD7C8AF17-9076-44AF-A64C-7E94396CECE0

Sub-grid of orders added in Opportunity form, then the above url is composed & given as IFRAME URL. IFRAME is in HTML web resource, HTML page is added in Order form. So Order form showing Opportunity form with related Orders.

enter image description here

  • Hi there Thanks for your reply. Its not about display.Its about editing. How ever could you just show me any sample of this?( just showing ) Thanks – Alireza Apr 21 '18 at 18:39
  • @alirezaazadi see my updated answer; you can generate record link & set an tag for the text in , so that user can click & edit.. – Arun Vinoth-Precog Tech - MVP Apr 21 '18 at 19:29
  • Sir, I will try this tomorrow and let you know. – Alireza Apr 22 '18 at 04:06
  • It applies to Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online I have Dynamic CRM 2011(on-premises) – Alireza Apr 22 '18 at 06:34
  • @alirezaazadi Am in mobile, could not switch the version in msdn article. Did you try? There should not be much difference about version in this matter. https://ashishmahajancrm.wordpress.com/2012/05/07/microsoft-dynamics-crm-2011-open-forms-views-and-dialogs-with-a-url-delete/ – Arun Vinoth-Precog Tech - MVP Apr 22 '18 at 14:45
  • I read that, I can window.alert() base url in the my form, and such practice in this link you sent me. @Arun But I do not understand how to use these url in HTML webresource of form to fill the subgrid with specific id so that display related special services of the parent data in subgrid of child. – Alireza Apr 23 '18 at 05:38
  • @alirezaazadi you are back to square one. Read the last line (paragraph) of my answer, add an iframe in html & the iframe url should be oppty Form only with subgrid. Clear? This is too broad for SO. Ask a separate question pls. – Arun Vinoth-Precog Tech - MVP Apr 23 '18 at 10:19
  • Ok. Im gonna try it now. I will let you know. Thanks for reply. – Alireza Apr 23 '18 at 10:32
  • I can not create IFRAME And display the FORM inside that. But every Opportunity has its own id starts with %7 and ends with %7d. right? Even I check the box : Pass record object-type code and unique identifier as parameters. The browse tell me try again.( can not find ) But I can open the create new opp form in the IFRAME. – Alireza Apr 24 '18 at 06:26
  • 1
    I just wrote a JS. Thank you for your reply and help. I read Microsoft JScript functions and then created a subgrid. In onLoad of the form that subgrid exists, i called my script so the script find the subgrid and fill out with custom fetchXML. – Alireza May 07 '18 at 10:40
  • @alirezaazadi so you created a new direct relationship between special services & quote, also between order? Then only subgrid can be inserted & custom fetchxml can be overwritten. – Arun Vinoth-Precog Tech - MVP May 07 '18 at 10:47
  • 1
    Yeah, excatly. I did it just yesterday. I had some other jobs, But finally did that. – Alireza May 07 '18 at 11:48