Wednesday 4 May 2016

Open Provider hosted Apps in SharePoint Model Dialog without using a Custom Action

Hi All ,

If you are new to SharePoint Provider hosted Apps and you want to open your Provider-hosted Apps in a SharePoint Model dialog then Microsoft suggests you should use a custom Action to achieve this functionality.


I was struggling a lot and I didn't want to use a custom action to open a Provider hosted App in a Model dialog, so I dug deeper into the custom action functionality. I found the Js function that the custom action uses internally use to open Provider hosted App in Model Dialog. I finally achieved success without using Custom Action and I have used below script to open my Provider hosted in Model dialog on click on anchor tag.

<a href="#" onclick="javascript:LaunchApp('13f91bd6-b83d-85cb-921a-v418368ae07a', 'i:0i.t|ms.sp.ext|f4df267v-3sa2-6406-a46c-1ba3b94d0715@1d586085-556e-2af5-244b-31c7481vc6a3', 'https:\u002f\u002fxyz.azurewebsites.net\u002fPages\u002fDefault.aspx?{StandardTokens}', {width:900,height:800,title:'Create Request'});">Open My Provider hosted App</a>

And, it's working perfectly without using a custom action ... you can pass your Item Id as well to provider hosted App from SharePoint model dialog.
I hope it will help you a lot for any question and query get in touch with me .


Happy Coding !!!


Thanks,
Pankaj Srivastava