• Bob Poliquin 9
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 9
    Replies
I am trying to allow my community users to see attached files to a custom object. When i log in as the user I see the related list but no files are visible. 

I have made sure this setting is correct on the attached file.

User-added imageUser-added image
I'm not sure what else I need to do
I have a flow wrapped in a lightning component for a global action. 

The flow worked fine in the lightning component but the problem is the flow will run then go back to the start. I want the screen to disppear after the user clicks finish.

hen I added the e.force:closeQuickAction and click the global action the flow screen doesn't really open, but you can see it automatically close to the lower right hand corner of the computer screen. I'm not sure if I need to add something to my code below to only close the screen after the flow finishes but I'm not sure where the issue is with my code. 
 
<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome,force:lightningQuickAction"  >

<aura:handler name="init"  value="{!this}" action="{!c.init}" />
<lightning:flow aura:id="flowData" />
    <br/>
    
</aura:component>
 
({
init : function (component) {
// Find the component whose aura:id is "flowData"
var flow = component.find("flowData");
// In that component, start your flow. Reference the flow’s Unique Name.
flow.startFlow("New_IT_Support_Case");
    
    // Close the action panel
        var dismissActionPanel = $A.get("e.force:closeQuickAction");
        dismissActionPanel.fire();
  },
})

 
I am having an issue with my visualforce pdf code. I'm using a apex:repeat but what is happening is some of the records are spilling over to the next page. How would i fix this so this doesnt happen. Would I add a style tag to my visualforce code or add some type of pagenation code to the apex class. I'm not really sure how to do either. any help would be greatly appreciated
User-added imageApex Code:
public with sharing class VF_PrintBidPDF {

private Account acc;
   public List<Bids_Sent__c> bidsList {get;set;}
   public Map<String,List<Site_Bid_Details__c>>  bidsMap {get;set;}
   public Map<String,List<Site_Bid_Details__c>>  sbidsMap {get;set;}
   public VF_PrintBidPDF(ApexPages.StandardController sc){
       acc = (Account)sc.getRecord();
       bidsList = new List<Bids_Sent__c>();
       bidsList = [SELECT Id,Add_to_Schedule_C__c,Customer__r.Service_Agreement_Verbiage__c,Site__r.Service_Agreement_Verbiage__c,Service_Agreement_Verbiage__c,Awarded_Date__c,Site__r.Customer_Location_ID__c,Service_Year__c,Site__r.Customer_Account__r.Name,Name,
        Site__r.Name,Customer__r.Name,Primary_Contact__r.FirstName,Site__r.BillingCity,Site__r.BillingState,Site__r.BillingStreet,Site__r.BillingPostalCode,Site_Customer_Name__c,Customer_Name__c,Contract_Start_Date__c,Contract_End_Date__c FROM Bids_Sent__c WHERE Awarded__c =: acc.Id AND Add_to_Schedule_C__c=true  ];
    
          Set<Id> bidId = new  Set<Id>();  
    for(Bids_Sent__c bs : bidsList){
       bidId.add(bs.Id);
}
     
          bidsMap = new Map<String,List<Site_Bid_Details__c>> ();
    for(Site_Bid_Details__c bd : [SELECT Id,IsSeasonal__c, Bid_Name__r.Name,Site__c,Contract_Start_Month__c,Site__r.Customer_Location_ID__c,Cost__c,Increment__c,
    Total__c,Price__c,Scope__c,Bid_Name__r.Service_Type__c,Number_of_Months__c,Retainer_Fee__c,Monthly_Payment__c,UOM__c,Month_Start_Number__c,Month_End_Number__c, Contract_End_Year__c,IsConEndYear__c,IsZone__c FROM Site_Bid_Details__c WHERE Bid_Name__c IN : bidId]){
        
      if(bidsMap.containsKey(bd.Bid_Name__r.Name)){
          System.debug('CONTAINS KEY: ' + bd.Bid_Name__r.Name);
          bidsMap.get(bd.Bid_Name__r.Name).add(bd);
    }  
              
      else { 
          System.debug('CREATE: ' + bd.Bid_Name__r.Name);
          bidsMap.put(bd.Bid_Name__r.Name,new List<Site_Bid_Details__c>{bd}); 
           }
           
    }
          sbidsMap = new Map<String,List<Site_Bid_Details__c>> ();
    for(Site_Bid_Details__c sbd : [SELECT Id,IsSeasonal__c, Bid_Name__r.Name,Site__c,Contract_Start_Month__c,Site__r.Customer_Location_ID__c,Cost__c,Customer__r.Contract_Month__c,Increment__c,Total__c,
    Price__c,Scope__c,Bid_Name__r.Service_Type__c,Number_of_Months__c,Retainer_Fee__c,Monthly_Payment__c,UOM__c,Month_Start_Number__c,Month_End_Number__c,Contract_End_Year__c,IsConEndYear__c,IsZone__c   FROM Site_Bid_Details__c WHERE Bid_Name__c IN : bidId AND IsSeasonal__c = true]){
        
      if(sbidsMap.containsKey(sbd.Bid_Name__r.Name)){
          System.debug('CONTAINS KEY: ' + sbd.Bid_Name__r.Name);
          sbidsMap.get(sbd.Bid_Name__r.Name).add(sbd);
    } 
      else { 
           System.debug('CREATE: ' + sbd.Bid_Name__r.Name);
           sbidsMap.put(sbd.Bid_Name__r.Name,new List<Site_Bid_Details__c>{sbd}); 
           }
        } 
    }
    
    public VF_PrintBidPDF(ApexPages.StandardSetController controller) {
    }
    
    public VF_PrintBidPDF(){
       String myGeneratedFileName = 'SalesforceScool.pdf';
       Apexpages.currentPage().getHeaders().put('content-disposition', 'attachment; filename='+myGeneratedFilename); 
    }

}

