• Connor Reilly
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 5
    Replies

Hello,

I'm working on a managed package app and wondering what the best option is for allowing users to customize the app. The primary peice of the package is a flow. I want the user to be able to specifiy a handful of fields that are referanced in the flow. What is the best way to allow this customization? Is it custom settings? A visualforce page?

 

Thanks,
Connor

Hi, 

I have a visualforce page with multiple InputFields that are picklists. I'm trying to add a checkbox that if checked, updates the InputFields to a specific value within the picklist. 

Any help would be appreciated. 

Thanks,
Connor

Hi all, 
I'm looking to update a picklist on a visualforce page, based on the values from a text formula field. 

Visualforce Page: 
 

<apex:page standardController="Scorecard__c" extensions="ScorecardExtension" lightningStylesheets="true">
    <apex:form >
        <apex:pageBlock title="Scorecard" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Calculate"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:outputField value="{!Scorecard__c.Name}"/>
                <apex:outputText value=""/>
                <apex:outputField value="{!Scorecard__c.Revenue_M__c}"/>
                <apex:outputText value=""/>
                <apex:inputField value="{!Scorecard__c.Revenue__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calculate_Revenue__c}/150</li>
                <apex:outputField value="{!Scorecard__c.Full_NAICS_Codes__c}"/>
                <apex:outputText value=""/>
                <apex:inputField value="{!Scorecard__c.Industry__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Industry__c}/100</li>
                <apex:inputField value="{!Scorecard__c.Sourcing_Frequency__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Sourcing_Frequency__c}/100</li>
                <apex:inputField value="{!Scorecard__c.Role__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Job_Function_Pick__c}/100</li>
                <apex:inputField value="{!Scorecard__c.Sourcing_Type__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Sourcing_Type__c}/100</li>
                <apex:inputField value="{!Scorecard__c.Opportunity_Size__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Cal_Opportunity_Size__c}/100</li>
                <apex:inputField value="{!Scorecard__c.Target_Pricing__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Target_Pricing__c}/40</li>
                <apex:inputField value="{!Scorecard__c.Manufacturing_Processes__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Manufacturing_Process__c}/50</li>
                <apex:inputField value="{!Scorecard__c.Customer_Responsiveness__c}"/>
                <li Style="list-style:none">{!Scorecard__c.Calc_Customer_Responsiveness__c}/85</li>
               <li Style="list-style:none"><apex:outputField value="{!Scorecard__c.Score__c}"/>{!Scorecard__c.Score__c}/825</li>
             </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

If Revenue_M__c is populated, I want to update the Revenue__c field accordingly. I've started a controller extension, but don't know if that's the right way to go. 

public class ScorecardExtension {
 
    private final Scorecard__c sccard;
    
    public ScorecardExtension(ApexPages.StandardController stdController) {
        this.sccard = (Scorecard__c)stdController.getRecord();
    }
    
    public String getRevenue() {
         switch on this.sccard.Revenue_M__c {
            when '<10' {	
                this.sccard.Revenue__c = '<$5m (or no size on Zoominfo)';
            }	
            when '11-25' {		
                this.sccard.Revenue__c = '$5-250m';
            }
            when '26-50' {	
                this.sccard.Revenue__c = '$5-250m';
            }
            when '51-250' {	
                this.sccard.Revenue__c = '$5-250m';
            } 
            when '251-500' {	
                this.sccard.Revenue__c = '$250m+';
            } 
            when '501-2,500' {	
                this.sccard.Revenue__c = '$250m+';
            } 
            when '2,501-5,000' {	
                this.sccard.Revenue__c = '$250m+';
            }
            when '5,000+' {	
                this.sccard.Revenue__c = '$250m+';
            } 
            when else {		
                this.sccard.Revenue__c = 'None';
            }
        }
    
        return this.sccard.Revenue__c;
    }
}

Any help or guidance would be appreciated. 

Thanks,
Connor
Hi all, 

I'm looking for a way to store merged account details (ie. the account id merging from and to, and the account name merging from and to). The purpose of this to inform another database that is communicating with Salesforce via the api.
Hi all, 

