首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >工具提示在MS CRM中不起作用

工具提示在MS CRM中不起作用
EN

Stack Overflow用户
提问于 2010-07-09 15:37:07
回答 2查看 556关注 0票数 0

我想在lead表单上给我的属性提供工具提示。我设置了:

代码语言:javascript
复制
crmForm.all.my_custom_attribute_c.title="My required tooltip";

但它不起作用。为什么不应该这样呢。所以很多博客更喜欢我这样。我可以在标签上看到默认的工具提示。请指点

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-07-27 16:38:29

我必须写这篇文章来回答我的问题,因为另一个人可能会遇到这个问题。我通过下面的代码解决了这个问题。它工作得很好。

代码语言:javascript
复制
// 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);

}
票数 0
EN

Stack Overflow用户

发布于 2010-07-12 17:26:54

你能从你的页面上张贴实际的代码吗?

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

代码语言:javascript
复制
crmForm.all.ATTRIBUTE_NAME_c.title="My required tooltip";

另外,添加工具提示的是哪种类型的控件-选择列表、文本等?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3210682

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档