| <?xml version="1.0" encoding="UTF-8"?> | 
| <WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>Reapply</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")} | 
| {!RequireScript("/resource/CommonUtilJs")} | 
| //2021-10-21 gwy 版本更改为51.0 | 
| var toHerf= function (){ | 
| //状态 | 
| var status = "{!OPDPlan__c.Status__c}"; | 
| //取消延期理由 | 
| var dr = "{!OPDPlan__c.DelayCancel_Reason__c}"; | 
| var Opportunity1_ID = "{!OPDPlan__c.Related_Opportunity1_ID__c}"; | 
| alert(status ); | 
| alert(dr ); | 
| if(status != '取消' || dr != '备品不足' ){ | 
|    alert("只有OPD计划状态为取消,并且延期取消理由为备品不足时才能再申请OPD计划"); | 
|    return; | 
| } | 
|   | 
| var resultSet = sforce.connection.query("SELECT Id, Name,Reapply__c FROM OPDPlan__c WHERE Reapply__c = true AND OriginalOpdPlan__c = '{!OPDPlan__c.Id}'"); | 
| var records = resultSet.getArray("records"); | 
| if(records != null && records.length > 0){ | 
| alert('OPD计划已进行过再申请,无法再次进行再申请'); | 
| return; | 
| } | 
|   | 
| var url = '/a3E/e?CF00N10000008ps4x_lkid={!OPDPlan__c.Account_LaboratoryId__c}'+ | 
| '&CF00N10000008ps4x={!HTMLENCODE(OPDPlan__c.Account_Laboratory__c)}'+ | 
| '&00N100000098amT={!HTMLENCODE(TEXT(OPDPlan__c.OPDType__c))}' + | 
| '&00N100000098x8w={!HTMLENCODE(TEXT(OPDPlan__c.RentalReson__c))}' + | 
| '&CF00N10000009EGnM_lkid={!OPDPlan__c.Id}' + | 
| '&CF00N10000009EGnM={!HTMLENCODE(OPDPlan__c.Name)}' + | 
| '&CF00N10000008ps5W_lkid={!OPDPlan__c.Related_Opportunity1_IDId__c}' + | 
| '&CF00N10000008ps5W={!HTMLENCODE(OPDPlan__c.Related_Opportunity1_ID__c)}' + | 
| '&CF00N100000098x8r_lkid={!OPDPlan__c.CorrespondingRepairNoId__c}' + | 
| '&CF00N100000098x8r={!HTMLENCODE(OPDPlan__c.CorrespondingRepairNo__c)}' + | 
| '&CF00N10000009EFWn_lkid={!OPDPlan__c.AdditionalSupportId__c}' + | 
| '&CF00N10000009EFWn={!HTMLENCODE(OPDPlan__c.AdditionalSupport__c)}' + | 
| '&CF00N10000008ps52_lkid={!OPDPlan__c.CampaignId__c}' + | 
| '&CF00N10000008ps52={!HTMLENCODE(OPDPlan__c.CampaignId__c)}' + | 
| '&00N100000098amS={!HTMLENCODE(TEXT(OPDPlan__c.NoOpp_Reason__c))}' + | 
| // 增加模型出借带值 精琢技术 wql  2021/04/19  start | 
| '&CF00N10000009EK7X_lkid={!HTMLENCODE(OPDPlan__c.ModelLendingId__c)}' + | 
| '&CF00N10000009EK7X={!HTMLENCODE(OPDPlan__c.ModelLending__c)}' + | 
| '&CF00N10000009EK7W_lkid={!HTMLENCODE(OPDPlan__c.ModelLendingProductId__c)}' + | 
| '&CF00N10000009EK7W={!HTMLENCODE(OPDPlan__c.ModelLendingProduct__c)}' + | 
| // 增加模型出借带值 精琢技术 wql  2021/04/19 end | 
| '&00N100000098amU={!HTMLENCODE(OPDPlan__c.PlanProdDetail__c)}'; | 
| window.open(url); | 
|   | 
| } | 
|   | 
| toHerf();</url> | 
| </WebLink> |