| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>OCSM_Nogoods</fullName> | 
|     <availability>online</availability> | 
|     <displayType>button</displayType> | 
|     <linkType>javascript</linkType> | 
|     <masterLabel>OCSM无实物送达</masterLabel> | 
|     <openType>onClickJavaScript</openType> | 
|     <protected>false</protected> | 
|     <url>{!RequireScript("/soap/ajax/51.0/connection.js")}  | 
| {!RequireScript("/resource/CommonUtilJs")}  | 
| //2021-10-21 gwy 版本更改为51.0 | 
| if ('{!QIS_Report__c.QIS_Status__c}' != 'RC检测申请') {  | 
| alert("OCM服务本部已经收到实物");  | 
| } else {  | 
| //update by rentx 2020-10-23 start  | 
| //if ('{!QIS_Report__c.isAE_Profile__c}' == '' ||'{!QIS_Report__c.MDR_information__c}' == '') { //20200422  | 
| if (('{!QIS_Report__c.isAE_Profile__c}' == '' || '{!QIS_Report__c.isPAE_Profile__c}' == '') && '{!QIS_Report__c.is_CNBuy__c}' != 'true') {  | 
| //uppdate by rentx 2020-10-26 end     | 
|     alert("安全信息未判定,请联系质量法规部");  | 
|     var btns = document.getElementsByName('rc_recieved');  | 
|     for (var i=0; i<btns.length; i++) {  | 
|         btns[i].disabled = true;  | 
|         btns[i].className = 'btnDisabled';  | 
|     }  | 
| } else {  | 
| var rac = new sforce.SObject("QIS_Report__c");  | 
| rac.Id = "{!QIS_Report__c.Id}";  | 
| rac.QIS_Status__c = "RC检测中";  | 
| var serverTimestamp = sforce.connection.getServerTimestamp();  | 
| rac.OCM_RC_RecievedDate__c = serverTimestamp.timestamp;  | 
| rac.RC__c = "{!$User.Id}";  | 
| rac.RC_Receive_staff__c = "{!$User.Alias}";  | 
| var resultSet = sforce.connection.query("SELECT Id, BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = '{!$User.Id}'");  | 
| var records = resultSet.getArray("records");  | 
| if (records != null && records.length > 0 && records[0].BuchangApprovalManagerSales__c!= null) {  | 
| rac.RC_Manager__c = records[0].BuchangApprovalManagerSales__c;  | 
| } else {  | 
| rac.RC_Manager__c = "{!$User.Id}";  | 
| }  | 
| rac.CDS_date__c = serverTimestamp.timestamp;  | 
| rac.RC_CDS_staff__c = "{!$User.Alias__c}";  | 
| rac.OCSM_Nogoods__c = true;  | 
| var result = sforce.connection.update([rac]);  | 
| var messages = getConnectDMLErrorMessages(result);  | 
| if (messages.length > 0) {  | 
| alert(messages.join("\n"));  | 
| }  | 
| location.reload();  | 
| }  | 
| }</url> | 
| </WebLink> |