工具提示无法在MS CRM中使用

时间:2010-07-09 07:37:07

标签: dynamics-crm

我想在铅表单上为我的属性提供工具提示。我设置:

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

但它不起作用。为什么不应该这样。这么多博客都喜欢我这个。默认工具提示我能够在标签上看到。请指导

2 个答案:

答案 0 :(得分:0)

您可以在网页上发布实际代码吗?

您需要在代码中引用该属性,例如:

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

此外,它是什么类型的控件,你正在添加工具提示 - 选项列表,文本等?

答案 1 :(得分:0)

我必须写这个作为我问题的答案,因为另一个人可能会遇到这个问题。我通过以下代码解决了这个问题。它工作正常。

// 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);

}