Posts Tagged ‘application ribbon’

Edit user profile link in Application Ribbon

In one of our implementation we have more than 10 realted entities for user entity. Users need to update information for their user account based on other tasks. To update the user information users need to open logged in user record from file–>options–>view your user information. Insted of doing this every time we thought of having a link in application ribbon to open user information. Here we go

Create a java script web resource (new_userinfo.js) with a function to open logged in user record. Here is the function you can use to open logged in user record

function openuserinfo()

Now we need to call this function from ribbon button. Create a solution and add Application Ribbon and new_userinfo.js web resource components to it and export the solution.

Extract the file and open customizations.xml to add the ribbon button.

Add Custom Action and Command Definitions for button. Use the below code

<CustomAction Id="Sample.{!EntityLogicalName}.MainTab.LaunchURL.CustomAction" 
<Button Id="Sample.{!EntityLogicalName}.MainTab.LaunchURL.Button" 
LabelText="Edit My Profile" 
ToolTipTitle="Edit My Profile" 
ToolTipDescription="Edit My Profile" 
TemplateAlias="o3" />

<CommandDefinition Id="Sample.all.MainTab.LaunchURL.Command">
<EnableRules />
<DisplayRules />
<JavaScriptFunction Library="$webresource:new_userinfo.js" FunctionName="openuserinfo" />

Save the customizations file and import the solution. Publish the customizations to see the link in application ribbon.

But this link will be available only when you select entities, I mean this link will not be available when you select Dashboards, Calendar, Announcements or default links in Settings