• UserSFDX
  • NEWBIE
  • 80 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 0
    Replies
I want a trigger to do some dml of Lead Title should be mapped to Opportunity Name on conversion of lead.
Getting error while completing a trialhead challenge 
Error -> Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Contact_must_be_in_Account_ZIP_Code: [] 

Please help 
Create a trigger on account to Convert account rating to hot when it has more than 10 opportunities and half of the opportunity are closed won.
Trigger on account when rating is changed to hot update the reltaed opportunities amount by 50% .
Please help me to create a test class for this .

public class OpportunityController {
    
    public static void updateOpportunity(Id opportunityId, String newAccountName) {
        
        // Query the Opportunity and its associated Account
        Opportunity opp = [SELECT Id, AccountId FROM Opportunity WHERE Id = :opportunityId];
        Account acc = [SELECT Id, Name FROM Account WHERE Id = :opp.AccountId];
        
        // Update the Account name
        acc.Name = newAccountName;
        update acc;
        
        // Update the Opportunity's Account ID
        opp.AccountId = acc.Id;
        update opp;
        
    }
    
}

Thank you in advance !
Can someone suggest best Sources to start learning LWC please .
What is the difference between SSO and MFA ?
Please help me to complete a trailhead Challenge .