ReQuote
online
从选中的报价Copy出一个新的报价
massActionButton
javascript
再报价
onClickJavaScript
false
true
{!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}©id=' + ids[0], "_blank");
}else{
window.open('/apex/NewQuoteEntry?oppid={!Opportunity.Id}©id=' + ids[0], "_blank");
}
//window.open('/apex/NewQuoteEntry?oppid={!Opportunity.Id}©id=' + ids[0], "_blank");
} else {
alert('请选择一个报价');
}
} else {
alert('{!$Label.Error_Message9}');
}
}