• Emily Phillips
  • NEWBIE
  • 40 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 14
    Questions
  • 13
    Replies
I have a scheduled flow that uses an apex action to use a simple invocable method. I'm simply passing the record Id from the flow to the apex class and deleting permission set assignments. The scheduled flow and class are able to process 300 records in a full copy sandbox environment but running into Apex CPU time limit exceeded in Production for about 100 records. 

Why is the same flow and class running into this error in production but not sandbox? 
Hello, I'm using a trigger (before insert) and trigger handler to check for duplicates on a custom object. There can only be 1 custom object record with the Status of 'Open' per Opportunity Line Item. I've used the addError method to display an error to the user if they try to add another custom object record with the status of 'Open'. The trigger works great if I'm inserting just 1 record and my error message displays correctly. However, if I insert a list of records through the Execute Anonymous window where 1 record meets the error condition and other records are valid, none of the records are inserted. I understand the addError method stops the operation but I'm not sure how to insert the valid records while preventing the duplicate. Any help is appreciated!
 
Test code: 

public class DuplicateTriggerHandler{
    
    public static void checkForDuplicate(List<Custom_Object__c> coList){
        
        Set<Id> oliId = new Set<Id>();
        for(Custom_Object__c co : coList){
            oliId.add(co.Opportunity_Line_Item__c);
            System.debug('co.Opportunity_Line_Item__c: ' + co.Opportunity_Line_Item__c);
        }
        
        List< Custom_Object__c > coList2 = [Select Id from Custom_Object__c where Opportunity_Line_Item__c in: oliId and Status__c = 'Open'];
        System.debug(' coList2:' + coList2);
        
        for(Custom_Object__c co : coList){
            if(co.Status__c == 'Open' && coList2.size() > 0){
                co.addError('Error: You cannot have more than one Custom Object Record with the status of Open.');
            } 
        }
    }
}

 
I'm trying to assign the value from a map to an opportunity field. There isn't a relationship between the two objects: Opportunity and Custom_Object_1__c. Any help is appreciated!
 
public static void mapDemo(List<Opportunity> oppList){
        
        Set<Id> userSet = new Set<Id>();
        
        for(Opportunity opp: oppList){
            userSet.add(opp.CreatedById);
            userSet.add(opp.OwnerId);
        }
        
        Map<Id, Id> mapCustomObject = new Map<Id, Id>();
        
        List<Custom_Object_1__c> co1List = [SELECT Id, Special__c, User__c FROM Custom_Object_1__c WHERE User__c IN :userSet];
        
        for(Custom_Object_1__c co1 : co1List){
            mapCustomObject.put(co1.User__c, co1.Special__c);
        }
        System.debug('mapCustomObject: ' + mapCustomObject);
        for(Opportunity opp: oppList){
            opp.Test_Field__c = mapCustomObject.get(); /* assign Special__c here */
        }
    }

 
Hello! I'm trying to add a progress ring to an aura component. I'd like the progress ring to adjust based on a picklist value on a custom object. For instance, if the picklist value on the record of the custom object is "4", I'd like the progress ring to have a value of 40% complete. Any help is appreciated!
Hi All, 

I have implemented a custom Finish button in a flow based on this post: https://success.salesforce.com/answers?id=9063A000000pzeEQAQ

My flow updates a record's Record Type and subsequently the page layout associated with the updated Record Type. The Finish button returns me to the record, the correct Record Type is selected and everything on the page layout is showing properly except for the buttons. For some reason, the buttons are displayed according to the previous page layout. This seems like a caching issue? Any ideas as to why the buttons aren't updating? 

Thank you!
I have a custom button on a page layout that is linked to a flow. I've added the retURL parameter to the flow link in order to return back to the record wherein the flow was initiated. The record is not being refreshed once the flow is complete. I have to manually refresh the record in order to see the changes made by the flow. Is there a way to automatically refresh a record once a flow has finished? I'm using the Lightning, not Classic. Thank you!
How can I remove the phone icon from page layouts? 

Here is the icon: phone icon

Thank you!
Hello! I'm displaying a number formula field on a Visualforce page using apex:outputField. The formula field calculates a "score" for our Contact records. The formula adds a point if certain fields are not null on a record. I've added the Visualforce page to a Lightning Page using the Visualforce standard component. 

Here's my issue: The number formula field doesn't refresh or recalculate when I update fields in the Details section on the Lightning page. How can I refresh the formula field without having to refresh the entire page everytime I make a change to a record? 

Any help is appreciated!
Hello everyone, 

Is it possible to connect Salesforce to LinkedIn and display a LinkedIn user's profile photo on a Contact record? How can this be achieved? 

Any help is appreciated!
I've added Visualforce pages to a Lightning Record Page through the Lightning App Builder and was wondering how to make the Visualforce Component scale as content is added or removed to/from the Visualforce page. Currently, I can set a fixed height on the component but I need the component height to be responsive to its content. Any help is appreciated. 

Visualforce Component
Component Settings
Hello, I'm trying to reference specific fields from two different Account record types on one custom object record. Basically, two Accounts have data we'd like to display on one custom object record. Account Record Type A has data we need, as does Account Record Type B. I've created formula fields on the custom object to pull in Account fields, however, only Account Record Type A fields are being pulled in. My formula fields are simply "Account__r.Field_Name__c".

I should also add that I've successfully create two lookup fields for Account Record Type A and Accound Record Type B on the custom object. 

Is there a way to display data on a custom object record from a specific Account record type? 
I'm trying to add the lead conversion button to a Visualforce page and stumbled across this URL hack: "/lead/leadconvert.jsp?nooppti=1&tsk5_fu='Contact New Lead: {!Lead.LastName}&tsk4_fu={!Today}&id={!Lead.Id}&RetURL=/{!Lead.Id}"

