Archive

Posts Tagged ‘edit user’

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()
{
openObj(SystemUser,USER_GUID)
}

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" 
Location="Mscrm.HomepageGrid.{!EntityLogicalName}.MainTab.ExportData.Controls._children" 
Sequence="71">
<CommandUIDefinition>
<Button Id="Sample.{!EntityLogicalName}.MainTab.LaunchURL.Button" 
Command="Sample.all.MainTab.LaunchURL.Command" 
LabelText="Edit My Profile" 
ToolTipTitle="Edit My Profile" 
ToolTipDescription="Edit My Profile" 
TemplateAlias="o3" />
</CommandUIDefinition>
</CustomAction>

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

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