BeforeOPDPDFBtn
online
button
javascript
产品试用评价OPD
onClickJavaScript
false
{!REQUIRESCRIPT("/soap/ajax/51.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/51.0/apex.js")};
{!RequireScript("/resource/CommonUtilJs")};
if (window.confirm('是否新建OPD报告书?\n[确定] => 新建OPD\n[取消] => 只生成 [产品试用评价]')) {
try {
sforce.connection.sessionId = "{!GETSESSIONID()}";
var accid = '{!Opportunity.AccountId}';
var recordType = 'OPD';
var repOwnerId = '{!$User.Id}';
var pdfno = sforce.apex.execute("ControllerUtil", "selectCommonSequence", {valueField: 'EvaluationPDF_NextValue__c', formatField: 'EvaluationPDF_Format__c'});
//新建OPD报告书
// 20220913 ljh WLIG-CHMATN update start
/*var rtn = sforce.apex.execute("Add_Report", "addReportOPWithEvaluationPDF",
{repOwnerId: repOwnerId,
reportId: null,
dailyReportId: null,
eventId: null,
recordType: recordType,
aId: accid,
visitor1: null,
visitor2: null,
visitor3: null,
visitor4: null,
visitor5: null,
opp1: '{!Opportunity.Id}',
opp2: null,
opp3: null,
opp4: null,
opp5: null,
reportDate: null,
evaluationPDFNumber: pdfno
}
);*/
var rtn = sforce.apex.execute("Add_Report", "addReportOPWithEvaluationPDF",
{"repOwnerId": "{!$User.Id}",
"reportId": "",
"dailyReportId": "",
"eventId": "",
"recordType": "OPD",
"aId": accid,
"visitor1": "",
"visitor2": "",
"visitor3": "",
"visitor4": "",
"visitor5": "",
"opp1": "{!Opportunity.Id}",
"opp2": "",
"opp3": "",
"opp4": "",
"opp5": "",
"reportDate": "",
"evaluationPDFNumber": pdfno
}
);
// 20220913 ljh WLIG-CHMATN update end
window.open('/apex/BeforeOPDPDF?oid=' + '{!Opportunity.Id}' + '&pdfNo=' + pdfno, 'BeforeOPDPDF');
} catch(e) {
alert(e);
}
} else {
window.open('/apex/BeforeOPDPDF?oid=' + '{!Opportunity.Id}', 'BeforeOPDPDF');
}