I'm looking to pouplate a multi-picklist field based on a text field. The text field would always have just one value in it. Is this something that is doable via flow/process builder or would it require an apex class?
Hello, 

I'm wondering if there is a way to auto-populate the related to field on a task? The goal would be for any activity logged to an opportunity, the related to field should auto populate to the contact that is assoicated with the opportunity. This way, the activity rolls up to the related contact activity as well. 

Thanks!
Hi, 

I have a requirement where I need to round robin leads to two groups of users (SDRs and Account Execs). If lead has xyz fields filled out, it should round robin to the account execs. However, if the fields are not filled out, it should round robin to SDRs. Has anyone seen a good way to do this?
I'm looking to track the true last sales activity date on the account/contact/opportunity levels. I'm unable to use just the LastActivityDate, as I need to filter out activity done by marketing user. Does anyone have suggestions on how to handle this?

I have a requirement where our Account Executives should only be able to transfer leads if:

a) they are the current owner
b) the current owner is "Marketing"

Their profile has tranfer abilities.
Here is the validation rule, but it is currently not working as expected. I'd appreciate any help. 
 

AND(ISCHANGED( OwnerId ),
PRIORVALUE(OwnerId) <> Owner:User.Id || Owner:User.Alias <> 'mkting',
OR($Profile.Name = 'Standard Fast Radius User', $Profile.Name = 'SDR'))
Looking to allow a profile to transfer accounts to their name only if the current account owner is a certian user. Our org wide setting on accounts is public read/write 

Hello, 

I'm trying to update a date/time field on the lead object. However, every which way I try to adjust the date, it throws an error. I've tried this via the import wizard and dataloader.io, both to no avail. I'd appreciate any help.
 

Error: 
 

INVALID_FIELD:Failed to deserialize field at col 2. Due to, '2018-09-11 02:26:00' is not a valid value for the type xsd:dateTime:First_Quote_Request_Time__c --
I have a trigger that is auto converting a new lead to a contact, opportunity, and account from a form submission. The leads are auto assigned from hubspot round robin. When it converts the lead, it's assigning it to a new person. I'd like to have the contact account and opportunity owner match the lead owner that it was converted from. below is the trigger currently. Any help would be appreciated. 
trigger ContactTrigger on Contact (after update) {
    if(trigger.isAfter) {
        List<Contact> contacts = trigger.new;
        
        Set<Id> acctIds = new Set<Id>();
        for(Contact contact : contacts) {
            acctIds.add(contact.AccountId);
        }
        List<Account> accounts = [Select Id, Name From Account Where Id in: acctIds];
        List<Opportunity> opportunities = new List<Opportunity>();
        User marketingUser = [Select Id, Name From User Where Name='Marketing' Limit 1];
        if(trigger.isInsert) {
            for(Integer i = 0; i < contacts.size(); i++) {
                if(!String.isEmpty(contacts[i].Which_Manuf_Service_Shall_We_Quot__c)) {
                    opportunities.add(createOpportunity(contacts[i], marketingUser, accounts));
                }
            }
        }
        if(trigger.isUpdate) {
            List<Contact> oldContacts = trigger.old;
            for(Integer i = 0; i < contacts.size(); i++) {
                if(!String.isEmpty(contacts[i].Which_Manuf_Service_Shall_We_Quot__c) && (oldContacts[i].Which_Manuf_Service_Shall_We_Quot__c != contacts[i].Which_Manuf_Service_Shall_We_Quot__c)) {
                    opportunities.add(createOpportunity(contacts[i], marketingUser, accounts));
                }
    		}
        }
        insert opportunities;
    }
    
    public Opportunity createOpportunity(Contact contact, User marketingUser, List<Account> accounts) {
        Date today = System.today();
        String tech = null;
        List<String> services = new List<String> {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'};
        List<String> serviceAbbreviations = new List<String> {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'I','j', 'k', 'l'};    
            for(Integer i = 0; i < services.size(); i++) {
                if(contact.Which_Manuf_Service_Shall_We_Quot__c.equals(services[i])) {
                    tech = serviceAbbreviations[i];
                }
            }
        tech = String.isEmpty(tech) ? 'Other' : tech;
        String accountName = '';
        for(Account account : accounts) {
            if(account.Id == contact.AccountId) {
                accountName = account.Name;
            }
        }
        System.debug('Contact: ' + contact);
        System.debug('Contact Account: ' + contact.Account);
        System.debug('Account Name' + accountName);
        Opportunity opp = new Opportunity();
                    opp.ContactId = contact.Id;
                    opp.AccountId = contact.AccountId;
                    opp.CreatedById = marketingUser.Id;
                    opp.StageName = 'Quoting';
                    opp.Name = 'RFQ - ' + accountName + ' (' + tech + ')';
                    opp.CloseDate = today.addDays(30);
        return opp;
    }
}

 
Hello, 
I'm trying to create a trigger to update a field based on the value of another field. The field I'm trying to update is a picklist and the values I'm trying to update it to are active picklist values. There are various HS_Original_Source__c values that if they are populated, I want the standard leadsource field to have it's equivilant value. Ex. HS_Original_Source__c is ORGANIC SEARCH and would map to leadsource of Organic Search.
 
trigger LeadSourceTrigger on Opportunity (before update, before insert) {
 List<Opportunity> oppList = new List<Opportunity>();
    
    //Go through the updated records coming into the database and update their custom fields 
    //according to the updated lead source 
    for(Opportunity opp : Trigger.new)
    {
        if(opp.LeadSource == '' && opp.HS_Original_Source__c != '' && opp.HS_Original_Source__c != 'OFFLINE')
        {
          if(opp.HS_Original_Source__c == 'ORGANIC SEARCH')
          {
               opp.LeadSource = 'Organic Search';
               System.debug('organic search');
           }
           /*
              if(opp.HS_Original_Source__c == 'next value')
          {
               opp.LeadSource = 'next value';
               System.debug('next value');
           }
           
           
            */
          
          //Put each updated record in the list created
          oppList.add(opp);  
        }
        
 }
 }

Any help would be much appreciated.
Hi, 

I have a requirement where I need to round robin leads to two groups of users (SDRs and Account Execs). If lead has xyz fields filled out, it should round robin to the account execs. However, if the fields are not filled out, it should round robin to SDRs. Has anyone seen a good way to do this?

I have a requirement where our Account Executives should only be able to transfer leads if:

a) they are the current owner
b) the current owner is "Marketing"

