• Chad Ritchie
  • NEWBIE
  • 70 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 17
    Replies
Hey guys, I've attached my email template below. For the repeat part, how would I add a statement saying only repeat and list Opportunities that are 'Rejected'. ---- If(Opp.Status = 'rejected', than loop through them...... Not sure if this would go in the repeat statement or before it. Thanks!

<messaging:emailTemplate subject="Rejected Kits" recipientType="Contact" relatedToType="Contact">
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: calibri; size: 11pt;}
</style>
<body>
Dear {!relatedto.First_Name__c},
<br>
<br>
The following kit request(s) were rejected:
<br>
<br>
<apex:repeat var="OPP" value="{!relatedTo.Opportunities__r}">
<table border="1">
   <tr>
        <td>{!OPP.name}</td>   <td>{!OPP.OrderComments__c}</td>
   </tr>
</table>
</apex:repeat>
<br>
<br>
Let me know if there is anything I can do to help.
<br>
<br>
Regards, Chad
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

Hey guys, I created a junction object, "CU", under a custom object, "Investor". The junction has a button to create a new record, which is just what we want, but how do we get that button to appear at the top of "Investor" record rather than way near the bottom as a Related Object button. Is this possible? It'd really help our users to see this New Record button at the top than at the bottom with other related object buttons.

Hey guys,

I'd like to have the following formula (which pulls in a heatmap of NY from the Documents Tab)
<apex:page standardcontroller="Contact" showHeader="false">
     <apex:image id="NY" value="{!'/servlet/servlet.FileDownload?file=0F01k00000002Wn'}" width="1920" height="940"/>
</apex:page>

use an if statement/merge field to verify that the record's state is actually NY. For example, I'd like in Excel terms to do if(contact.state__c = "NY", <apex:image id="NYJan19" value="{!'/servlet/servlet.FileDownload?file=0F01k00000002Wn'}" width="1920" height="940"/> ,"")

The reason being that I plan on having an image for every state so I need to merge in the record's state field so I can properly match them. Otherwise this would require 50 visualforce pages.

Thanks!!
Hey guys,

Here's what I have right now: MONTH( TODAY() ) + 1, 1) - 1) - 8),(IF( MONTH( TODAY() ) = 12,
DATE( YEAR( TODAY() ), 12, 31 ),
DATE( YEAR( TODAY() ), MONTH( TODAY() ) + 1, 1) - 1) - 7))

What would the formula look like if instead of just counting 7 days down from the last day of the month, and instead count down 7 business days from the last day of the month?

Thanks!!
Hey guys,

I would like to create a date formula that takes the last day of the current month and subtracts 7 business days from it. This part isn't too complicated to do with the Weekday function, but how would be the best way to deal with holidays. For example Christmas is right around the corner, so how could I tell this formula, without necessarily hardcoding it every year, to not ever count the 25th day of December? Here's kind of the foundation of my formula: (IF( MONTH( TODAY() ) = 12,
DATE( YEAR( TODAY() ), 12, 31 ),
DATE( YEAR( TODAY() ), MONTH( TODAY() ) + 1, 1) - 1) - 7
but I'm not sure where to start on the Holidays issue and I haven't had much luck using the Sobject Holidays..

Thanks!!!
Hey guys,

I have a few active workflows that look at an opportunity, if there's been no activity for 21 days, it'll send a follow up email to the Contact who owns the opportunity. In order have the email sent I have to login as another user, make a minor change on the opportunity to trigger it (usually I'll have a checkbox and do a list view so it's quick), and then the email will send from him. The problem is that everyday because there's hundreds of opportunities I have to go in there and trigger all of these opportunities as him in order for the emails to be sent. Is it possible to create a workflow/process/flow (preferrably not apex) that will automatically check each opportunities "Trigger box" as him, so then the emails automatically send as him without me ever having to go in, login as him, and manually check each opportunities "Trigger box" in a list view???

Thanks!!!
Hey guys,

Is it possible to attach a file, a PDF that appears under the "Files" related object, to an email??? Ideally if I'm using visualforce and the email is being triggering off of a change on the Opportunity object, I'd like to send an email and attach all the files that appear under the "Files" object on that opportunity. Is this possible, and if so how difficult would this be to achieve? Thanks!!
Hey guys, let's say contact is my primary object, but I then do a related lookup on Opportunity, which I have working, how would I do a lookup on a related object to Opportunity, let's call it Closings, can that be done? Here's my code: (The first bold part works, but the second doesn't)
THANKS!!
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<messaging:emailTemplate subject="TEST" recipientType="Contact" relatedToType="Contact" >
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: arial; size: 12pt;}
</style>
<body>
Dear {!relatedTo.Name},

