• Berta Rogers
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
 public static void updateJourneyStatus(Map<Id,Education_Request__c> newMap, Map<Id,Education_Request__c> oldMap){
        Map <  Id,  Education_Request__c > mapAccount = new Map < Id, Education_Request__c >();
        List < Account > listAccount = new List< Account >();
        
        for ( Education_Request__c acct : newMap.values() ) {
            
            if (acct.education_status__c != oldMap.get( acct.Id ).education_status__c && acct.education_status__c=='Completed'){
                mapAccount.put( acct.Id, acct );
            }
            if ( !mapAccount.isEmpty() ) {
                for  ( Education_Request__c edRequest : mapAccount.values() )  {
                    if(edRequest.education_status__c=='Completed'){
                        Account acc=new Account();
                        acc.Name=edRequest.Id;
                        acc.journey_stage__c='Psych Evaluation';
                        listAccount.add(acc);
                    }
                }
                update listAccount;
            }
        }
    }
I'm working on the process builder challenge, and I can't seem to get it to work. Any help would be greatly appreciated.
Challenge: You've been given a requirement to keep Contact addresses in sync with the Account they belong to. Use Process Builder to create a new process that updates all child Contact addresses when the address of the Account record is updated. This process: Can have any name. Must be activated. Must update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.
What I did:
1. All Contact validation rules were deleted.
2. Under process builder, Choose an object was set to Account (when a record is created or updated)
3. Under criteria: dummy name, selected when conditions are met, selected all 8 of the account shipping fields (isChanged, boolean true) and Any of the conditions are met.
4. Craeted a UPDATE action. Added fields Mailing street field reference with Account.shipping street, Mailing city ref with Acct.shippingcity, etc, etc.
So child (contact) mailing address will change when there is an update in parent(account) shipping address.
So when I check the challenge it doesnt accepting and thrown a message ""We updated the shipping address in an account record, but we can’t find the new address values in each child contact’s mailing address. Make sure the process is active"". 
I am sure that my process is active. I checked my all contacts mailing address, few contacts have mailing address few doesnt have. For few conatcts I added address( street, city, postcode, country,state). But so many contacts are exist. Does this affecting my challenge? How could I overcome this????

We are a University that uses Interactions for Student Recruitment to process new inquiries and applications into the system. The purpose is to create the appropriate Opportunity associated with the contact based on which division they are applying to. However, we are finding that there are a lot of Interactions that get "stuck" with an audit required and they always have the same error. This is the error:

"Reason: Error during Lead conversion - There was an error converting the lead. Please resolve the following error and try again:
sf4twitter.LeadConvertedTrigger: execution of AfterUpdate

caused by: System.DmlException: Update failed. First exception on row 0 with id 0033r00003lnaTaAAI; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: []

Trigger.sf4twitter.LeadConvertedTrigger: line 38, column 1. Reason: Interaction has an Opportunity Key, but could not find associated Opportunity in the system. Please verify that the Opportunity Key is valid."

I looked into the trigger that is mentioned and it seems to be from an old outdated managed package, Salesforce for Twitter. I have reached out to Salesforce support to see if removing the package would clear this error, but they said I'd have to reach out to the package owner, which I believe Salesforce is? Anyone ever seen this before?
I don't know what I am doing wrong. I've been working on the Animal Locator exercise in trailhead having to do with REST API Callouts and just can not get the result I'm working on to pass the 'Challenge'. My code is 100% tested, and it seems to meet all the criteria, but I keep getting the following message: "Challenge Not yet complete... here's what's wrong:
Executing the 'getAnimalNameById' method on 'AnimalLocator' failed. Make sure the method exists with the name 'getAnimalNameById', is public and static, accepts an Integer and returns a String."

Below is my code:

AnimalLocator.apxc (Class)

public class AnimalLocator {
    public static string getAnimalNameById(integer numSubmitted) {
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/' + numSubmitted);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        string replyName = 'None returned';
        if (response.getStatusCode() == 200) {
         replyName = response.getBody();
        }
            return replyName;
    }
}

AnimalLocatorTest.apxc

@IsTest
private class AnimalLocatorTest {
    @isTest static  void  testGetCallout() {
    // Set mock callout class
    Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock());
    // This causes a fake response to be sent
    // from the class that implements HttpCalloutMock.
    String animalname = AnimalLocator.getAnimalNameById(2);
    // Verify that the response received contains fake values       
    String expectedValue = 'Charles H Bones Esquire';
    System.assertEquals(animalname, expectedValue);
    }
}

AnimalLocatorMock.apxc

@IsTest
global class AnimalLocatorMock implements HttpCalloutMock {
    //Implement this interface method
    global HTTPResponse respond(HTTPRequest request) {
        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody('Charles H Bones Esquire');
        response.setStatusCode(200);
        return response;
    }
}

My code is saved and closed out of and the challenge still fails. Any suggestions would be greatly appreciated. Thanks!