涂煌豪
2022-05-06 ff435968945d457f9ee653a9620fa1c7d78d2d4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Copy2AgencyContact</fullName>
    <availability>online</availability>
    <description>&amp;common.udd.actions.ActionsUtilORIG_URI=%2Fa2QN0000000csrt%2Fe</description>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>复制</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>{!REQUIRESCRIPT(&quot;/soap/ajax/51.0/connection.js&quot;)}; 
{!REQUIRESCRIPT(&quot;/soap/ajax/51.0/apex.js&quot;)};
//2021-10-21 gwy 版本更改为51.0
var doubleFlg = false;
if(!doubleFlg) {
    doubleFlg = true;
    var query = &quot;Select EntityDefinition.KeyPrefix, DurableId From FieldDefinition WHERE EntityDefinition.QualifiedApiName = &apos;Agency_Contact__c&apos; and QualifiedApiName= &apos;Agency_Hospital__c&apos; &quot;; 
    var records = sforce.connection.query(query).getArray(&apos;records&apos;); 
    var fid = records[0].DurableId.toString().split(&apos;.&apos;)[1];
    window.open(&quot;/{!Agency_Contact__c.Id}/e?clone=1&amp;retURL=%2F{!Agency_Contact__c.Id}&amp;CF&quot;+fid+&quot;={!URLENCODE(Agency_Contact__c.Hospital_Name__c)}&quot;);
}</url>
</WebLink>