Salesforce Apex Interview Questions & Answers

  Рет қаралды 3,202

Tech Journey With Ankit

Tech Journey With Ankit

Күн бұрын

Пікірлер: 43
@rangurajeevkumar1694
@rangurajeevkumar1694 3 ай бұрын
this ans is for Account a =[SELECT Name FROM Account WHERE industry='Energy']; ---->System.QueryException: List has more than 1 row for assignment to SObject --->reason--> storing list of records into single variable.
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Very good explanation
@gomathihariharan9464
@gomathihariharan9464 23 күн бұрын
Ankit, great content. Pls do create a video on the apex replay debugger. It would be really helpful.
@TechJourneyWithAnkit
@TechJourneyWithAnkit 22 күн бұрын
It's already on the channel
@Mucherlasivaji-z4y
@Mucherlasivaji-z4y 2 ай бұрын
tqq Ankit sharing informatic videos
@TechJourneyWithAnkit
@TechJourneyWithAnkit 2 ай бұрын
Welcome
@user-jb6cn9ej5m
@user-jb6cn9ej5m 2 ай бұрын
// Collect all Account IDs from the trigger Set accountIds = new Set(); for (Account acc : Trigger.new) { accountIds.add(acc.Id); } // Query all Contacts related to the Accounts in the trigger List conList = [SELECT Id, AccountId FROM Contact WHERE AccountId IN :accountIds]; // Process each Contact for (Contact con : conList) { // Your logic here }
@TechJourneyWithAnkit
@TechJourneyWithAnkit 2 ай бұрын
Very good
@sriharshithareddy7115
@sriharshithareddy7115 3 ай бұрын
1. DML Exception - Required Field Missing (LastName) 2. QueryException - No records returned or trying to assign more than 1 record to a singleton sObject Account variable.
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Correct
@kaustubhpatne6320
@kaustubhpatne6320 3 ай бұрын
In 1st scenario Where you iterate over accounts Mistake is that Dml statement used inside for loop So to overcome this use separate list and insert list outside for loop
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Very good
@SalesforceMiind
@SalesforceMiind 2 ай бұрын
Hi Ankit, 🙌 Kudos to you for all the good work you have been doing! . Could you please create a separate video for "Apex replay debugger" ?
@TechJourneyWithAnkit
@TechJourneyWithAnkit 2 ай бұрын
Sure will plan for it
@ravigrover1923
@ravigrover1923 3 ай бұрын
DMl Exception: Required Field(Last Name) is mIssing
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Yes correct
@vaibhavchaubey4748
@vaibhavchaubey4748 3 ай бұрын
Thank you sir 🙏
@mohd.arshad1315
@mohd.arshad1315 3 ай бұрын
Hi Ankit, You are doing a great job for the community, my request to you is that I can get the list of questions and answers you are preparing in the form of a PDF
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Thanks
@AnbalaganK-g8f
@AnbalaganK-g8f 3 ай бұрын
It may throw the query exception. More than one record to a singleton sObject variable.
@ravigrover1923
@ravigrover1923 3 ай бұрын
QueryList Exception : List has no rows exception, store it in a list
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Yes correct
@ravigrover1923
@ravigrover1923 3 ай бұрын
Set accSet = new Set(); for (Account acc : trigger.new){ accSet.add(acc.Id); // do some processing there } List conList = [SELECT Id,FirstName,LastName FROM Contact WHERE AccountId IN : accSet]; for (Contact con : conList){ // do some processing there }
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Any other better approach Ravi to avoid two loops
@janac7510
@janac7510 3 ай бұрын
Nice
@awesomekj5812
@awesomekj5812 3 ай бұрын
Curious ..have you done the video on Apex Replay Debugger ? Also for last question --> will you get LIST HAS NO ROWS FOR ASSIGNMENT TO SObject error ??? And we can fix it by converting that account instance to List
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Not yet, will plan for it.
@vaibhavchaubey4748
@vaibhavchaubey4748 3 ай бұрын
required field is missing in last question , cont.LastName
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Please tell me the name of exception
@rangurajeevkumar1694
@rangurajeevkumar1694 3 ай бұрын
​@@TechJourneyWithAnkit System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [LastName]: [LastName]
@naveenyalamala
@naveenyalamala 3 ай бұрын
Is it possible to call Batch class from a future call?
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
No
@abisheakramasamy5871
@abisheakramasamy5871 3 ай бұрын
How to get job as freshers in Salesforce developer
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Get admin skills strong and have sound knowledge of Apex and LWC. With overview of Integration
@mr.mrs.khandal9658
@mr.mrs.khandal9658 3 ай бұрын
Please create a vedio on apex reply debug.
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Sure I will plan for it
@darshanshanbhag7332
@darshanshanbhag7332 2 ай бұрын
@@TechJourneyWithAnkit Even I am expecting a video on Apex replay debugger. So, Kindly make a video on that as well. Thanks in Advance
@bbk9988
@bbk9988 3 ай бұрын
Nice video 👍 waiting for the videos on triggers batch apex and other concepts 😊
@kishorey7335
@kishorey7335 3 ай бұрын
set accId=new set(); for(Account a:trigger.new){ accId.add(a.Id); } list conlist=[select Id,AccountId from contact where AccountId in:accId]; for(contact con:conlist){ }
@sriharshithareddy7115
@sriharshithareddy7115 3 ай бұрын
for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :Trigger.New]{ for(Contacts con : a.Contacts){ //Some contact processing } }
@TechJourneyWithAnkit
@TechJourneyWithAnkit 3 ай бұрын
Correct
@SalesforceMiind
@SalesforceMiind 2 ай бұрын
@@TechJourneyWithAnkit Nested for loop is not a part of best practices
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 41 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 94 МЛН
Family Love #funny #sigma
00:16
CRAZY GREAPA
Рет қаралды 17 МЛН
Salesforce Apex Interview Questions & Answers #salesforce #apex #interview
37:35
Tech Journey With Ankit
Рет қаралды 2,8 М.
Salesforce Developer 4+ Years of Experience
38:13
Salesforce Helping Hand
Рет қаралды 8 М.
Apex Triggers | EXPLAINED | Salesforce Makes Sense
53:57
Salesforce Makes Sense
Рет қаралды 34 М.
How to debug Apex Code in salesforce #salesforce #apex
23:53
Tech Journey With Ankit
Рет қаралды 2,1 М.
Salesforce Apex Interview Questions & Answers #salesforce #apex  #interview
25:14
Tech Journey With Ankit
Рет қаралды 3,6 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29