• Rachit Joshi
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I found this link https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html to download multiple files as .zip from ContentVersion.

Can we use /sfc/servlet.shepherd/version/download/ to download multiple files?
Since this is not documented in any of the salesforce docs.
I am not able to complete my Lightning App Builder trailhead since I am not able to install the custom lightning compenent provided in the trailhead named as 'Opp Alert Component'. I am gettting the following error:
leadtriggernew.null()line 236, column 30: Dependent class is invalid and needs recompilation: Class ObjectHandler : Method does not exist or incorrect signature: void isRunningTest() from the type Test null.

The link for installing th app is given below:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tj0000001mMYP
What should i do to install the app?
 
I am trying to save opportunity fields using a controller.

But I am not able to save it.

Hers's the Controller:
public class APPSWeeklyReview {


public List<Opportunity> OppList {get;set;}
public String usrId {get;set;}
public List<User> users { get; set; }
public String accid { get; set; }
/*public List<Opportunity> ListOpps = new List<Opportunity> ();*/
public List<OpportunityWrapper> OppWrap {get;set;}
/*public Opportunity opportunities {get;set;}*/

/*
NEXT STEPS: 
Now we have to Leverage the new lists : ListOpps && OppWrap to Update the opportunities on the page and also load the new page. 

*/
public APPSWeeklyReview() {
    OppList = new List<Opportunity>();
    OppWrap = new List<OpportunityWrapper>();     
}

public class OpportunityWrapper {
    public Opportunity op {get;set;}
    public OpportunityWrapper(Opportunity o){
        op = o;
    }
}


public List<OpportunityWrapper> getOpportunityList(){
    if(OppList == null){
        OppList = setOpps.getRecords();
        for(Opportunity op: OppList){
            OppWrap.add(new OpportunityWrapper(op));
        }
    }
    return OppWrap;
}


public ApexPages.StandardSetController setOpps {
    get{
       setOpps = new ApexPages.StandardSetController(Database.getQueryLocator([select  Name,AccountId,StageName,Owner.Name,Amount,Id,OwnerId from Opportunity where  OwnerId =:usrid limit 1]));

       return setOpps;
    }
    set;
}

public List<Opportunity> getOpps() {

    return (List<Opportunity>) setOpps.getRecords();
}

public ApexPages.StandardSetController setUsrs {
    get{

           setUsrs = new ApexPages.StandardSetController(Database.getQueryLocator([select Name from User where IsActive = true order by FirstName limit  20000]));

       dashDetails(); 
       return setUsrs;
    }
    set;  
}

public List<User> getUsr () {
    return (List<User>) setUsrs.getRecords();
}

public List<SelectOption> getItems() {
        List<selectOption> options = new List<selectOption>();
        users = (List<User>) setUsrs.getRecords();
        for (User u: users){
            options.add(new SelectOption(u.Id,u.Name));
        }
        dashDetails(); 
        return options;
    }




public PageReference save() {
    List<Opportunity> OppList = New List<Opportunity>();
    //Loop through OppList
     for(OpportunityWrapper op: OppWrap){ 

          System.Debug (op.op.Name);
          OppList.add(op.op); 
      }
    update OppList ;
    /*  return dashDetails();*/
   PageReference updatedPage = Page.APPSOppReview;
    updatedPage.setRedirect(true);
    return updatedPage;
}   

public PageReference dashDetails() {
    system.debug('--------'+usrid);
    OppList = (List<Opportunity>) setOpps.getRecords();
     OppWrap = new List<OpportunityWrapper>();
        for(Opportunity op: OppList){
            OppWrap.add(new OpportunityWrapper(op));
        }
    return null;
}  
}

Here's the Visualforce page:
<apex:page sidebar="false" showHeader="false" controller="APPSWeeklyReview" > 
    <apex:form > 
        <apex:pageBlock title="{!MID(TEXT(NOW()-5/24 ),11,9)} (GMT) {!$User.FirstName} {!$User.LastName} is Viewing Opportunities" mode="edit" id="WeeklyReview">
         <apex:outputpanel >
        <html>
            <head>
                <style>
                    .col:nth-child(even){
                    background-color: #f2f2f2;
                    }        
                    .scrollit {
                    overflow:scroll;
                    height:100%;
                    }
                    .col{
                        width: 100%;
                    }
                    .slis{
                    height: 100%;
                    }      
                </style>
            </head>
        </html>
    </apex:outputpanel> 
    <apex:outputLabel value="Owner Selection:  " ></apex:outputLabel>
    <apex:selectList id="accts" value="{!usrId}" size="1" title="Account" enabledClass="slis">
        <apex:selectOptions value="{!Items}"/>
        <apex:actionSupport event="onchange" reRender="WeeklyReview"  action="{!dashDetails}" status="actStatusId">
            <apex:param name="myParam" value="{!accid}" />
        </apex:actionSupport>  
    </apex:selectList>
    <apex:pageBlockButtons location="both" >
            <apex:commandButton action="{!save}" value="Save" />            
    </apex:pageBlockButtons>
    <apex:pageblockSection columns="1" >
        <apex:pageBlockSectionItem >
   <apex:pageBlockTable value="{!OpportunityList}" var="op"  rowClasses="col" id="subCat" >
            <apex:column headerValue="Opportunity Name"  ><apex:outputLink value="/{!op.op.Id}">{!op.op.Name}</apex:outputLink></apex:column>
            <apex:column headerValue="StageName" > <apex:inputField value="{!op.op.StageName}"/></apex:column>          
    </apex:pageBlockTable> 
    </apex:pageBlockSectionItem>
    </apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>

 
I found this link https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html to download multiple files as .zip from ContentVersion.

Can we use /sfc/servlet.shepherd/version/download/ to download multiple files?
Since this is not documented in any of the salesforce docs.