<?xml version="1.0" encoding="UTF-8"?>
|
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
|
<fullName>Quotation_request</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")}
|
var foo = function() {
|
var sql;
|
sql = "select id from QuoteIrai__c where Note__c like '%{!Opportunity.Id}%' and QuoteIrai_Status__c = '草案中'";
|
var sqlResult = sforce.connection.query(sql);
|
var records = sqlResult.getArray("records");
|
var size =records.length;
|
if(size > 1){
|
alert("有2个或者2个以上的草案中报价委托,请确认。");
|
}else if(size == 1){
|
var raes = records[0].Id;
|
location.href = "/apex/NewQuoteIrai?id="+ raes+"&tenderid={!Opportunity.Bidding_Project_Name_BidId__c}" ;
|
}else{
|
location.href = "/apex/NewQuoteIrai?oppid={!Opportunity.Id}&oppquoid={!Opportunity.Estimation_Id__c}&tenderid={!Opportunity.Bidding_Project_Name_BidId__c}" ;
|
}
|
}
|
foo();</url>
|
</WebLink>
|