tags:

views:

15

answers:

2

I want to give tooltip on my attribute on lead form. I set:

crmForm.all.my_custom_attribute_c.title="My required tooltip";

but it is not working. Why should not this. so many blogs prefer me this. default tooltips I can able to see on labels. please guide

A: 

Could you post the actual code from your page?

You need to reference the attribute in your code, for example:

crmForm.all.ATTRIBUTE_NAME_c.title="My required tooltip";

Also, what type of control is it, that you're adding a tooltip to - picklist, text, etc?

ABC123
A: 

I must write this as a answer to my question, because another may get this issue. I solved this issue by following code. It is working fine.

// It is a good idea to define the variables at the beginning of each event. // This allows you to include conditional statements using the crmForm.FormType property.

var CRM_FORM_TYPE_CREATE = 1; var CRM_FORM_TYPE_UPDATE = 2; var CRM_FORM_TYPE_READ_ONLY = 3; var CRM_FORM_TYPE_DISABLED = 4; var CRM_FORM_TYPE_QUICK_CREATE = 5; var CRM_FORM_TYPE_BULK_EDIT = 6;

var oField=crmForm.all.new_projectstatus;

//Only create the pop-up message if the user can edit or update the form. //Do not show the pop-up message in the Quick Create form.

switch (crmForm.FormType) { case CRM_FORM_TYPE_CREATE : case CRM_FORM_TYPE_UPDATE : case CRM_FORM_TYPE_BULK_EDIT :

//Create a single popup object on the form that can be re-used by // different functions or events in the form.

   var oPopup = window.createPopup();
   var oPopupBody = oPopup.document.body;
   var width = 250;
   var height = 0;
   var strInnerHtml=null;

   oPopupBody.style.backgroundColor = '#FFFFE8';
   oPopupBody.style.fontFamily = 'Arial';
   oPopupBody.style.border = '1px solid black';
   oPopupBody.style.fontSize='11px'; 
   oPopupBody.style.color='#000000';

//Create the function that will be attached to the field mouseover event.

   function Show_Tooltip ()
   {

//Get the selected datavalue var selectedFieldValue=oField.DataValue;

// Set the message HTML as per the selected value. if(selectedFieldValue==1) { strInnerHtml="Have made contact with someone from the company regarding"; strInnerHtml= strInnerHtml+"this scope of work. value or dates may not be available."; height = 50; } else if(selectedFieldValue==2) { strInnerHtml= "FO have put forward a proposal (proactive or reactive)to the";
strInnerHtml= strInnerHtml+"client. Waiting on response"; height = 35; } else if(selectedFieldValue==3) { strInnerHtml = "Official expression of interest for a clearly defined scope of work has been"; strInnerHtml= strInnerHtml+"sent to the client"; height = 38; } else if(selectedFieldValue==4) { strInnerHtml = "Post proposal/ EOI Discussions with customer. Dates & Value should be"; strInnerHtml= strInnerHtml+"known & added to the CRM."; height = 48; } else if(selectedFieldValue==5) { strInnerHtml = "Project has been put on hold by the customer. Estimated date of re-";
strInnerHtml= strInnerHtml+"instatement or reminder for follow–up should be put into the";
strInnerHtml= strInnerHtml+"CRM"; height = 50; } else if(selectedFieldValue==6) { strInnerHtml = "FO has been requested to submit an official Quote/Tender for the scope of"; strInnerHtml= strInnerHtml+"work. Please convert this OPPORTUNITY to QUOTE/TENDER"; height = 52; }

// Set the location and size of the pop-up message. // The x and y coordinates are relative to the form element.

          var x_coord = -80;
          var y_coord = 20;              

// Associate the pop-up message with the element where the event occurred. var documentElement = event.srcElement;

// Show the pop-up message. oPopupBody.innerHTML = strInnerHtml; oPopup.show(x_coord, y_coord, width, height, documentElement); }

// Attach the onmouseover,onkeydown,onkeyup events to the field and the function. // It is important that this be done in script after the function is defined.

crmForm.all.new_projectstatus.attachEvent('onmouseover', Show_Tooltip); crmForm.all.new_projectstatus.attachEvent('onkeydown', Show_Tooltip); crmForm.all.new_projectstatus.attachEvent('onkeyup', Show_Tooltip);

}

Lalit
Sorry, may be it will not looks formatted. Please copy and paste in proper editor. it is too useful.
Lalit