<br>
<br>
<apex:repeat var="opp" value="{!relatedTo.Opportunities__r}">
    <table border="0">
           <tr>
               <td>{!opp.Name}</td>
           </tr>
    </table>
</apex:repeat>


<apex:repeat var="cls" value="{!relatedTo.Opportunities__r.Closings__r}">
    <table border="0">
           <tr>
               <td>{!cls.Name}</td>
           </tr>
    </table>
</apex:repeat>

 
Hey guys,

So I'm new to creating Visualforce Email Templates. I'm really struggling to understand two things (and my code is below). First, where I mention Opportunity Requests below, what would the code look like to bring in a list from the opportunity object of all of their opportunities, but still have contact as the primary object. For example: Dear John Smith, here's a list of your opportunities: Opp1 Name, Opp2 Name, Opp3 Name.
So how would this work, since it's not as intuitive as merge fields, and second how would the code work so if someone has 20 Opps it looks good, and if someone has just 1 Opp it looks good, meaning not a ton of blank space. I know this is a lot to ask for, but I think if I can get down how to bring in cross-object info, similar to merge fields, and how to make info look good regardless of how many instances there are, than I'll be well on my way. THANKS so much!!!

<messaging:emailTemplate subject="Thanks for your Business" recipientType="Contact" relatedToType="Contact" >
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: arial; size: 12pt;}
</style>
<body>
Dear {!RelatedTo.Firstname},

<br>
<br>
Thank you for completing the following Opportunity Requests:

</br>
</br>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
 
Hey guys,

This formula:

IF(AND(ISBLANK( Prospect_First_Name__c ),OR((ISPICKVAL(StageName,'Proposal Sent')),(ISPICKVAL(StageName,'Portfolio Analysis')),(ISPICKVAL(StageName,'Decision Stage')),(ISPICKVAL(StageName,'Account Implementation')))),"I wanted to follow-up and make sure you received and reviewed our proposal outlining how we might be able to provide your prospect with "+ Strategy_2__c +" solutions. Are there any other questions or concerns I can address? What are the next steps? I look forward to hearing from you,",IF(AND(NOT(ISBLANK( Prospect_First_Name__c )),OR((ISPICKVAL(StageName,'Proposal Sent')),(ISPICKVAL(StageName,'Portfolio Analysis')),(ISPICKVAL(StageName,'Decision Stage')),(ISPICKVAL(StageName,'Account Implementation')))),"I wanted to follow-up and make sure you received and reviewed our proposal outlining how we might be able to provide " + Prospect_Full_Name__c + " with "+ Strategy_2__c +" solutions. Are there any other questions or concerns I can address? What are the next steps? I look forward to hearing from you,",IF(OR(ISPICKVAL((StageName,'Open')),(ISPICKVAL(StageName,'OSG New'))),"I wanted to follow-up from our discussion to make sure I had addressed all your questions regarding available OSG solutions. Are there any concerns I can address? What are the next steps? I look forward to hearing from you,","")))   

is returning a Missing Parentheses error, and I'm not sure why, it seems like everything lines up. Thanks for the help!!
Hey guys,

I appreciate all the help I can get,

Here's my formula :