The link opens the convert page in Classic UI but I'm looking to open the page in the Lightning UI. How can I make the convert page open in Lightning UI? Thank you!!
I've created a visualforce page for the standard lead object and need to add the standard convert lead button to the page. I'm not looking to create any cusom features for the conversion process, just straight out-of-the-box sfdc. How can I add the standard convert button to my visualforce page? Thank you!!
Is it possible to increase or decrease the field height in a Flow? 
I have a scheduled flow that uses an apex action to use a simple invocable method. I'm simply passing the record Id from the flow to the apex class and deleting permission set assignments. The scheduled flow and class are able to process 300 records in a full copy sandbox environment but running into Apex CPU time limit exceeded in Production for about 100 records. 

Why is the same flow and class running into this error in production but not sandbox? 
Hello, I'm using a trigger (before insert) and trigger handler to check for duplicates on a custom object. There can only be 1 custom object record with the Status of 'Open' per Opportunity Line Item. I've used the addError method to display an error to the user if they try to add another custom object record with the status of 'Open'. The trigger works great if I'm inserting just 1 record and my error message displays correctly. However, if I insert a list of records through the Execute Anonymous window where 1 record meets the error condition and other records are valid, none of the records are inserted. I understand the addError method stops the operation but I'm not sure how to insert the valid records while preventing the duplicate. Any help is appreciated!
 
Test code: 

public class DuplicateTriggerHandler{
    
    public static void checkForDuplicate(List<Custom_Object__c> coList){
        
        Set<Id> oliId = new Set<Id>();
        for(Custom_Object__c co : coList){
            oliId.add(co.Opportunity_Line_Item__c);
            System.debug('co.Opportunity_Line_Item__c: ' + co.Opportunity_Line_Item__c);
        }
        
        List< Custom_Object__c > coList2 = [Select Id from Custom_Object__c where Opportunity_Line_Item__c in: oliId and Status__c = 'Open'];
        System.debug(' coList2:' + coList2);
        
        for(Custom_Object__c co : coList){
            if(co.Status__c == 'Open' && coList2.size() > 0){
                co.addError('Error: You cannot have more than one Custom Object Record with the status of Open.');
            } 
        }
    }
}

 
I'm trying to assign the value from a map to an opportunity field. There isn't a relationship between the two objects: Opportunity and Custom_Object_1__c. Any help is appreciated!
 
public static void mapDemo(List<Opportunity> oppList){
        
        Set<Id> userSet = new Set<Id>();
        
        for(Opportunity opp: oppList){
            userSet.add(opp.CreatedById);
            userSet.add(opp.OwnerId);
        }
        
        Map<Id, Id> mapCustomObject = new Map<Id, Id>();
        
        List<Custom_Object_1__c> co1List = [SELECT Id, Special__c, User__c FROM Custom_Object_1__c WHERE User__c IN :userSet];
        
        for(Custom_Object_1__c co1 : co1List){
            mapCustomObject.put(co1.User__c, co1.Special__c);
        }
        System.debug('mapCustomObject: ' + mapCustomObject);
        for(Opportunity opp: oppList){
            opp.Test_Field__c = mapCustomObject.get(); /* assign Special__c here */
        }
    }

 
I have a custom button on a page layout that is linked to a flow. I've added the retURL parameter to the flow link in order to return back to the record wherein the flow was initiated. The record is not being refreshed once the flow is complete. I have to manually refresh the record in order to see the changes made by the flow. Is there a way to automatically refresh a record once a flow has finished? I'm using the Lightning, not Classic. Thank you!
Hello! I'm displaying a number formula field on a Visualforce page using apex:outputField. The formula field calculates a "score" for our Contact records. The formula adds a point if certain fields are not null on a record. I've added the Visualforce page to a Lightning Page using the Visualforce standard component. 

Here's my issue: The number formula field doesn't refresh or recalculate when I update fields in the Details section on the Lightning page. How can I refresh the formula field without having to refresh the entire page everytime I make a change to a record? 

Any help is appreciated!
Hello, I'm trying to reference specific fields from two different Account record types on one custom object record. Basically, two Accounts have data we'd like to display on one custom object record. Account Record Type A has data we need, as does Account Record Type B. I've created formula fields on the custom object to pull in Account fields, however, only Account Record Type A fields are being pulled in. My formula fields are simply "Account__r.Field_Name__c".

I should also add that I've successfully create two lookup fields for Account Record Type A and Accound Record Type B on the custom object. 

Is there a way to display data on a custom object record from a specific Account record type? 
I've created a visualforce page for the standard lead object and need to add the standard convert lead button to the page. I'm not looking to create any cusom features for the conversion process, just straight out-of-the-box sfdc. How can I add the standard convert button to my visualforce page? Thank you!!
We have opportunity record types based on products selected and the page layout changes by record types. On product update, i am using Process builder + flow to check the related products and update the matching record type. Classic used to update the record type and load the record page with record type matched layout. Lightning does not load automatically and users have to manually refresh the page to see the revised page layout. Is there a way to enfore full page refresh when the record type is updated through flow?
Hi all,

I have question on Visualforce page embeded in detail page. My content on the VF page is dynamic, so I can't have a fixed height of the frame. What is the proper way to implement auto resize the iframe for VF? It would be great if someone here can point me to the right direction. Thanks.
We have opportunity record types based on products selected and the page layout changes by record types. On product update, i am using Process builder + flow to check the related products and update the matching record type. Classic used to update the record type and load the record page with record type matched layout. Lightning does not load automatically and users have to manually refresh the page to see the revised page layout. Is there a way to enfore full page refresh when the record type is updated through flow?