Answer to the Challenge: Answer to 1st question: List agg = [select SUM(Amount),CALENDAR_YEAR(CreatedDate) from Opportunity where (Amount != null) AND (StageName ='Closed Won' OR StageName ='Closed Lost') AND OwnerId= :UserInfo.getUserId() Group by CALENDAR_YEAR(CreatedDate)] ;
for(AggregateResult a:agg) { System.debug('Sum= '+(Decimal) a.get('expr0')); System.debug(' Year= '+(Integer)a.get('expr1')); } Answer to 2nd question: public static void fun2 (String firstDate,String SecondDate){ Date one = Date.valueOf(firstDate); Date two = Date.valueOf(SecondDate); List lst = [Select o.Name,o.CloseDate from Opportunity o where o.CloseDate > :one AND o.CloseDate < :two AND o.Owner.FirstName='Saurman' AND o.Owner.LastName='D\'souza' ]; for(Opportunity opp :lst) { System.debug(opp); } }
Hello Shrey, Thank you for the initiative! I am a Salesforce Certified Admin (2X). So these videos will be very helpful for me to start learning development. I have a doubt on one of the topic - SOQL Variable Binding. In the end why did we System Debug the conlist2 with the index 0? Than you!
SOQL1 - SELECT SUM(Amount), FISCAL_YEAR(CreatedDate) FROM Opportunity WHERE IsClosed=true AND Ownerid=: UserInfo.getUserId() group by FISCAL_YEAR(CreatedDate) SOQL2- String ownername='Saurman D\'Souza' SELECT Name FROM Opportunity WHERE CloseDate>=:firstDate AND CloseDate
I loved your admin videos and learned alot from them .. but after watching this one i'm a little disappointed .. I thought it would have more details and examples .. even the trailhead module has more content than this one .. please work on this
Hi Shrey, Kindly give us some updates regarding PD1 certification contents.
Start from 3:11
Thank you Shrey
Can anyone share Aman Pathak's answer for Day-2 Challenge here. I couldn't able to see his answer in comments
Hii shrey, can you start teaching Salesforce admin plz ..
Coming up a series for it. WIll be posted in 2 days
Hii Could upload video about design multiple assessments by configuring assessment questions.
Hi, I am waiting for SOQL challange, and I am very excited to win Salesforce hulk t-shirt 😊 .... please update challenge link.....
Really very useful... Thanks Shrey
Shrey can we have some salesforce videos with respect to testing and how can we automate tests for the business process. Thanks!
Will take this as the next topic!
Answer to the Challenge:
Answer to 1st question:
List agg = [select SUM(Amount),CALENDAR_YEAR(CreatedDate)
from Opportunity
where (Amount != null) AND
(StageName ='Closed Won' OR StageName ='Closed Lost')
AND OwnerId= :UserInfo.getUserId()
Group by CALENDAR_YEAR(CreatedDate)] ;
for(AggregateResult a:agg)
{
System.debug('Sum= '+(Decimal) a.get('expr0'));
System.debug(' Year= '+(Integer)a.get('expr1'));
}
Answer to 2nd question:
public static void fun2 (String firstDate,String SecondDate){
Date one = Date.valueOf(firstDate);
Date two = Date.valueOf(SecondDate);
List lst = [Select o.Name,o.CloseDate from Opportunity o
where o.CloseDate > :one
AND o.CloseDate < :two
AND o.Owner.FirstName='Saurman'
AND o.Owner.LastName='D\'souza' ];
for(Opportunity opp :lst)
{
System.debug(opp);
}
}
Hi Shrey, can you please dive little deeper into these topics .It would be a great help for all of us.
SOQL full form Salesforce Object Query Language sir
Hello Shrey,
Thank you for the initiative!
I am a Salesforce Certified Admin (2X). So these videos will be very helpful for me to start learning development.
I have a doubt on one of the topic - SOQL Variable Binding.
In the end why did we System Debug the conlist2 with the index 0?
Than you!
So that we can print the details of first index of conlist2 . The list can have more than one records but here we are printing only first record.
Mic ka issue solve karo yar
Noted
Bro i m waiting for this topic.... Thnks.
Challenge 1 : SOQL Answer
SOQL Assignemnet
Assignemnet 1:
String userid = userinfo.getuserId();
List agg = [SELECT SUM(Amount) ,CALENDAR_YEAR(CreatedDate)
FROM Opportunity
WHERE ownerId=:userid and (stagename='Closed won' or stageName='Closed Lost') group by CALENDAR_YEAR(CreatedDate)] ;
Map sumtoYear = new Map() ;
for(AggregateResult a : agg){
sumtoYear.put((Integer)a.get('expr1') ,(Decimal) a.get('expr0')) ;
}
System.debug('sumtoYear'+sumtoYear);
Assignemnet 2:
Public static void method2(date dateparam1,date dateparam2 )
{
List oppLst = [Select CreatedDate, Id, LastModifiedDate from Opportunity where CreatedDate >: dateparam1 and CreatedDate
SOQL1 -
SELECT SUM(Amount), FISCAL_YEAR(CreatedDate) FROM Opportunity WHERE IsClosed=true AND Ownerid=: UserInfo.getUserId() group by FISCAL_YEAR(CreatedDate)
SOQL2-
String ownername='Saurman D\'Souza'
SELECT Name FROM Opportunity WHERE CloseDate>=:firstDate AND CloseDate
I loved your admin videos and learned alot from them .. but after watching this one i'm a little disappointed .. I thought it would have more details and examples .. even the trailhead module has more content than this one .. please work on this
Thanks for the feedback, Farah!
I will try to make these live sessions more detail in the available time that I have.
Thank you sir
Y do u fumble so much 😄
Why does he go blank finding simple words ?
what you mean?
Its a natural thing bro...Happens for some