Snippet of VF Code
<div style="page-break-after:always;">
   
                <apex:repeat var="sd" value="{!bidsList}">
            
    <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif;font-size:10px; text-align:center;"
               cellpadding="0">
               <apex:outputPanel layout="none" rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}" style="vertical-align:central;font-family:Times New Roman, Arial, Helvetica, sans-serif;font-size:10px; text-align:center;width:65%">
                   
                <tr>
                <td colspan="4" style="font-weight:bold ;font-family:Times New Roman; border-style:solid;font-size:10px; border-width:1px;
                border-color:#000000;padding:1px;text-align:center;background-color:#B4C6E7;">SERVICE AGREEMENT DESCRIPTION</td>
                </tr>
                
                <tr>
                <td width="100%" align="left" style="color: #000000;text-align:justify; border-style:solid; border-width:1px;
                border-color:#000000;font-style:normal; font-weight:normal;font-size:10px;padding:1px"><apex:outputPanel rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}"> {!sd.Service_Agreement_Verbiage__c}</apex:outputPanel> </td>
                </tr>
                </apex:outputPanel>
            
            </table>
            
    <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif; font-size:10px;text-align:center;" cellpadding="0">
            
            <tr>
                <td colspan="4" style="font-weight:bold; border-style: solid; border-width:1px;
                border-color:#000000;padding:1px;background-color:#B4C6E7;font-family: Arial, Helvetica, sans-serif;font-size:10px;">
                 SERVICE LOCATIONS AND FEES
                </td>
            </tr>
        
    </table> 
                
    <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif;  text-align:left;"
               cellpadding="4">
          
            <tr>
               
            <td width="100%"  align="center" style="color: #000000;text-align:center; border-style:solid; border-width:1px;
                border-color:#000000;font-style:normal; font-weight:bold;font-size:10px;padding:1px">(Extra) Rates Listed Below **Not to be performed except by Written Request from Case Snow Management**</td>
            </tr>
    </table>
                
           <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif;font-size:10px; text-align:center;"
               cellpadding="0">
              
                 
                <apex:outputPanel layout="none" rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}" style="vertical-align:central;font-family:Times New Roman, Arial, Helvetica, sans-serif;font-size:10px; text-align:center;width:65%">
                   
                    <tr>
                       <td style="text-align:center;background-color:#0000FF;border:1px solid black;font-family:Times New Roman,Arial;font-size:12px;font-weight:bold;color:#ffffff; page-break-after:always" class="auto-style3">Site Name</td>
                        <td style="font-weight: bold;font-family: Times New Roman, Arial;font-size: 12px;border: 1px solid black;color: #ffffff;padding: 1px;text-align: center;background-color: #0000FF;page-break-after: always" class="auto-style3" ><apex:outputPanel rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}"> {!sd.Customer__r.Name }</apex:outputPanel> </td>
                       
                        <td style="text-align:center;background-color:#0000FF;border:1px solid black;font-family:Times New Roman,Arial;font-size:12px;font-weight:bold;color:#ffffff" class="auto-style3">Service Period</td>
                       <td style="font-weight:bold ;font-family:Times New Roman, Arial; font-size:12px;border:1px solid black;
                            color:#ffffff;padding:3px;text-align:center;background-color:#0000FF;page-break-after:always" class="auto-style3" ><apex:outputPanel rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}"> <apex:outputText value="{0, date, MMMM d','  yyyy}">
                        <apex:param value="{!sd.Contract_Start_Date__c}" /> </apex:outputText> - <apex:outputText value="{0, date, MMMM d','  yyyy}"><apex:param value="{!sd.Contract_End_Date__c}" /></apex:outputText>

                </apex:outputPanel></td>

                        <td style="text-align:center;background-color:#0000FF;border:1px solid black;font-family:Times New Roman, Arial;font-size:12px;font-weight:bold;color:#ffffff" class="auto-style3">Address</td>
                       <td style="font-weight:bold ;font-family:Times New Roman, Arial;font-size:12px; border:1px solid black;
                            color:#ffffff;padding:3px;text-align:center;background-color:#0000FF;page-break-after:always" class="auto-style3" ><apex:outputPanel rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}">{!sd.Site__r.BillingStreet}&nbsp;{!sd.Site__r.BillingCity}, {!sd.Site__r.BillingState} {!sd.Site__r.BillingPostalCode} </apex:outputPanel></td>

                    </tr>

                </apex:outputPanel>
               
                       <apex:repeat var="et" value="{!bidsMap[sd.Name] }" rendered="{!IF(sd.Add_to_Schedule_C__c=true  ,true,false)}"    >
    
                    <tr>
                        
                       <td style="text-align:center;background-color:#dce6f1;font-family:Times New Roman, Arial;font-size:10px;font-weight:bold;color:#000000;border:1px solid black;padding-left:7px">Service Type</td>
                       <td style="border: 1px solid black;text-align: center;font-family: Times New Roman,Arial;padding: 1px;" > {!et.Bid_Name__r.Service_Type__c}</td>
                       <td style="text-align:center;background-color:#dce6f1;border:1px solid black;font-family:Times New Roman, Arial;font-size:10px;font-weight:bold;color:#000000;padding:1px">Service Desciption</td>
                       <td style="border:1px solid black;text-align:center;text-align:center;font-family:Times New Roman,Arial;font-size:10px;padding:1px" >{!et.Scope__c}&nbsp;{!et.Increment__c}</td>
                       <td style="text-align:center;background-color:#dce6f1;border:1px solid black;font-family:Times New Roman, Arial;font-size:10px;font-weight:bold;color:#000000;padding:1px">Pricing Schedule</td>
                       <td style="border-bottom:solid;border:1px solid black;text-align:center;text-align:center;font-family:Times New Roman,Arial; font-size:10px" class="ctr"><apex:outputText value="{0, Number, Currency}"><apex:param value="{!et.Cost__c}" /> </apex:outputText></td>
                        
                   </tr>
               </apex:repeat>
               </table>
             </apex:repeat>
            
    <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif;font-size:12px; text-align:center; padding-top:20px"
               cellpadding="0">
        <tr><td style="border:0px solid black;text-align:center;font-family:Times New Roman,Arial;padding:1px; padding-bottom:15px; width:50%">Case Snow Management, Inc.<br />(as "Contractor")</td><td style="border:0px solid black;text-align:center;font-family:Times New Roman,Arial;padding:1px;padding:1px;width:50%;padding-bottom:20px;">{!Account.Name} 
 <br />(as "Subcontractor")</td></tr>

        </table>
    <table align="center" width="100%" style="font-family: Arial, Helvetica, sans-serif;font-size:12px; text-align:left;"
               cellpadding="0">
        <tr>
          <td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;padding:1px;width:25%;" >Signature:</td><td style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:1px;color:#ffffff;width:20%;">\s2\</td><td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;width:25%;">Signature:</td><td style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:5px;color:#ffffff;width:25%;">\s1\</td>
        </tr>
         <tr>
            <td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;padding:1px">Name:</td><td style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:1px;color:#ffffff">\n2\</td><td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;padding:2px" >Name:</td><td  style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:5px;color:#ffffff">\n1\</td>
            
        </tr>
         <tr>
            <td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;padding:1px" >Date:</td><td style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:1px;color:#ffffff">\d2\</td><td style="border:0px solid black;text-align:right;font-family:Times New Roman,Arial;padding:2px" >Date:</td><td style="border:0px solid black;text-align:left;font-family:Times New Roman,Arial;padding:5px;color:#ffffff">\d1\</td>
        </tr>

          </table></div>

