| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>Business_confirmation</fullName> | 
|     <availability>online</availability> | 
|     <displayType>button</displayType> | 
|     <linkType>javascript</linkType> | 
|     <masterLabel>营业担当确认</masterLabel> | 
|     <openType>onClickJavaScript</openType> | 
|     <protected>false</protected> | 
|     <url>{!REQUIRESCRIPT("/soap/ajax/51.0/connection.js")};  | 
| {!REQUIRESCRIPT("/soap/ajax/51.0/apex.js")}; | 
| //2021-10-22 gwy 版本更改为51.0 | 
| var foo = function() { | 
| var agoppId ='{!Agency_Opportunity__c.Id}';  | 
|    if ('{!$Profile.Id}' != '00e10000000xnp2') { | 
|       alert("您不是营业担当,无法确认。"); | 
|       return; | 
|    } | 
|    if ('{!Agency_Opportunity__c.Business_confirmation__c}' == true) { | 
|       alert("询价已经确认,不需要重复确认。"); | 
|       return; | 
|    } | 
|    //wangweipeng     SWAG-C8CCFP      2021/11/02     start | 
|    //未转换原因  字段不能为空,如果为空,此按钮不能把营业担当确认字段设置未true | 
|    /*if('{!Agency_Opportunity__c.No_Convert_Reason__c}' == null || '{!Agency_Opportunity__c.No_Convert_Reason__c}' == ''){ | 
|         alert('必须填写【未转换原因】,才能进行担当确认!'); | 
|         return; | 
|    }*/ | 
|    //wangweipeng     SWAG-C8CCFP      2021/11/02     end | 
|    if (!confirm("请确认是否进行担当确认?")) {  | 
|      return; | 
|    } | 
| try{ | 
|     var rs = sforce.apex.execute("upagencyOppBusinessconfirmation", "Businessconfirmation",{agoppId:agoppId}); | 
|     if(rs == ""){ | 
|         alert('确认成功'); | 
|     }else{ | 
|         alert('确认失败' + rs); | 
|     } | 
| }catch(e){ | 
|     alert(e); | 
| } | 
| window.location.reload(); | 
| }; | 
| foo();</url> | 
| </WebLink> |