[SOLVED] Navigating URL from Ribbon’s custom button in Dynamics for Phones app

So, with all the buzz about the transition to the Unified Interface, I came across this issue where Url Command Action doesn’t work on the Dynamics for Phones app for a custom button

urlAction

Scenario

I’m Url Command Action in the Ribbon Workbench’s custom button to navigate to a PDF User Guide stored on the SharePoint for users to simply click and navigate.

classicUI

unifiedUI

Now, this works fine on the classic Web UI and Unified Interface Web Application.
targetPDF

 

But doesn’t work on the Dynamics for Phones app! Nothing happens when you click on it.

guideButtononPhone

Workaround/Resolution

So, the workaround is, using JavaScript method to navigate the URL as shown below

  1. Write a JS file which uses Xrm.Navigation.openUrl(<link>); instead.
  2. Remove the URL Action Command and use JavaScript Command instead in the Ribbon Workbench.
    useJSAction
    jsFuntion
  3. Sample Code here
    oAccountFormCustomization = {
    guideButton: function()
    {
    Xrm.Navigation.openUrl(“https://<yourlink/>&#8221;);
    }
    };
  4. And this should work on your phone app when you click the button there and it should successfully navigate to the said URL (my SharePoint Document in this case)
    docAppears

 

Related

Here are some of my other posts that are related to custom ribbon button –

D365 Ribbon Button shortcut to open a Document in SharePoint Online

Fix Ribbon icons on the Unified Interface in D365 CE

Hope that works!!

 

Advertisements

Create a New Record button for Activity Type entity using Ribbon Workbench: D365

Problem

Typically, when you create a new Activity type of entity and you want a Create button for the same, it just appears in the Other Activities fly-out button and not on the Main ribbon in Activities to be specific.

currentProblem

And you can’t simply drag it out in the Ribbon Workbench since it is a dynamic button.

dynamicMenu

So, in this blog, I’ll create a button to open a new Create record form for my Activity type of entity called Assignment.

Customization

  1. Create a new Solution in your D365 environment and only add Activity entity into it.
    createSolution
  2. Load this solution into Ribbon Workbench and on the Main ribbon, add a button and give it a Name and Icon
    Note: Since there was no space in the Activity Ribbon, I had to sacrifice on of the least used Activities I had.
    sacrificeButton
  3. On that, I created a new Command and provided the below parameters –
    commandParameters
    Make sure you enter the name of your entity in String Parameter shown above correctly, in my case, it is new_assignment.
  4. Attach this Command to the Button
    mapButton
  5. Now Publish and check.

Create Assignment Button in Action

Now, when I go to Activities, I see my button called Assignments

buttonAppears

 

And when I click it, it open the full form for the Assignment entity

newForm

Hope this was quick!

Bringing back Maintain Bookings Availability View from D365 PSA 1.2.x into 2.4.x

Disclaimer: This is an experimental implementation and is not recommended out-of-the-box. My assumption is Microsoft would not provide support for anything that gets goes wrong while implementing this, with the original MS scripts or anything that intervenes with out-of-the-box functionality. Kindly implement at your own risk, do not change the existing out-of-the-box files and back up entities/files before any customization.

Maintain Bookings Schedule Board view in PSA 2.4.x?

Recently, I upgraded PSA from v1.2.x to v2.4.x. And I missed the classic Availability view of the Maintain Bookings of the older version. 2.4.x has the new Schedule Board approach.

Schedule Board based Maintain Bookings view as below
scheduleBoardView

Instead of the old Availability View from the v1.2.x version which looked like this –
availabilityView

Also, even other projects bookings were seen which wasn’t desired and editing the hours was added effort. Se let’s see what we can do her –

Pre-Requisites

  1. Knowledge of Ribbon Workbench in the XRMToolBox.
  2. Make sure you have any D365 environment having PSA in version 1.2.x. You’ll need the older ProjectTeamActions.js file from that version of D365 PSA 1.2.x.
    originalFile

Customization

  1. I prepared a new JS Web Resource (named it MyCustomProjectTeamActions) in the target PSA 2.4.x environment and added the code from the PSA 1.2.x’s PSA file ProjectTeamActions.js file referred in the Pre-Requisites section above
    customWebResource
  2. In the XRMToolBox, connect to the 1.2.x’s Specify Pattern button on the Team Member Sub-grid view, you can use that as a reference.
    longViewSpecifyPattern
    closeViewSpecifyPattern
  3. In your updated PSA 2.4.x’s Org, assuming you have copied the ProjectTeamActions.js from the older org to your custom Web Resource file in Step 1 above, you can prepare a new custom button next to the existing one and use your custom file instead on your button. I just called it ‘New Maintain Bookings’
    customMaintainBookingButton
    customWRInButton
  4. And Publish your changes. Then go to the Project’s Project Team Member view and see your new button work.

Seeing it Work

  1. Now your new button appears besides the current version’s Maintain Bookings.
    teamMemberView
  2. And that will bring up the Availability View for the Maintain Bookings on how it was in PSA 1.2.x
    availabilityView

Hope this helps you out too!

D365 Ribbon Button shortcut to open a Document in SharePoint Online

I’ve come across a request where someone wanted quick access to a policy document which is commonly used by all CRM users. Documents like – a Policy Document, Terms Of Service, or absolutely a common User Guide!

Users find it tedious to remember and navigate to SharePoint to get hold of the same document frequently. So I thought, why not have a simple button to open the document in a new tab? Pretty easy. Here’s how we do it.

Ribbon Workbench

So, we use Ribbon Workbench to add a shortcut button to an entity’s form where if users feel they should look at the document while they’re working on the record, they can easily do so by just clicking it.

  1. Create a button on, say, Account entity form.
    createButton
  2. Use URL Action in Command to enter the SharePoint link to the document.
    ribbonAction
  3. Ensure what type of access you want for the document. Presumed that only people within the Organization should be able to use it.
    docAccess
  4. Use Copy Link feature to get rid of the % from the direct link and use the link in the URL Action and publish changes
    copyLinkButton
  5. Copy the link.
    copyTheLink
  6. And paste it in the URL Action property of the button
    pasteLink
  7. Make sure you select the Command you created and add it to the button as shown below, and maybe also a nice icon too!
    commandButtonJoin
  8. Finally, Publish changes.

Accessing the Document

Now, since you have published the button, we are ready to test.

  1. Go to Account for and click the button.
    clickButton
  2. It will take you to the document whose link you put it in the new tab (or whatever preference you had set for opening the link).
    openDocument

Pretty simple use case. 😊