• Tolby Hunt
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 27
    Replies
Hello! I am trying to display a list of opportunities and when i click on a row of an opportunity i get the full opportunity in apex:detail below the list.

 
<apex:page standardController="Opportunity" extensions="opportunityControllerExtension" recordSetVar="opportunities" tabstyle="opportunity" sidebar="false">
<head>
<apex:includeScript value="{!URLFOR($Resource.jQuery)}"  />
<script type="text/javascript">
    $j = jQuery.noConflict();
    function clickElem(elem){
        var row = parseInt($j(elem).find(".accId").html());
        alert(row);
        $j(elem).find("myString").value = row
;
    }
</script>
<apex:variable value="{!0}" var="index" />
</head>
  <apex:pageBlock >
    <apex:form >
      <apex:panelGrid columns="9">
        <apex:outputLabel value="View:"/>
        <apex:selectList value="{!filterId}" size="1">
          <apex:actionSupport event="onchange" rerender="list"/>
          <apex:selectOptions value="{!listviewoptions}"/>
        </apex:selectList>
      </apex:panelGrid>
      <apex:pageBlockTable value="{!opportunities}" var="a" id="list" onRowClick="clickElem(this);">
        <apex:column value="{!a.name}"/>
        <apex:column value="{!a.Created_Date__c}"/>
        <apex:column value="{!a.Underwriting_Stage__c}"/>
        <apex:column value="{!a.X0_Credit_Lines_Pre_Approval_Amount__c}"/>
        <apex:column value="{!a.Total_Paydowns__c}"/>
        <apex:column value="{!a.Term_Loan_Pre_Approval_Amount__c}"/>
        <apex:column value="{!a.Date_Signed__c}"/>
        <apex:column value="{!a.Reasoning_if_Failed_Credit__c}"/>
        <apex:column styleClass="accId">
                <apex:outputText >
                <apex:variable value="{!index + 1}" var="index" />
                {!index}
                </apex:outputText>
            </apex:column>
      </apex:pageBlockTable>
    </apex:form>
    <apex:pageBlock >
        <apex:detail subject="{!opportunities[myString]}" />
    </apex:pageBlock>
  </apex:pageBlock>
</apex:page>

Any help would be appreciated!
Thanks
I want ot create a lookup filter for my opportunity. I have a field that has an ID as a text that i want to compare to an ID on a custom object and fill in the lookup to what object it found with the same ID. Any way to do this?

Hello!

I want to give some of my accounts that are for my affiliates an ID so when a lead is created they have a hidden field with an Affiliate ID, then using the affiliate ID i would autofill a field with the Account of who has that affiliate ID. Ive tried lookups but it wont pull up a custom field.

HELPP!

Thanks

Hello, my company wants to create an automatic underwriting tool that they can use with our opportunities credit reports. We want it as accurate as possible. I have tried setting up flows/workflows/process builders to create it but everything i have tried breaks for some reason. We have custom objects of and fields of
  1. Credit Weakness
    1. Credit Weakness Name(Text Field)
    2. Date Opened/Date Occured (Date Field)
    3. Days Late (Number Field)
    4. Amt Owed (Number Field)
  2. Credit Inquiries
    1. Credit Inquiry Name(Text)
    2. Date Of Inquiry(Date)
  3. Revolving Accounts
    1. Revolving Acct Name(Text)
    2. Balance(Number)
    3. Limit(Number)
    4. Paid(Number)
  4. Strong Accts
    1. Strong Acct Name(Text)
    2. Date Opened(Date)
    3. Balance(Number)
    4. Limit(Number)
  5. Credit Card Available Spend
    1. CC Avbl Spend Name(Text)
    2. Date Opened(Date)
    3. Balance(Number)
    4. Limit(Number)
with a master relationship to the Opportunity. If something is derrogatory then it changes another field to declined.
I have a list of rules that it needs to check for.