Their profile has tranfer abilities.
Here is the validation rule, but it is currently not working as expected. I'd appreciate any help. 
 

AND(ISCHANGED( OwnerId ),
PRIORVALUE(OwnerId) <> Owner:User.Id || Owner:User.Alias <> 'mkting',
OR($Profile.Name = 'Standard Fast Radius User', $Profile.Name = 'SDR'))
Looking to allow a profile to transfer accounts to their name only if the current account owner is a certian user. Our org wide setting on accounts is public read/write 
Hello, 
I'm trying to create a trigger to update a field based on the value of another field. The field I'm trying to update is a picklist and the values I'm trying to update it to are active picklist values. There are various HS_Original_Source__c values that if they are populated, I want the standard leadsource field to have it's equivilant value. Ex. HS_Original_Source__c is ORGANIC SEARCH and would map to leadsource of Organic Search.
 
trigger LeadSourceTrigger on Opportunity (before update, before insert) {
 List<Opportunity> oppList = new List<Opportunity>();
    
    //Go through the updated records coming into the database and update their custom fields 
    //according to the updated lead source 
    for(Opportunity opp : Trigger.new)
    {
        if(opp.LeadSource == '' && opp.HS_Original_Source__c != '' && opp.HS_Original_Source__c != 'OFFLINE')
        {
          if(opp.HS_Original_Source__c == 'ORGANIC SEARCH')
          {
               opp.LeadSource = 'Organic Search';
               System.debug('organic search');
           }
           /*
              if(opp.HS_Original_Source__c == 'next value')
          {
               opp.LeadSource = 'next value';
               System.debug('next value');
           }
           
           
            */
          
          //Put each updated record in the list created
          oppList.add(opp);  
        }
        
 }
 }

Any help would be much appreciated.