Posts Tagged ‘JavaScript’

Mini Preview Window for Contact Lookup Field

Looks cool doesn’t it. well here goes nothing..
to achieve the above you will need the following (click read more link..)

// the following code is for the hover over lookup window
function OnCrmPageLoad()
{
/*
Reference the to Lookup, Provide the lookup (control) id.
*/
var PrvToLui = new LookupPreview(”new_primarycontactid”);
/*
Add Account Preview Information [...]

Comments (179)

CRM4: Hiding tabs and sections

Hello all,
I am currently working on a small CRM project and one of the requirements was to hide a section and a tab onLoad.
// Hiding the Contract section
crmForm.all.contractid_c.parentElement.parentElement.style.display=’none’;
// Hide the KB article tab (2nd Tab)
crmForm.all.tab1Tab.style.display=’none’;
I’m sure you can use this in other ways (i.e:. onChange, onClick etc..).
Happy Coding!

Leave a Comment

Call/Request a workflow in CRM 4.0 using Javascript

Add a button on Form’s Toolbar/Grid’s Menu Bar for the entity in ISV config file (export ISV config)
Call launchOnDemandWorkflowForm (for button on Form) or launchOnDemandWorkflow (for button on grid) functions and pass the parameters sGrid, iObjType and workflowId.
Save the config file and import it to CRM.

An example of this could be:
<Entity name=”account”>
<ToolBar ValidForCreate=”0″ ValidForUpdate=”1″>
<Button Icon=”/_imgs/mybutton.jpg” [...]

Leave a Comment

Show no. of open or closed activities (history) on the CRM form.

Hello all,
Have you ever wanted to see the total no. of outstanding/completed activities on a Case, Account, Opportunity, Contact etc..?  

Well now you can, simply add the following JavaScript code to the onLoad event of the entity, it will query the webservice and it will give you the exact count of open/closed activities.
Update: 9th March 2010 [...]

Comments (7)

Add custom toolbar buttons to the Case Entity form.

Hi All,
Have you ever wanted to add some toolbar buttons to the CASE/CONTACT/ACCOUNT form?

Well now you can, you can use the ISV.config provided by CRM.

Export the ISV Config Customizations from CRM
Edit the XML file
Find the <entity name=”incident”> node and add the following - I couldn’t paste the XML because of wordpress limitations.

Note: the following are custom images: [...]

Comments (1)

Hiding Sidebar Navigation (Related Entities)

Hi Guys,
Recently for a client, we had to create some many-to-1 relationship from Contact to Accounts & Opportunities.  We then had the problem of the related entity navigation on the side showing up.  They didn’t want to see all these related navigations. I added some onLoad code on the contact form to hide the Sidebar [...]

Comments (1)

lookup field - onchange event

Hi Guys,
I have noticed that sometimes onchange code for a lookup needs some time (1sec) than to run its code.
Heres an example of a 1 second wait (wait until the lookup is populated with the lookup id, name etc):
window.setTimeout(getDetails, 1000);
function getDetails()
{
if(crmForm.all.ownerid.DataValue[0].id != null)
{
[...]

Leave a Comment