All Opportunity leads come in with a “client qualifies” default and then the system runs through the reasons for it to be declined.
If this, then Stage is “Declined”
If there is 2 or more 30 day lates in the last 12 months then the stage is changed to “Declined”
If there is 3 or more 30 day lates in the last 24 months then the stage is changed to “Declined.”
If there is 2 or more 60 day lates in the last 24 months then “Declined”
If there are any 90, 120 day or worse late payments in the last 24 months then “Declined.”
If there are collections or charge offs over $2,000 that are still open then “Declined.”credit weakness
If there is any kind of bankruptcy in the public records dated within the last 60 months then “Declined.”
If there are any open, unpaid tax liens or judgements on the public records then “Declined.”
If client has more than 6 inquiries on Experian, 6 inquiries on Equifax then “Declined”
If there are any “Revolving Accounts Above 45% Limit” then the stage should be automatically changed to “Needs paydowns”
If there is an unpaid collection or charge-off of 500 dollars or more within the past 6 months then “Declined”
If your Experian score is below 580 then “Declined.”
If you don’t have any “Strong Accounts” then “Declined.”
If you have 5 or more new “Revolving” accounts opened within the past year then “Declined.”


If anyone can help me think of a solution thatd be great.

Thanks!
Hello! I need a timer that tracks the minutes it takes for my workers to contact a lead. So the thought i had was a workflow that only happens once they change a field to "Contacted" that would update a field with        NOW() - DATETIMEVALUE( CreatedDate ). For some reason i cannot get it to work. It displays the counter as 0 every time.
Hello! I am trying to write a unit test for my SMS to new lead trigger and controller. I have no idea on how to unit test for salesforce. please help!

My trigger is - 
trigger SMS_To_New on Lead (after insert) {
     
    Send_SMS_ControllerLead.Send(Trigger.newMap.keySet());
}


My class is - 
 
public class Send_SMS_ControllerLead {
    public String smsBody {get; set;}
    public boolean hasNumber {get; set;}
    public final String  fromNumber = '+1XXXXXXXXXX';// get it from twilio
      //after login click Phone Numbers tab in left sidebar
 
    public string dialCode = '+1'; // Add your dial Code of your country.
    public Send_SMS_ControllerLead(ApexPages.StandardController controller) {
       hasNumber = true;
    }
    public static void Send()
{
    String account = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'; // Account SID on home tab
    String token  =   'XXXXXXXXXXXXXXXXXXXXXXXXXX'';//AUTH Token on home tab
    TwilioRestClient client = new TwilioRestClient(account, token);
 
    Id leadId = ApexPages.currentPage().getParameters().get('id');
 
    String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
    Lead a = [SELECT Phone FROM Lead WHERE Id = :leadId];
 
    if(a.Phone != null)
    {
        String phoneNumber = a.Phone;
        if(!phoneNumber.Contains('+1'))
        phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
         //on Phone number we will ad it.
        System.debug('phoneNumber'+phoneNumber);
         Map<String,String> params = new Map<String,String> {
        'To'  => phoneNumber,
        'From' => '+1XXXXXXXXXX',
        'Body' => 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.'
         };
         TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
         SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1XXXXXXXXXX',To__c =phoneNumber, Body__c = 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.');
         insert sentSMS;
 
    }
     
}
    // This method for Trigger
    @future(callout=true)
    public static void Send(Set<Id> setId)
    {
     
        List<Lead> newLead = [select id,Phone from Lead where id in :setId];
         
        String account = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'; // Account SID on home tab
        String token  =   'XXXXXXXXXXXXXXXXXXXXXXXXXX'';//AUTH Token on home tab
        TwilioRestClient client = new TwilioRestClient(account, token);
 
        String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        List<SMS_Lead__c> lstSMSLead = new List<SMS_Lead__c>();
         
        for(Lead leadObj : newLead)
        {
            if(leadObj.Phone != null)
            {
                String phoneNumber = leadObj.Phone;
                if(!phoneNumber.Contains('+1'))
                phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
                 //on Phone number we will ad it.
                System.debug('phoneNumber'+phoneNumber);
                 Map<String,String> params = new Map<String,String> {
                'To'  => phoneNumber,
                'From' => '+1XXXXXXXXXX,
                'Body' => 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.'
                 };
                 TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
                  
                 SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1XXXXXXXXXXX',To__c= phoneNumber, Body__c = 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.');
                 //insert sentSMS;
                lstSMSLead.add(sentSMS);
            }
        }
 
        if(lstSMSLead.size() > 0 )
        {
            insert lstSMSLead;
        }  
    }
}

 
I am trying to create a flow/process builder that checks the fields of a custom object that is linked to an Opportunity. I have tried doing a process builder but at the very end when im trying to invoke the process it asks for a value but it loops to lookups. I dont understand flows very well. Does anyone have a way to fix the process builder or information on how i can learn the flow?
Hello! I am trying to make a process simpilar for my company. I need a field to show multiple objects inside of it