IF(ISBLANK(IF(Length_of_Strategy_String__c <50,(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF(AND( Length_of_Strategy_String__c >50, Length_of_Strategy_String__c <56),(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF( Length_of_Strategy_String__c >56,(LEFT( Strategy_just_used_for_update_email__c , LEN(Strategy_just_used_for_update_email__c ) - 4)))))),IF(Length_of_Strategy_String__c <50,(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF(AND( Length_of_Strategy_String__c >50, Length_of_Strategy_String__c <56),(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF( Length_of_Strategy_String__c >56,(LEFT( Strategy_just_used_for_update_email__c , LEN(Strategy_just_used_for_update_email__c ) - 4))))),GAI)

And here's the error:  Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

I know it's very close, I just can't figure out where the error's coming from.

Thanks!

 
Hey guys,

How could I add some logic into this formula to remove the last "and" of every string. It's a multi-select-picklist. I know how to do this in a new formula using left(len()-4) and referring to the field, but how could this be done all in this same formula field? (trying to save some syntax size) Here's the formula:

IF(INCLUDES(Strategy__c, "A"), "A, and", NULL)+ IF(INCLUDES(Strategy__c, "B"), "B, and ", NULL)+ IF(INCLUDES(Strategy__c, "C"), "C, and", NULL) + IF(INCLUDES(Strategy__c, "D"), "D, and ", NULL) + IF(INCLUDES(Strategy__c, "E"), "E, and ", NULL) + IF(INCLUDES(Strategy__c, "F"), "F, and ", NULL) + IF(INCLUDES(Strategy__c, "G"), "G, and", NULL) + IF(INCLUDES(Strategy__c, "H"), "H, and" NULL) + IF(INCLUDES(Strategy__c, "I"), "I, and ", NULL) + IF(INCLUDES(Strategy__c, "J"), "J, and ", NULL) + IF(INCLUDES(Strategy__c, "K"), "K, and ", NULL) + IF(INCLUDES(Strategy__c, "L"), "L, and ", NULL) + IF(INCLUDES(Strategy__c, "M"), "M, and ", NULL) + IF(INCLUDES(Strategy__c, "N"), "N, and ", NULL) + IF(INCLUDES(Strategy__c, "O"), "O, and ", NULL) + IF(INCLUDES(Strategy__c, "P"), "P, and ", NULL)

Thanks!!
Hey guys,

I'm trying to figure out how to get this formula to work on just the first ",and" and not the second. Here's what I have: Chad, and Chris, and Sean.
I would like it to return Chad, Chris, and Sean by simply replacing ", and" with ",". And keep in mind that sometimes it brings back 1 name, sometimes 2, and sometimes 3, so I'd like to apply for each of those. Here's what I have now: SUBSTITUTE(LEFT(test__c, 40),", and",",")  but unfortuntely this always does it to both instances so it will return Chad, Chris, Sean, instead of adding an and after Chris. Any help is appreciated!!! I know this is really easy in excel because you can indicate the instance that you want it to apply to, but not sure about doing this on Salesforce. Thanks guys!!

Hey guys,

What's the syntax to use for a picklist value in order to have that value merge into a formula? So that way I see the value of the field, and not just the field's name. Thanks!!

Hey guys,

So I'm trying to create a field where if record is "A" than the field will be a calculation (Total/Estimate), therefore it's a percent field type. But, if the record is "B", meaning it doesn't have a total or an estimate, I'd like for the field to just show "N/A". Is there anyway this is possible to have text in a formula field of percent type. The reason being that I'd hate to have an error or blank field for all type "B"s. Thanks!!!
Hey guys,

I've created this formula, which will go in an email template and basically serve as the whole email. Unfortunately, the formula just keeps bringing back the field name, and not the value of the field. There's a small piece of my formula below, what I'd like is for the name of the Sales Professional to come in, but unfortunately every time I send myself an email, using this formula, the only thing that comes back is the name of the field, not the person. Any idea why this might be happening? (And I've tried to put the field in brackets, and a number of other formats, but still no luck. Thanks!!!

IF(AND(ISBLANK( Prospect_First_Name__c ),ISPICKVAL(StageName,'Proposal Sent')),"Dear SalesProfessional__r.Full_Name__c , I wanted to follow-up and make sure you received and reviewed our proposal.

Hey guys,

I'm creating a button on Salesforce that will automatically fill in many of the fields in an existing form that we use. But, I've run in to issues trying to autofill a question on the form which is in radio input type(3 different choices, looks like a multiple choice test, and only one can be picked). We need to prefill the top choice "option 1" as default, but we don't have the ability to actually change the form, so we have to figure out how, in a salesforce URL button, to have a default answer for this question. So far I have .................&BenchmarkKey=  input type=radio value="1"        But it is not working, if someone could help me figure out how to refer to a radio button in a salesforce URL Detail Page Button, that would be amazing! Thank you in advance!

Hey guys, I'm trying to figure out a formula that will only pull the first name of an email. So for example, pull "Chad" out of chad.c.ritchie@gggcorporation.com, but I also would need this to work for jonathan.n.reed@gggcorporation.com, so I imagine it is something to do with extracting values to the left of the furthest period, but I'm not sure how to do it. Here is what I have right now which isn't working:                      trim(left( Contact.Email ,find(".", Contact.Email ,1)-1))

Thank you!!

Hey guys,

So I have an Object A with an ID we'll call "ID A" and I need to match that against Object B's field and see if it has a match for "ID A", if it does I then need to bring back "ID B" from Object B and place it in Object A's field. I am wondering if this match and pull back a different Id can be done simply through process builder or if I'll need a flow?

Thanks in advance, and if you would complete this through say a Process Builder is there anyway you could provide screenshots of how it'd be done? Thank you!!
Hey guys, just wondering if there is a way to see the steps of flow that successfully ran? I know with errors you can see the steps and see where it broke, but I currently have a flow that is successfuly running, but doesn't do anything, so is there a way to see the steps that and see where it is going wrong? Thanks!!!
Pretty new to writing test classes, was looking for help for this trigger:

trigger SumPositions on Investor__c (before insert, before update, before delete) {
    for (Investor__c record : Trigger.new) {
        record.Sum_of_Positions__c = null;
    }
    for(AggregateResult result: [SELECT SEI_Investor_Id__c, SUM(Position__c.Balance__c)
                                 FROM Position__c WHERE SEI_Investor_Id__c
                                 IN :Trigger.newMap.keyset() GROUP BY SEI_Investor_Id__c]) {
         Trigger.newMap.get(result.get('SEI_Investor_Id__c')).Sum_of_Positions__c = (Decimal)result.get('expr0');
     }
 }

Hey guys, I created a junction object, "CU", under a custom object, "Investor". The junction has a button to create a new record, which is just what we want, but how do we get that button to appear at the top of "Investor" record rather than way near the bottom as a Related Object button. Is this possible? It'd really help our users to see this New Record button at the top than at the bottom with other related object buttons.

Hey guys,

I would like to create a date formula that takes the last day of the current month and subtracts 7 business days from it. This part isn't too complicated to do with the Weekday function, but how would be the best way to deal with holidays. For example Christmas is right around the corner, so how could I tell this formula, without necessarily hardcoding it every year, to not ever count the 25th day of December? Here's kind of the foundation of my formula: (IF( MONTH( TODAY() ) = 12,
DATE( YEAR( TODAY() ), 12, 31 ),
DATE( YEAR( TODAY() ), MONTH( TODAY() ) + 1, 1) - 1) - 7
but I'm not sure where to start on the Holidays issue and I haven't had much luck using the Sobject Holidays..

Thanks!!!
Hey guys,

I have a few active workflows that look at an opportunity, if there's been no activity for 21 days, it'll send a follow up email to the Contact who owns the opportunity. In order have the email sent I have to login as another user, make a minor change on the opportunity to trigger it (usually I'll have a checkbox and do a list view so it's quick), and then the email will send from him. The problem is that everyday because there's hundreds of opportunities I have to go in there and trigger all of these opportunities as him in order for the emails to be sent. Is it possible to create a workflow/process/flow (preferrably not apex) that will automatically check each opportunities "Trigger box" as him, so then the emails automatically send as him without me ever having to go in, login as him, and manually check each opportunities "Trigger box" in a list view???

Thanks!!!
Hey guys,

Is it possible to attach a file, a PDF that appears under the "Files" related object, to an email??? Ideally if I'm using visualforce and the email is being triggering off of a change on the Opportunity object, I'd like to send an email and attach all the files that appear under the "Files" object on that opportunity. Is this possible, and if so how difficult would this be to achieve? Thanks!!
Hey guys, let's say contact is my primary object, but I then do a related lookup on Opportunity, which I have working, how would I do a lookup on a related object to Opportunity, let's call it Closings, can that be done? Here's my code: (The first bold part works, but the second doesn't)
THANKS!!
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<messaging:emailTemplate subject="TEST" recipientType="Contact" relatedToType="Contact" >
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: arial; size: 12pt;}
</style>
<body>
Dear {!relatedTo.Name},

<br>
<br>
<apex:repeat var="opp" value="{!relatedTo.Opportunities__r}">
    <table border="0">
           <tr>
               <td>{!opp.Name}</td>
           </tr>
    </table>
</apex:repeat>


<apex:repeat var="cls" value="{!relatedTo.Opportunities__r.Closings__r}">
    <table border="0">
           <tr>
               <td>{!cls.Name}</td>
           </tr>
    </table>
</apex:repeat>

 
Hey guys,

I appreciate all the help I can get,

Here's my formula :

IF(ISBLANK(IF(Length_of_Strategy_String__c <50,(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF(AND( Length_of_Strategy_String__c >50, Length_of_Strategy_String__c <56),(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF( Length_of_Strategy_String__c >56,(LEFT( Strategy_just_used_for_update_email__c , LEN(Strategy_just_used_for_update_email__c ) - 4)))))),IF(Length_of_Strategy_String__c <50,(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF(AND( Length_of_Strategy_String__c >50, Length_of_Strategy_String__c <56),(LEFT( Strategy_just_used_for_update_email__c , LEN( Strategy_just_used_for_update_email__c ) - 4)),IF( Length_of_Strategy_String__c >56,(LEFT( Strategy_just_used_for_update_email__c , LEN(Strategy_just_used_for_update_email__c ) - 4))))),GAI)

And here's the error:  Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

I know it's very close, I just can't figure out where the error's coming from.

Thanks!

 
Hey guys,

I'm trying to figure out how to get this formula to work on just the first ",and" and not the second. Here's what I have: Chad, and Chris, and Sean.
I would like it to return Chad, Chris, and Sean by simply replacing ", and" with ",". And keep in mind that sometimes it brings back 1 name, sometimes 2, and sometimes 3, so I'd like to apply for each of those. Here's what I have now: SUBSTITUTE(LEFT(test__c, 40),", and",",")  but unfortuntely this always does it to both instances so it will return Chad, Chris, Sean, instead of adding an and after Chris. Any help is appreciated!!! I know this is really easy in excel because you can indicate the instance that you want it to apply to, but not sure about doing this on Salesforce. Thanks guys!!

Hey guys,

What's the syntax to use for a picklist value in order to have that value merge into a formula? So that way I see the value of the field, and not just the field's name. Thanks!!

Hey guys,

I've created this formula, which will go in an email template and basically serve as the whole email. Unfortunately, the formula just keeps bringing back the field name, and not the value of the field. There's a small piece of my formula below, what I'd like is for the name of the Sales Professional to come in, but unfortunately every time I send myself an email, using this formula, the only thing that comes back is the name of the field, not the person. Any idea why this might be happening? (And I've tried to put the field in brackets, and a number of other formats, but still no luck. Thanks!!!

IF(AND(ISBLANK( Prospect_First_Name__c ),ISPICKVAL(StageName,'Proposal Sent')),"Dear SalesProfessional__r.Full_Name__c , I wanted to follow-up and make sure you received and reviewed our proposal.
Pretty new to writing test classes, was looking for help for this trigger:

trigger SumPositions on Investor__c (before insert, before update, before delete) {
    for (Investor__c record : Trigger.new) {
        record.Sum_of_Positions__c = null;
    }
    for(AggregateResult result: [SELECT SEI_Investor_Id__c, SUM(Position__c.Balance__c)
                                 FROM Position__c WHERE SEI_Investor_Id__c
                                 IN :Trigger.newMap.keyset() GROUP BY SEI_Investor_Id__c]) {
         Trigger.newMap.get(result.get('SEI_Investor_Id__c')).Sum_of_Positions__c = (Decimal)result.get('expr0');
     }
 }
Hey guys, trying to create trigger to sum up positions(new, existing), and then update total values for the investors. I am using SEI_Investor_Id__c to match positions to investors.

trigger SumPositions on Investor__c (before insert, before update, before delete) {
    for (Investor__c record : Trigger.new) {
        record.Sum_of_Positions__c = null;
    }
    for(AggregateResult result: [SELECT SUM(Position__c.Balance__c) Amt, SEI_Investor_Id__c, Id 
                                 FROM Position__c Id 
                                 WHERE SEI_Investor_Id__c 
                                 IN :Trigger.new GROUP BY SEI_Investor_Id__c, Id]) {
         Trigger.newMap.get((Id)result.get('Id')).Sum_of_Positions__c = (Decimal)result.get('Amt');
     }
 }