| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>OSH_Inspect</fullName> | 
|     <availability>online</availability> | 
|     <displayType>button</displayType> | 
|     <linkType>javascript</linkType> | 
|     <masterLabel>OSH检查受理</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}' != 'OSH检测中') { | 
|     alert("需要先点击[OSH现品收到]"); | 
| } else if ('{!QIS_Report__c.OSHInspectionDate__c}' != '') { | 
|     alert("OSH检测已经受理"); | 
| } else { | 
|     var rac = new sforce.SObject("QIS_Report__c");  | 
|     rac.Id = "{!QIS_Report__c.Id}";  | 
|     var serverTimestamp = sforce.connection.getServerTimestamp();  | 
|     rac.OSHInspectionDate__c = serverTimestamp.timestamp;  | 
|     var result = sforce.connection.update([rac]);  | 
|     var messages = getConnectDMLErrorMessages(result);  | 
|     if (messages.length > 0) {  | 
|         alert(messages.join("\n"));  | 
|     }  | 
|     location.reload(); | 
| }</url> | 
| </WebLink> |