So i have one field that shows credit cards and each of those credit cards needs to have the name of the card, the balance, the limit, and the paydown amount.

Example:    
Credit Card Name: Citi Bank
Balance: 2000
Limit: 6000
Paydown: 500

i need each and every field accesible so i can run formulas on it with ease. Is there an easy way to do this?
Hello everyone! i am trying to send a text to my leads with twilio with a trigger event once they are created. I am new to salesforce so most of this is a whirlwind to me. If you could fix my code and then explain it that would be best.

Thanks

Apex Class
 
public class Send_SMS_ControllerLead {
    public String smsBody {get; set;}
    public boolean hasNumber {get; set;}
    public final String  fromNumber = '+1xxxxxxxxx';// get it from twilio
      //after login click Phone Numbers tab in left sidebar

    public string dialCode = '+1'; // Add your dial Code of your country.
    public Send_SMS_ControllerLead(ApexPages.StandardController controller) {
       hasNumber = true;
    }
    public static void Send()
    {
        String account = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // Account SID on home tab
        String token   =   'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'';//AUTH Token on home tab
        TwilioRestClient client = new TwilioRestClient(account, token);

        Id leadId = ApexPages.currentPage().getParameters().get('id');

        String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        Lead a = [SELECT Phone FROM Lead WHERE Id = :leadId];

        if(a.Phone != null)
        {
            String phoneNumber = a.Phone;
            if(!phoneNumber.Contains('+1'))
            phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
             //on Phone number we will ad it.
            System.debug('phoneNumber'+phoneNumber);
             Map<String,String> params = new Map<String,String> {
            'To'   => phoneNumber,
            'From' => '+1xxxxxxxxxx',
            'Body' => 'Thanks for applying with Fundwise. An email was sent to you for the next step that will expedite the process. An agent will contact you shortly.'
             };
             TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
             SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1xxxxxxxxxxx',To__c = phoneNumber, Body__c = 'Thanks for applying with Fundwise. An email was sent to you for the next step that will expedite the process. An agent will contact you shortly.');
             insert sentSMS;

        }
        
    }
     
}

and my trigger

Apex Trigger
 
trigger SMS_To_New on Lead (after insert, after update) {
    
    Send_SMS_ControllerLead.Send();
}



Let me know

Thanks!​
I want ot create a lookup filter for my opportunity. I have a field that has an ID as a text that i want to compare to an ID on a custom object and fill in the lookup to what object it found with the same ID. Any way to do this?
Hello, my company wants to create an automatic underwriting tool that they can use with our opportunities credit reports. We want it as accurate as possible. I have tried setting up flows/workflows/process builders to create it but everything i have tried breaks for some reason. We have custom objects of and fields of
  1. Credit Weakness
    1. Credit Weakness Name(Text Field)
    2. Date Opened/Date Occured (Date Field)
    3. Days Late (Number Field)
    4. Amt Owed (Number Field)
  2. Credit Inquiries
    1. Credit Inquiry Name(Text)
    2. Date Of Inquiry(Date)
  3. Revolving Accounts
    1. Revolving Acct Name(Text)
    2. Balance(Number)
    3. Limit(Number)
    4. Paid(Number)
  4. Strong Accts
    1. Strong Acct Name(Text)
    2. Date Opened(Date)
    3. Balance(Number)
    4. Limit(Number)
  5. Credit Card Available Spend
    1. CC Avbl Spend Name(Text)
    2. Date Opened(Date)
    3. Balance(Number)
    4. Limit(Number)
with a master relationship to the Opportunity. If something is derrogatory then it changes another field to declined.
I have a list of rules that it needs to check for.

