• Gage Staruch 9
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

Hey everyone!

I'm trying to wrap my head around this apex class.

We've been trying to figure out what exactly is causing some tasks to auto-complete. I believe its this class, but not entirely sure as I havent worked with the database.batchable method. 

Could someone help me understand what this class does?

 

global class TaskRelatedToAssignerBatch implements Database.Batchable<sObject> {
    
    global Database.Querylocator start (Database.BatchableContext BC) {
		Date today = System.today();
        Date yesterday = today.addDays(-1);
        return Database.getQueryLocator('SELECT Id, WhoId, WhatId, CreatedDate FROM Task WHERE ((Status = \'Completed\' AND Subject LIKE \'Email:%\') OR RecordTypeId = \'0125A000000tbd5\') AND (WhatId = null OR WhatId_String__c LIKE \'001%\') AND WhoId != null AND CreatedDate >= :yesterday');
   }
    
    global void execute (Database.BatchableContext BC, List<sobject> scope) {
        TaskUtils.relateTasksToOpportunityOrAccount(scope);
    }
    
    global void finish(Database.BatchableContext BC) {}

}

Thank you!
Hello! I'm a newbie developer. I need to create a POST request to a specified URL that triggers from our process builder through an Apex class. Ideally, the body would be something like:
 
{
  "FName": "Jeff",
  "LName": "Test",
  "Email1": "Jeff@test.com",
  "Title": "Test",
  "Phone1": "2244363251",
  "Company": "Test",
  "Country": "US",
}
I've never done a POST request, so I am pretty lost. 

ANY help would be awesome! Even a basic template to get me started. 

Thanks all!


 
I am trying to put in a query for a value that is entered in a field on the visual force page. When the submit button is selected it will go through and query the contact data and match the email address on that to the text field that we have created on the vf page. Once it has found a match it will update the contact id on the case record and insert the data. 
 
public class attachController
{
    public case objcase{get;set;}
    public Attachment myAttachment{get;set;}
    public string fileName{get;set;}
    public Blob fileBody{get;set;}
    
    RecordType recordId = [SELECT Id FROM RecordType WHERE DeveloperName = 'Product_Case'];
    Id recId = (recordId != null) ? recordId.Id : null;
    
    Group queueId = [select Id from Group where Type = 'Queue' AND DeveloperNAME = 'Product_Support_Case_Queue' LIMIT 1];
    Id ownerId = (queueId != null) ? queueId.Id : null;
    
    Contact emailContact = [SELECT Id, Email FROM Contact WHERE Email = objcase.email__c LIMIT 1]
        id conId = (emailContact != null) ? emailContact.Id : null;
    
    
    public attachController(Apexpages.standardcontroller controller)
    {
        objcase = (Case)controller.getRecord();
        myAttachment = new Attachment();
    }
    public PageReference submit(){
        if (fileName != null){
            objcase.RecordTypeId = recId;
            objcase.ownerId = ownerId;
            objcase.ContactId = conId;
            insert objcase;
            
            myAttachment = new Attachment();
            Integer i=0;
            myAttachment .clear();
            myAttachment.Body = fileBody;
            myAttachment.Name = fileName ;
            myAttachment.ParentId = objcase.id;            
            insert myAttachment;
        } else {
            objcase.RecordTypeId = recId;
            objcase.ownerId = ownerId;
            insert objcase;
            
        }             
        pagereference pr = Page.thankYouForSubmittingYourProductCase;                          
        pr.setRedirect(true);
        return pr;
    }
}

 
Under Support, Ways to Give, and Annual Fund Giving, that content needs to be changed. If possible, 2017-18 needs to be changed to 2019-20, the word Candidates needs to be removed from the third bullet, and after the 11th bullet the word Chamber should be changed to Mosaic.
On our homepage, the slide that says Gift of Music Jazz Swing and Rock needs to be reversed with the slide that says Make a Impact Today.