How to update CRM User profile from Active Directory

The idea of the method is very simple: use the system function, which fills user’s form on “domain name” field change:

function domainname_onchange()
{
try
{
onDomainNameChange();
}
catch(e)
{
displayError("domainname", "onchange", e.description);
}
}

Let’s modify it and add a button through isv.config:

<ImportExportXml version="4.0.0.0" languagecode="1033" generatedBy="OnPremise">
<Entities>
</Entities>
<Roles>
</Roles>
<Workflows>
</Workflows>
<IsvConfig>
<configuration version="3.0.0000.0">
<Root />
<Entities>
<Entity name="systemuser">
<MenuBar/>
<ToolBar>
<Button Icon="/_imgs/ico/16_l_refresh.gif" JavaScript="try { onDomainNameChange(); } catch(e) { displayError(&quot;ISV Upadate User from AD&quot;, &quot;onclick&quot;, e.description);} " >
<Titles>
<Title LCID="1033" Text="Update User from AD" />
</Titles>
<ToolTips>
<ToolTip LCID="1033" Text="Update User from AD" />
</ToolTips>
</Button>
</ToolBar>
</Entity>
</Entities>
</configuration>
</IsvConfig>
<EntityMaps />
<EntityRelationships />
<Languages>
<Language>1033</Language>
</Languages>
</ImportExportXml>

After importing this customization, you should see a button on the User form toolbar:

That’s it! This buttom will update the form whith fresh data form Active directory!

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: