• George Laird 39
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Does anyone know how to edit the fields that show up on the product selection screen?
User-added image
Hello All,
I've got a custom object named POV and I'm taking a weekly analytic snapshot of where the stage was at the snapshot time.  I'm also assigning a number value to each stage via formula field.  When i create a matric report i can see each week the snapshot was taken and the value of the formula field.  I basically want to look at the last time the snapshot was taken (the previous row) and if the stage number got larger, that means the stage moved forward!  So, in this case i can return a 1 if it moved forward and a 0 if it moved backwards or stayed the same. 

I'm not having luck with this formula. I'm trying to use PREVGROUPVAL, but it's looking at the record previous even if it's for a different record.  

So in the screen shot below, how would i write a report formula to say, in this example, "If the sum of stage counter for week 7/19 is greater than that of 7/12 for that given POVID, return 1, otherwise return 0?



User-added image


Thanks in advance!

George
Can someone help me with a report formula?  How can I get a net of the PAYMENT - REFUND for each payment type?   



User-added image
Hello All,

As you probably know, there is no way to run a report in Salesforce to show all files related to an object.  My client wants to run a report of all files that were uploaded to a custom object called POC__C.  They also want a link to the file directly in the report.  Ok, so I found a way to do this by making a custom object called FilesCopyCat__c.  This object doesn't hold files, just a link to them with a link to the related POC__record.  It works great!  I got the report I need by running a report type of POC's with Opporutnities and Files.  Since POCs are also realted to Opptys, I can run a report with the Oppty, then the POC, and get a list of all files with a link!  

BUT...how can I make this work with ALL objects, not just POC__C??  Please take a look at my trigger here and let me know if you have a way to make this work on all objects?  

Keep in mind, I have a field on this new FilesCopyCat object called "Related POC__c record."   I would want to replace this with just "related record." Or something.  This is where I need help. 



trigger FilesTrigger3 on ContentDocumentLink (after insert) {
    
    List<Files_CopyCat__c> ccs = new List<Files_CopyCat__c>();
    
    for (POC__c o: [SELECT Name, (SELECT ContentDocumentId, ContentDocument.Title, ContentDocument.ContentSize,ContentDocument.FileType 
                                  FROM ContentDocumentLinks 
                                  WHERE id IN: Trigger.new) 
                    FROM POC__c]) {
                        
                        for (ContentDocumentLink cdl: o.ContentDocumentLinks) {
                            
                            System.debug('Linked Document Id: ' + cdl.ContentDocumentId);
                            System.debug('Linked Document Title: ' + cdl.ContentDocument.Title);
                            System.debug('Linked Document Size: ' + cdl.ContentDocument.ContentSize);
                            
                            
                            Files_CopyCat__c f = new Files_CopyCat__c();
                            
                            f.Name = cdl.ContentDocument.Title;
                            f.File_Id__c = cdl.ContentDocumentId;
                            f.Related_POC__c = o.id;
                            f.File_Type__c = cdl.ContentDocument.FileType;
                            f.Link_To_File__c = URL.getSalesforceBaseUrl().toExternalForm() + '/' + cdl.ContentDocumentId;
                            
                            ccs.add(f);    
                            
                        }
                        
                        try{
                            insert ccs;    
                        } catch(DmlException e) {
                            system.debug('The following exception has occurred: ' + e.getMessage());
                        }
                        
                    }
}
I'm trying to create a class based on files, which is ContentDocument object.  I'm trying to create a map where the key is the ID of the ContentDocument and the value is a list of LinkedEntityId that are related to the key.  

I'm not sure how to do this.  I took a shot here but I don't think it's correct.  

I'm thinking that the key is correct, but I don't know how to get the values for each key.  Each key will have a few Ids for the value. 


***I'm passing a list called 'docs' from a trigger.  The list is essentially all of the docs that were passed from trigger.new


  public static void ProcessFiles(List<ContentDocument> docs){
        
Map<Id,List<ContentDocumentLink>> FilesMap = New Map<Id,List<ContentDocumentLink>>();
 
List<ContentDocumentLink> l = [SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId IN : docs];


 
        for(ContentDocument c : docs){
            FilesMap.put(c.Id,l);
                
        }
        
    }  



Any help would be awesome!
Can someone help me with a report formula?  How can I get a net of the PAYMENT - REFUND for each payment type?   



User-added image
Can someone help me with a report formula?  How can I get a net of the PAYMENT - REFUND for each payment type?   



User-added image
I'm trying to create a class based on files, which is ContentDocument object.  I'm trying to create a map where the key is the ID of the ContentDocument and the value is a list of LinkedEntityId that are related to the key.  

I'm not sure how to do this.  I took a shot here but I don't think it's correct.  

I'm thinking that the key is correct, but I don't know how to get the values for each key.  Each key will have a few Ids for the value. 


***I'm passing a list called 'docs' from a trigger.  The list is essentially all of the docs that were passed from trigger.new


  public static void ProcessFiles(List<ContentDocument> docs){
        
Map<Id,List<ContentDocumentLink>> FilesMap = New Map<Id,List<ContentDocumentLink>>();
 
List<ContentDocumentLink> l = [SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId IN : docs];


 
        for(ContentDocument c : docs){
            FilesMap.put(c.Id,l);
                
        }
        
    }  



Any help would be awesome!