| | |
| | | <openType>onClickJavaScript</openType> |
| | | <protected>false</protected> |
| | | <requireRowSelection>true</requireRowSelection> |
| | | <url>windows.location</url> |
| | | <url>{!RequireScript("/soap/ajax/51.0/connection.js")} |
| | | {!RequireScript("/soap/ajax/51.0/apex.js")} |
| | | var records = {!GETRECORDIDS($ObjectType.FileAddress__c)}; |
| | | var retURL = '{! $ObjectType.FileAddress__c}'; |
| | | if (records[0] == null) { |
| | | alert('请至少选择一条数据。'); |
| | | } else { |
| | | if (confirm('确定要删除这' + records.length + '条数据吗?')) { |
| | | var recordsSql = ''; |
| | | for (var i = 0; i < records.length; i++) { |
| | | recordsSql += ',\'' + records[i] + '\''; |
| | | } |
| | | recordsSql = recordsSql.substring(1); |
| | | console.log('recordsSql = ' + recordsSql); |
| | | debugger |
| | | var r = sforce.connection.query("select id,AWS_File_Key__c from FileAddress__c where id in (" + recordsSql + |
| | | ")"); |
| | | var keyList = []; |
| | | if (r.getArray("records").length > 0) { |
| | | var recordsObj = r.getArray("records"); |
| | | for (var i = 0; i < recordsObj.length; i++) { |
| | | keyList.push(recordsObj[i].AWS_File_Key__c); |
| | | } |
| | | console.log('keyList = ' + keyList); |
| | | } |
| | | //删除SF附件 |
| | | var rtn1 = sforce.apex.execute("FileBatchDeleteController", "fileSFDelete", { |
| | | idList: records |
| | | }); |
| | | console.log('rtn1 = ' + rtn1); |
| | | if (rtn1 == 'success') { |
| | | //删除AWS附件 |
| | | //var rtn2 = sforce.apex.execute("FileBatchDeleteController", "fileAWSDelete", { |
| | | //keyList: keyList |
| | | //}); |
| | | //console.log('rtn2 = ' + rtn2); |
| | | location.reload(); |
| | | } |
| | | } |
| | | }</url> |
| | | </WebLink> |