<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Download</fullName>
    <availability>online</availability>
    <displayType>button</displayType>
    <linkType>javascript</linkType>
    <masterLabel>Download</masterLabel>
    <openType>onClickJavaScript</openType>
    <protected>false</protected>
    <url>if ({!Export__c.Is_ready_to_download__c} == true &amp;&amp; {!Export__c.Is_Already_Downloaded__c} == false &amp;&amp; {!Export__c.Is_Approval_Email_Uploaded__c} == true) {
window.location = &apos;apex/ExportDownloadPage?ParentId={!Export__c.Id}&apos;;
} else if ({!Export__c.Is_ready_to_download__c} == true &amp;&amp;{!Export__c.Is_Already_Downloaded__c} == true &amp;&amp; {!Export__c.Is_Approval_Email_Uploaded__c} == true){
alert(&apos;File has already been downloaded. Please create a new export.&apos;);
} else if({!Export__c.Is_ready_to_download__c} == false &amp;&amp; {!Export__c.Is_Already_Downloaded__c} == false &amp;&amp; {!Export__c.Is_Approval_Email_Uploaded__c} == false &amp;&amp; !{!ISPICKVAL(Export__c.Export_Type__c,&apos;AE Export&apos;)}){
alert(&apos;Export is in progress and not ready to download. Please try after sometime.&apos;);
} else if({!Export__c.Is_ready_to_download__c} == true &amp;&amp; {!Export__c.Is_Already_Downloaded__c} == false &amp;&amp; {!Export__c.Is_Approval_Email_Uploaded__c} == false){
alert(&apos;Please upload the approval email in pdf format to proceed with the download.&apos;);
}else if({!ISPICKVAL(Export__c.Export_Type__c,&apos;AE Export&apos;)}){
alert(&apos;There is no data to download for AE Export.&apos;);
}</url>
</WebLink>