​​​​​​​
I am wondering if I can update my apex class to show child records of a child record from the account object.

I have a custom object Bids_Sent__c of an account standard object. The Bids_Sent__c object has a child object  entitled Site_Bid_Details__c. That custom object has a child object entitled Payments__c.  
My Apex Class below is updated to show Account with Bids_Sent__c ad Site_Bid_Detail__c records on my visualforce pdf. But it does not cover the new custom object Payment__c.  I need this to show those child records to show monthly payments if the Site_Bid Detail__c record meets a certain criteria. I'm not sure how to add this to my current class or if this is possible.  

If anyone could help me with this I would greatly appreciate it. 

 
public with sharing class VF_PrintBidPDF {

private Account acc;
   public List<Bids_Sent__c> bidsList {get;set;}
   public Map<String,List<Site_Bid_Details__c>>  bidsMap {get;set;}
   public Map<String,List<Site_Bid_Details__c>>  sbidsMap {get;set;}
   public VF_PrintBidPDF(ApexPages.StandardController sc){
       acc = (Account)sc.getRecord();
       bidsList = new List<Bids_Sent__c>();
       bidsList = [SELECT Id,Add_to_Schedule_C__c,Customer__r.Service_Agreement_Verbiage__c,Site__r.Service_Agreement_Verbiage__c,Service_Agreement_Verbiage__c,Awarded_Date__c,Site__r.Customer_Location_ID__c,Service_Year__c,Site__r.Customer_Account__r.Name,Name,
        Site__r.Name,Customer__r.Name,Primary_Contact__r.FirstName,Site__r.BillingCity,Site__r.BillingState,Site__r.BillingStreet,Site__r.BillingPostalCode,Site_Customer_Name__c,Customer_Name__c,Contract_Start_Date__c,Contract_End_Date__c FROM Bids_Sent__c WHERE Awarded__c =: acc.Id AND Add_to_Schedule_C__c=true  ];
    
          Set<Id> bidId = new  Set<Id>();  
    for(Bids_Sent__c bs : bidsList){
       bidId.add(bs.Id);
}
     
          bidsMap = new Map<String,List<Site_Bid_Details__c>> ();
    for(Site_Bid_Details__c bd : [SELECT Id,IsSeasonal__c, Bid_Name__r.Name,Site__c,Contract_Start_Month__c,Site__r.Customer_Location_ID__c,Cost__c,Increment__c,
    Total__c,Price__c,Scope__c,Bid_Name__r.Service_Type__c,Number_of_Months__c,Retainer_Fee__c,Monthly_Payment__c,UOM__c,Month_Start_Number__c,Month_End_Number__c, Contract_End_Year__c,IsConEndYear__c,IsZone__c FROM Site_Bid_Details__c WHERE Bid_Name__c IN : bidId]){
        
      if(bidsMap.containsKey(bd.Bid_Name__r.Name)){
          System.debug('CONTAINS KEY: ' + bd.Bid_Name__r.Name);
          bidsMap.get(bd.Bid_Name__r.Name).add(bd);
    }  
              
      else { 
          System.debug('CREATE: ' + bd.Bid_Name__r.Name);
          bidsMap.put(bd.Bid_Name__r.Name,new List<Site_Bid_Details__c>{bd}); 
           }
           
    }
          sbidsMap = new Map<String,List<Site_Bid_Details__c>> ();
    for(Site_Bid_Details__c sbd : [SELECT Id,IsSeasonal__c, Bid_Name__r.Name,Site__c,Contract_Start_Month__c,Site__r.Customer_Location_ID__c,Cost__c,Customer__r.Contract_Month__c,Increment__c,Total__c,
    Price__c,Scope__c,Bid_Name__r.Service_Type__c,Number_of_Months__c,Retainer_Fee__c,Monthly_Payment__c,UOM__c,Month_Start_Number__c,Month_End_Number__c,Contract_End_Year__c,IsConEndYear__c,IsZone__c   FROM Site_Bid_Details__c WHERE Bid_Name__c IN : bidId AND IsSeasonal__c = true]){
        
      if(sbidsMap.containsKey(sbd.Bid_Name__r.Name)){
          System.debug('CONTAINS KEY: ' + sbd.Bid_Name__r.Name);
          sbidsMap.get(sbd.Bid_Name__r.Name).add(sbd);
    } 
      else { 
           System.debug('CREATE: ' + sbd.Bid_Name__r.Name);
           sbidsMap.put(sbd.Bid_Name__r.Name,new List<Site_Bid_Details__c>{sbd}); 
           }
        } 
    }
    
    public VF_PrintBidPDF(ApexPages.StandardSetController controller) {
    }
    
    public VF_PrintBidPDF(){
       String myGeneratedFileName = 'SalesforceScool.pdf';
       Apexpages.currentPage().getHeaders().put('content-disposition', 'attachment; filename='+myGeneratedFilename); 
    }

}









 
I am trying to figure out if something is possible. I have a custom object that has a monthly payment field, number of months field, contract start date and end date fields.

