3

I am trying to make a SharePoint add-in work with the SharePoint Online "new experience". It adds a custom menu item custom action that runs inside iframe (HostWebDialog="true") and works well with SharePoint 2013:

<CustomAction Id="1237b974-6d89-4d20-b8ac-2b4ba8e21dce.MenuTest1"
                RegistrationType="List"
                RegistrationId="101"
                Location="EditControlBlock"
                Sequence="1"
                Title="Menu text"
                HostWebDialog="true"
                HostWebDialogHeight="280"
                HostWebDialogWidth="400">

    <UrlAction Url="~appWebUrl/Pages/MyPage.aspx?{StandardTokens}&amp;SPListItemId={ItemId}&amp;SPListId={ListId}&amp;SPSource={Source}&amp;SPListURLDir={ListUrlDir}&amp;SPItemURL={ItemUrl}" />
  </CustomAction>

However with the "new experience" it does not work. No JS errors or any messages are displayed, the menu call is silently ignored.

Does the "new experience" support HostWebDialog="true" option?

  • I just tried and it's working fine for me. – Rob Windsor Jul 22 '16 at 23:37
  • The issue is in "New Experience" mode. In "Classic Experience" it works fine. Unfortunately sharepoint.stackexchange.com does not allow me to edit this quetion and clarify it. – IT Hit WebDAV Jul 25 '16 at 2:59
  • Are you using SharePoint Online? SharePoint 2016 doesn't have the new experience. – Rob Windsor Jul 25 '16 at 7:23
  • Yes, I am using SharePoint Online. Please note that in HTTP headers it reports this is a SharePoint 2016. It looks like it is somewhat different from a "real" SharePoint 2016. – IT Hit WebDAV Jul 25 '16 at 14:26
  • That may be so but if you say SharePoint 2016, people will take it mean SharePoint Server 2016 on-premises. I edited your question to more properly describe the issue. – Rob Windsor Jul 25 '16 at 14:33
4

According to Update on Modern Document Libraries and Extensibility they should work.

We’ve already made some good progress here. Theming, global navigation links, and URL-based custom actions that extend the ribbon and context menus are already supported in the modern document library experience. This ensures that customers and partners taking advantage of these features can use the modern document library experience without compromising their customizations.

A couple weeks ago I tried to create an app with custom actions for a modern document library and I got the same results you did - they didn't work. I Googled for a while but I didn't find any solution to the problem.

Update (Aug 1, 2016): I tried again today and I was able to get both types of custom actions (menu item and ribbon) working against a document library using the new experience. I wasn't able to get the target page to show in a dialog.

Update 2 (Aug 1, 2016): I've been on an email thread with people from Microsoft and they have confirmed that opening the target page in a dialog is not supported in the new experience.

  • Could you please clarify, will HostWebDialog="true" work in future? This functionality is absolutely critical for us. – IT Hit WebDAV Oct 25 '16 at 20:27
  • We need to trigger our custom web browser protocol: myprotocol:corp.sharepoint.com/file.ext. We can not specify protocol URL directly - our SPS add-in does not pass validation in this case. Specifying javascript: protocol does not pass validation too. Opening a new window/tab or SPS web dialog does not work either. I would greatly appreciate any solution to this. – IT Hit WebDAV Oct 25 '16 at 21:01
  • A suggest you add the request for this functionality to the SharePoint User Voice (sharepoint.uservoice.com). If enough people vote for your request there is a chance that Microsoft will add it. – Rob Windsor Oct 25 '16 at 23:10
0

If you set the dialog parameters in your custom action , it will be translated into Javascript:LaunchApp(url, dialogoptions) with the new experience if the dialog options is not null it simply won't work and will cause a javascript error.

You should remove the dialog options and the url will open in a new window.

see full details on how custom actions works with the new doclib experience below:

http://www.sharepointtweaks.com/2016/07/new-document-library-experience-part-ii.html

Amr

Update 1 Aug after the 5th release of the odspo-next now the dialog opens in a new window and no javascript error is thrown

  • Did you try this? It does not work. – IT Hit WebDAV Oct 26 '16 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.