• Jerrod Knapp 11
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
I have a text formula hyperlink that connects to an external api.  I want to activate or trigger this link to open in a new window on the record update.  All of this is on one Custom Object.
I need some help creating a test class for the following code:

global class ResourceDTO {
                       
    public string id {get; set;}             
    public string name {get; set;}
    public string documenttype {get; set;}
    public string documentcategory {get; set;}
    public string filetype {get; set;}                       
    public string content {get; set;}
    public List<string> permissions {get; set;}
    public string publishdate {get; set;}
    public string lastmodifieddate {get; set;}
}

Really appreciate any help you kind folks can offer.

Thanks!
​Jerrod.
When I get an Internal service error and it tells me that Salesforce support team has been notified, what then?  I keep getting the error and haven't heard from them.  Maybe you all could help.  Here is my error and my logs:

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 657774541-39318 (1260044521)

41.0 APEX_CODE,DEBUG;APEX_PROFILING,ERROR;CALLOUT,ERROR;DB,ERROR;SYSTEM,ERROR;VALIDATION,ERROR;VISUALFORCE,ERROR;WAVE,INFO;WORKFLOW,ERROR 09:56:36.0 (319626)|EXECUTION_STARTED 09:56:36.0 (341741)|CODE_UNIT_STARTED|[EXTERNAL]|VisualForce View State 09:56:36.0 (8774368)|CODE_UNIT_FINISHED|VisualForce View State 09:56:36.0 (9595738)|EXECUTION_FINISHED

41.0 APEX_CODE,DEBUG;APEX_PROFILING,ERROR;CALLOUT,ERROR;DB,ERROR;SYSTEM,ERROR;VALIDATION,ERROR;VISUALFORCE,ERROR;WAVE,INFO;WORKFLOW,ERROR 09:56:31.0 (360277)|EXECUTION_STARTED 09:56:31.0 (390839)|CODE_UNIT_STARTED|[EXTERNAL]|VisualForce View State 09:56:31.0 (10190228)|CODE_UNIT_FINISHED|VisualForce View State 09:56:31.0 (11024888)|EXECUTION_FINISHED


Thanks in advance!

Jerrod.
I know that the contentversion object is a tricky monkey but I need to update a custom field (chekcbox) on that object from a related custom object.  Their relation is the contentversion id.  I tried flow and process builder but it's just not working...  I'm hoping that someone can help with a trigger.  Here is how it goes...
when
CustomObject__c.CustomCheckbox__c field gets set to = True
then
ContentVersion.CustomCheckbox gets set to = False

Thanks ahead of time to anyone who gives me a hand with this.
Sincerely,
Jerrod.
I am writing a test class for a contentversion trigger.  VersionData is a required field and is a base64.  How do I represent a base64 in my test class?  When I try to put in a value I get an error similar to this:   "Illegal assignment from String to Blob"
I have a trigger that is "supposed" to recheck a box only if there is a new version of a Content Document and only if the box has been unchecked.  I need to be able to uncheck this box and save the record so we can publish.  What it's doing right now is re-checking the box whether or not the version is <> '1' (I have even used >'1').  Can someone check this out and tell me where I might be mucking up the code?

trigger NotOnWebCheckbox on ContentVersion (before update) {
    for(ContentVersion cv: Trigger.new){
        If (cv.VersionNumber <> '1' || cv.Not_on_Web__c == false ){
           cv.Not_on_Web__c = true;
        }
    }
}

Thanks in advance, obviously there will be beer for Best Answer ;)
Hello,

I have an Apex class sending emails based on an account status.  It is sending an "HTML with Letterhead" email template.  When the email is sent, email clients using HTML are getting a blank email while plain text email clients get the email body but no letterhead.  

When I test the email inside of salesforce from the template it sends the email with letterhead just fine to all email client types but when the APEX sends the emails it just doesn't work in HTML.

Please help!!  Thanks in advance.

Jerrod   
I need  to trigger a field update on the account if an attached document contains a particular text string. I understand Chatter files are searchable, can I search an object attachment?
I know that the contentversion object is a tricky monkey but I need to update a custom field (chekcbox) on that object from a related custom object.  Their relation is the contentversion id.  I tried flow and process builder but it's just not working...  I'm hoping that someone can help with a trigger.  Here is how it goes...
when
CustomObject__c.CustomCheckbox__c field gets set to = True
then
ContentVersion.CustomCheckbox gets set to = False

Thanks ahead of time to anyone who gives me a hand with this.
Sincerely,
Jerrod.
I have a trigger that is "supposed" to recheck a box only if there is a new version of a Content Document and only if the box has been unchecked.  I need to be able to uncheck this box and save the record so we can publish.  What it's doing right now is re-checking the box whether or not the version is <> '1' (I have even used >'1').  Can someone check this out and tell me where I might be mucking up the code?

trigger NotOnWebCheckbox on ContentVersion (before update) {
    for(ContentVersion cv: Trigger.new){
        If (cv.VersionNumber <> '1' || cv.Not_on_Web__c == false ){
           cv.Not_on_Web__c = true;
        }
    }
}

Thanks in advance, obviously there will be beer for Best Answer ;)
hi all,

i have a scenario where in i query an html email template and populate its merge fields in my apex class itself.
however,when i use the sethtmlBody() method,it renders an empty email.
So i have to comment the sethtmlbody() and go with setplaintextbody().

What can be the reason for this?
Also how do i use the setHtmlBody() along with setplainTextBody()?

Below is my code
 
public static void sendingEmail(String cid,String cname,String eventId)
    {
        String plainTxtBody='',startDate='',endDate='',scheduledDate='';
        String hbody='';
        Date sdate;

        //get the email template
        EmailTemplate template=[SELECT HtmlValue,Body FROM EmailTemplate WHERE          DeveloperName='Meeting_Reminder'];
        
        Event eve=[select subject,StartDateTime,EndDateTime,Owner.name,Owner.Email,Owner.Phone 
                    From Event where Id=:eventId];
                    
        hbody=template.HtmlValue;
        
        //setting the merge fields
        hbody=hbody.replace('{!Contact.Name}',cname);
        hbody=hbody.replace('{!Event.Subject}',eve.Subject);
         
        plainTxtBody=template.Body;
        plainTxtBody=plainTxtBody.replace('{!Contact.Name}',cname);
        plainTxtBody=plainTxtBody.replace('{!Event.Subject}',eve.Subject);
        
        //Construct the email message
        Messaging.SingleEmailMessage mail=new Messaging.SingleEmailMessage();
        mail.setTargetObjectId(cid);
        mail.setSaveAsActivity(false);
        mail.setSubject('Meeting Reminder');
        //mail.setHtmlBody(hbody);
        mail.setPlainTextBody(plainTxtBody);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});     
    }
Also can anyone explain why do we have to set the plaintextbody() even when the email template is of type html?

Any help is appreciated...

Thanks,