what i need to do is display a monthly payment schedule on my visualforce pdf document But i not sure if this can be done. My screen shots below shows what I have built out but it is not dynamic at all.
When the Number of Months changes I need the VF document to display a payment for each month and the month of the payment as above. 

Below is a snippet of my visualforce code, but as I said it is not dynamic. I am looking for a better way to make this dynamic especially with the months btween the start and end contract dates. 

Any help would be greatly appreciated. A better solution earns a gold star 
 
<apex:outputPanel layout="none" rendered="{!IF(sbd.Number_of_Months__c >= 1 && sbd.Contract_Start_Month__c= 1 && sbd.IsSeasonal__c=true  ,true,false)}">
         <tr>
            <td style="font-weight:bold;border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#dce6f1;font-size:10px;font-family:Times New Roman,  Helvetica, sans-serif;">10-Jan-20</td>
                            
                            <td style="font-weight:normal; border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#ffffff;font-size:10px;font-family:Times New Roman,  Helvetica, sans-serif;width:40px"><apex:outputText value="{0, Number, Currency}"><apex:param value="{!sbd.Monthly_Payment__c}" /> </apex:outputText></td>

            <td style="font-weight:normal;border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#ffffff;font-size:10px;font-family:Times New Roman,  Helvetica, sans-serif;"></td>
        </tr>
            </apex:outputPanel>

            <apex:outputPanel layout="none" rendered="{!IF(sbd.Number_of_Months__c >= 2 && sbd.Contract_Start_Month__c= 2 && sbd.IsSeasonal__c=true  ,true,false)}">
        <tr>
            <td style="font-weight:bold ;font-size:10px;font-family: Times New Roman, Arial, Helvetica, sans-serif;border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#dce6f1">10-Feb-20</td>
            <td style="font-weight:normal ;font-size:10px;font-family: Times New Roman, Arial, Helvetica, sans-serif; border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#ffffff"><apex:outputText value="{0, Number, Currency}"><apex:param value="{!sbd.Monthly_Payment__c}" /> </apex:outputText></td>
            <td style="font-weight:normal ;font-size:10px;font-family: Times New Roman, Arial, Helvetica, sans-serif; border:1px solid black;
                            color:#000000;padding:1px;text-align:center;background-color:#ffffff"></td>
        </tr>
            </apex:outputPanel>



 

