-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
3Questions
-
2Replies
Lightning Component Framework Specialist SuperBadge - Stuck at Step 6
Challenge Not yet complete... here's what's wrong:
The BoatDetails component's tabs shouldn't display if the component’s boat attribute is undefined. Either use the empty function or check for undefined.
what am I doing wrong. Please help
The BoatDetails component's tabs shouldn't display if the component’s boat attribute is undefined. Either use the empty function or check for undefined.
what am I doing wrong. Please help
- teeshu
- October 23, 2020
- Like
- 0
- Continue reading or reply
I am trying to create validation rule, when closing the case if product type and component and subcomponent is empty to fill the values.
I am trying to create validation rule, when closing the case if product type and component and subcomponent is empty to fill the values.
AND(
OR(
ISBLANK(TEXT(Product_Type__c)),
ISBLANK(TEXT(Component__c)),
ISBLANK(TEXT(Sub_Component__c))
),
ISBLANK(Account.Name) ,
ISPICKVAL( Status, "Closed"),
RecordType.Name = "Support Case").
I have given defalut value as None in picklist fields.
This doesnt detect the null value for picklist values, not able to figure out why. Can some one please help what I am doing wrong.
AND(
OR(
ISBLANK(TEXT(Product_Type__c)),
ISBLANK(TEXT(Component__c)),
ISBLANK(TEXT(Sub_Component__c))
),
ISBLANK(Account.Name) ,
ISPICKVAL( Status, "Closed"),
RecordType.Name = "Support Case").
I have given defalut value as None in picklist fields.
This doesnt detect the null value for picklist values, not able to figure out why. Can some one please help what I am doing wrong.
- teeshu
- January 15, 2020
- Like
- 0
- Continue reading or reply
Too many query rows: 50001 in trigger handler class
I am a beginner to SF coding. I am getting this error System.LimitException: Too many query rows: 50001 at line 17
my code is this, i am not sure why i am getting this error.
public class TransferTriggerHandler {
public static final string COMMENT_TRUNCATED_MSG = Label.Comment_Truncated_Msg;
public void OnAfterInsert(Transfer__c[] newTransObjects){
List<Case> caseList = new List<Case>();
List<CaseComment> caseCommentList = new List<CaseComment>();
Map<id,Case> caseMap = new Map<id,Case>([Select Id,Action_Owner__c,Action_Owner_Assignee__c,Minutes_Worked__c,accountId,account.ownerId from Case]);
boolean isPublish = false;
String comment;
for(Transfer__c trans: newTransObjects) {
comment = 'New Transfer :'+trans.Name;
comment += ' |Assigned Group:' + (trans.Action_Owner__c != null? trans.Action_Owner__c :' ') ;
comment += ' |Summary of Issue:' + (trans.Summary_of_Issue__c != null ? trans.Summary_of_Issue__c : ' ');
comment += ' |Customer Hardware Details:' + (trans.Customer_Hardware_Details__c != null ? trans.Customer_Hardware_Details__c : '') ;
comment += ' |Work Done So Far:' + (trans.Work_Done_So_Far__c !=null ? trans.Work_Done_So_Far__c : '');
comment += ' |Evidence/Supporting Details:' + (trans.Evidence_Supporting_Details__c !=null ? trans.Evidence_Supporting_Details__c : '');
comment += ' |Expected Next Actions:' + (trans.Expected_next_actions__c != null ? trans.Expected_next_actions__c : '');
comment += ' |Escalation Reason: ' + (trans.Escalation_Reason__c != null ? trans.Escalation_Reason__c : '');
if (comment.length() > maxCommentLength) {
//This comments is too long, we need to truncate it/
comment = comment.substring(0, maxCommentLength) + COMMENT_TRUNCATED_MSG;
}
Case c = caseMap.get(trans.case__c);
CaseComment cc = new CaseComment(CommentBody= comment, IsPublished=isPublish,ParentId= c.id);
caseCommentList.add(cc);
insert caseCommentList;
if(trans.Action_Owner__c =='Sales'){
c.Action_Owner_Assignee__c = c.account.ownerid ;
c.Action_Owner__c =trans.Action_Owner__c;
c.Minutes_Worked__c= trans.Minutes_Worked__c;
}
else{
c.Action_Owner_Assignee__c = null;
c.Action_Owner__c =trans.Action_Owner__c;
c.Minutes_Worked__c= trans.Minutes_Worked__c;
}
caseList.add(c);
}
try{
if(caseList.size() > 0) {
update caseList;
}
}
catch (Exception e){
System.debug('Failed in transfer trigger handler class insertion'+e);
}
}
@TestVisible private static integer maxCommentLength {
get
{
List<AddTransferFieldstoCase__c> tfc = AddTransferFieldstoCase__c.getall().values();
integer returnValue = 4000;
if (tfc.size() > 0) {
returnValue = (integer)(tfc[0].MaxCommentLength__c);
}
returnValue = returnValue - COMMENT_TRUNCATED_MSG.length();
if (returnValue < 0) throw new CommentConvertException('Maximum comment length is less than Zero. Check settings.');
return returnValue;
}
}
public class CommentConvertException extends Exception {}
}
my code is this, i am not sure why i am getting this error.
public class TransferTriggerHandler {
public static final string COMMENT_TRUNCATED_MSG = Label.Comment_Truncated_Msg;
public void OnAfterInsert(Transfer__c[] newTransObjects){
List<Case> caseList = new List<Case>();
List<CaseComment> caseCommentList = new List<CaseComment>();
Map<id,Case> caseMap = new Map<id,Case>([Select Id,Action_Owner__c,Action_Owner_Assignee__c,Minutes_Worked__c,accountId,account.ownerId from Case]);
boolean isPublish = false;
String comment;
for(Transfer__c trans: newTransObjects) {
comment = 'New Transfer :'+trans.Name;
comment += ' |Assigned Group:' + (trans.Action_Owner__c != null? trans.Action_Owner__c :' ') ;
comment += ' |Summary of Issue:' + (trans.Summary_of_Issue__c != null ? trans.Summary_of_Issue__c : ' ');
comment += ' |Customer Hardware Details:' + (trans.Customer_Hardware_Details__c != null ? trans.Customer_Hardware_Details__c : '') ;
comment += ' |Work Done So Far:' + (trans.Work_Done_So_Far__c !=null ? trans.Work_Done_So_Far__c : '');
comment += ' |Evidence/Supporting Details:' + (trans.Evidence_Supporting_Details__c !=null ? trans.Evidence_Supporting_Details__c : '');
comment += ' |Expected Next Actions:' + (trans.Expected_next_actions__c != null ? trans.Expected_next_actions__c : '');
comment += ' |Escalation Reason: ' + (trans.Escalation_Reason__c != null ? trans.Escalation_Reason__c : '');
if (comment.length() > maxCommentLength) {
//This comments is too long, we need to truncate it/
comment = comment.substring(0, maxCommentLength) + COMMENT_TRUNCATED_MSG;
}
Case c = caseMap.get(trans.case__c);
CaseComment cc = new CaseComment(CommentBody= comment, IsPublished=isPublish,ParentId= c.id);
caseCommentList.add(cc);
insert caseCommentList;
if(trans.Action_Owner__c =='Sales'){
c.Action_Owner_Assignee__c = c.account.ownerid ;
c.Action_Owner__c =trans.Action_Owner__c;
c.Minutes_Worked__c= trans.Minutes_Worked__c;
}
else{
c.Action_Owner_Assignee__c = null;
c.Action_Owner__c =trans.Action_Owner__c;
c.Minutes_Worked__c= trans.Minutes_Worked__c;
}
caseList.add(c);
}
try{
if(caseList.size() > 0) {
update caseList;
}
}
catch (Exception e){
System.debug('Failed in transfer trigger handler class insertion'+e);
}
}
@TestVisible private static integer maxCommentLength {
get
{
List<AddTransferFieldstoCase__c> tfc = AddTransferFieldstoCase__c.getall().values();
integer returnValue = 4000;
if (tfc.size() > 0) {
returnValue = (integer)(tfc[0].MaxCommentLength__c);
}
returnValue = returnValue - COMMENT_TRUNCATED_MSG.length();
if (returnValue < 0) throw new CommentConvertException('Maximum comment length is less than Zero. Check settings.');
return returnValue;
}
}
public class CommentConvertException extends Exception {}
}
- teeshu
- October 31, 2017
- Like
- 0
- Continue reading or reply
Lightning Component Framework Specialist SuperBadge - Issue with Step 6.
I am getting below error
but my application has
May I know why am not able to pass this challenge ?
but my application has
May I know why am not able to pass this challenge ?
- Inderjit Singh Waraich
- November 05, 2017
- Like
- 0
- Continue reading or reply