All Opportunity leads come in with a “client qualifies” default and then the system runs through the reasons for it to be declined.
If this, then Stage is “Declined”
If there is 2 or more 30 day lates in the last 12 months then the stage is changed to “Declined”
If there is 3 or more 30 day lates in the last 24 months then the stage is changed to “Declined.”
If there is 2 or more 60 day lates in the last 24 months then “Declined”
If there are any 90, 120 day or worse late payments in the last 24 months then “Declined.”
If there are collections or charge offs over $2,000 that are still open then “Declined.”credit weakness
If there is any kind of bankruptcy in the public records dated within the last 60 months then “Declined.”
If there are any open, unpaid tax liens or judgements on the public records then “Declined.”
If client has more than 6 inquiries on Experian, 6 inquiries on Equifax then “Declined”
If there are any “Revolving Accounts Above 45% Limit” then the stage should be automatically changed to “Needs paydowns”
If there is an unpaid collection or charge-off of 500 dollars or more within the past 6 months then “Declined”
If your Experian score is below 580 then “Declined.”
If you don’t have any “Strong Accounts” then “Declined.”
If you have 5 or more new “Revolving” accounts opened within the past year then “Declined.”


If anyone can help me think of a solution thatd be great.

Thanks!
Hello! I need a timer that tracks the minutes it takes for my workers to contact a lead. So the thought i had was a workflow that only happens once they change a field to "Contacted" that would update a field with        NOW() - DATETIMEVALUE( CreatedDate ). For some reason i cannot get it to work. It displays the counter as 0 every time.
Hello! I am trying to write a unit test for my SMS to new lead trigger and controller. I have no idea on how to unit test for salesforce. please help!

My trigger is - 
trigger SMS_To_New on Lead (after insert) {
     
    Send_SMS_ControllerLead.Send(Trigger.newMap.keySet());
}


My class is - 
 
public class Send_SMS_ControllerLead {
    public String smsBody {get; set;}
    public boolean hasNumber {get; set;}
    public final String  fromNumber = '+1XXXXXXXXXX';// get it from twilio
      //after login click Phone Numbers tab in left sidebar
 
    public string dialCode = '+1'; // Add your dial Code of your country.
    public Send_SMS_ControllerLead(ApexPages.StandardController controller) {
       hasNumber = true;
    }
    public static void Send()
{
    String account = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'; // Account SID on home tab
    String token  =   'XXXXXXXXXXXXXXXXXXXXXXXXXX'';//AUTH Token on home tab
    TwilioRestClient client = new TwilioRestClient(account, token);
 
    Id leadId = ApexPages.currentPage().getParameters().get('id');
 
    String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
    Lead a = [SELECT Phone FROM Lead WHERE Id = :leadId];
 
    if(a.Phone != null)
    {
        String phoneNumber = a.Phone;
        if(!phoneNumber.Contains('+1'))
        phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
         //on Phone number we will ad it.
        System.debug('phoneNumber'+phoneNumber);
         Map<String,String> params = new Map<String,String> {
        'To'  => phoneNumber,
        'From' => '+1XXXXXXXXXX',
        'Body' => 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.'
         };
         TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
         SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1XXXXXXXXXX',To__c =phoneNumber, Body__c = 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.');
         insert sentSMS;
 
    }
     
}
    // This method for Trigger
    @future(callout=true)
    public static void Send(Set<Id> setId)
    {
     
        List<Lead> newLead = [select id,Phone from Lead where id in :setId];
         
        String account = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'; // Account SID on home tab
        String token  =   'XXXXXXXXXXXXXXXXXXXXXXXXXX'';//AUTH Token on home tab
        TwilioRestClient client = new TwilioRestClient(account, token);
 
        String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        List<SMS_Lead__c> lstSMSLead = new List<SMS_Lead__c>();
         
        for(Lead leadObj : newLead)
        {
            if(leadObj.Phone != null)
            {
                String phoneNumber = leadObj.Phone;
                if(!phoneNumber.Contains('+1'))
                phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
                 //on Phone number we will ad it.
                System.debug('phoneNumber'+phoneNumber);
                 Map<String,String> params = new Map<String,String> {
                'To'  => phoneNumber,
                'From' => '+1XXXXXXXXXX,
                'Body' => 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.'
                 };
                 TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
                  
                 SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1XXXXXXXXXXX',To__c= phoneNumber, Body__c = 'Thank you for applying with Fundwise! Next step is to get a credit report. Please check your email now for the next step.');
                 //insert sentSMS;
                lstSMSLead.add(sentSMS);
            }
        }
 
        if(lstSMSLead.size() > 0 )
        {
            insert lstSMSLead;
        }  
    }
}