<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>NewOPDButton</fullName> 
 | 
    <availability>online</availability> 
 | 
    <description>新建OPD计划</description> 
 | 
    <displayType>massActionButton</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>新建OPD计划(询价)</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <requireRowSelection>true</requireRowSelection> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")}  
 | 
{!RequireScript("/soap/ajax/51.0/apex.js")}  
 | 
{!RequireScript("/resource/CommonUtilJs")}  
 | 
var toHerf= function (){ 
 | 
    // 20201127 you SFDC-BVQC8H 询价状态不符合条件不允许创建opd计划 
 | 
    var oppstagename ="{!Opportunity.StageName}"; 
 | 
    if(oppstagename=='敗戦' || oppstagename=='削除' || oppstagename=='注残' || oppstagename=='出荷' || oppstagename=='完了'){ 
 | 
      alert('询价状态为:失单、取消、注残、发货、完毕,不允许创建OPD计划'); 
 | 
      return; 
 | 
    } 
 | 
    var url = '/a3E/e?CF00N10000008ps5W={!HTMLENCODE(Opportunity.Name)}'+ 
 | 
              '&CF00N10000008ps5W_lkid={!Opportunity.Id}'+ 
 | 
              '&CF00N10000008ps4x_lkid={!Opportunity.AccountId}'+ 
 | 
              '&CF00N10000008ps4x={!Opportunity.Account}'+ 
 | 
              '&00N10000008ps5X={!HTMLENCODE(Opportunity.Name)}'+ 
 | 
              '&00N100000098amT=询价'+ 
 | 
                          '&Name=*'+ 
 | 
              '&retURL=%2F' + '{!HTMLENCODE(Opportunity.Id)}'; 
 | 
    window.open(url); 
 | 
} 
 | 
toHerf();</url> 
 | 
</WebLink> 
 |