<?xml version="1.0" encoding="UTF-8"?>
|
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
|
<fullName>ReQuote</fullName>
|
<availability>online</availability>
|
<description>从选中的报价Copy出一个新的报价</description>
|
<displayType>massActionButton</displayType>
|
<linkType>javascript</linkType>
|
<masterLabel>再报价</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")}
|
sforce.connection.sessionId = '{!$Api.Session_ID}';
|
var oppid = '{!Opportunity.Id}' ;
|
var result = sforce.connection.describeSObject("Quote");
|
if (result.createable == "false") {
|
alert('没有新建报价的权限。');
|
} else if ('{!Opportunity.Agency_Is_Delete__c}' == "√") {
|
alert('经销商处于无效状态,不能新建报价。');
|
} else if ('{!Opportunity.Account_Is_Active__c}' == "無効") {
|
alert('科室处于无效状态,不能新建报价。');
|
} else if ('{!Opportunity.Hospital_Is_Active__c}' == "無効") {
|
alert('医院处于无效状态,不能新建报价。');
|
} else{
|
if ({!Opportunity.Estimation_Decision__c}==0){
|
var ids = {!GETRECORDIDS( $ObjectType.Quote)};
|
if (ids.length == 1) {
|
if('{!HTMLENCODE(Opportunity.RecordTypeId)}'=='012100000006KMe'){
|
//var setQuote = sforce.apex.execute("ControllerUtil", "setQuote", {oppid:oppid});
|
window.open('/apex/SI_NewQuoteEntry?oppid={!Opportunity.Id}&copyid=' + ids[0], "_blank");
|
|
}else{
|
window.open('/apex/NewQuoteEntry?oppid={!Opportunity.Id}&copyid=' + ids[0], "_blank");
|
}
|
//window.open('/apex/NewQuoteEntry?oppid={!Opportunity.Id}&copyid=' + ids[0], "_blank");
|
} else {
|
alert('请选择一个报价');
|
}
|
} else {
|
alert('{!$Label.Error_Message9}');
|
}
|
}</url>
|
</WebLink>
|