View of the fields on the record
User-added image
User-added image


   
I am trying to allow my community users to see attached files to a custom object. When i log in as the user I see the related list but no files are visible. 

I have made sure this setting is correct on the attached file.

User-added imageUser-added image
I'm not sure what else I need to do
I have a flow wrapped in a lightning component for a global action. 

The flow worked fine in the lightning component but the problem is the flow will run then go back to the start. I want the screen to disppear after the user clicks finish.

hen I added the e.force:closeQuickAction and click the global action the flow screen doesn't really open, but you can see it automatically close to the lower right hand corner of the computer screen. I'm not sure if I need to add something to my code below to only close the screen after the flow finishes but I'm not sure where the issue is with my code. 
 
<aura:component implements="force:appHostable, flexipage:availableForAllPageTypes, flexipage:availableForRecordHome,force:lightningQuickAction"  >

<aura:handler name="init"  value="{!this}" action="{!c.init}" />
<lightning:flow aura:id="flowData" />
    <br/>
    
</aura:component>
 
({
init : function (component) {
// Find the component whose aura:id is "flowData"
var flow = component.find("flowData");
// In that component, start your flow. Reference the flow’s Unique Name.
flow.startFlow("New_IT_Support_Case");
    
    // Close the action panel
        var dismissActionPanel = $A.get("e.force:closeQuickAction");
        dismissActionPanel.fire();
  },
})