You need to sign in to do that
Don't have an account?
Dan Dodd 3
Import Case Data loader Trigger.caseTrigger: line 11
I am getting this error when I import the csv below.
Where do I find Trigger.caseTrigger?
And/Or what are are the minimum fields to insert a record
Imported CSV:
Where do I find Trigger.caseTrigger?
And/Or what are are the minimum fields to insert a record
caseTrigger: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.caseTrigger: line 11, column 1
Imported CSV:
"OWNERID","CREATEDDATE","DESCRIPTION","ORIGIN","PRIORITY","STATUS","SUBJECT" "00G1U000002xbviUAA","2019-07-21","Seven Twenty","EMAIL","Medium","New","New subscription renewal order."
Seems like you are missing few mandatory fields on insertion of Case object.
Try below code to execute in anonymous block in your org it will give you list of mandatory fields.
Schema.DescribeSObjectResult r = Case.sObjectType.getDescribe();
Map<String,Schema.SObjectField> M = r.fields.getMap();
for(String fieldName : M.keySet())
{
Schema.SObjectField field = M.get(fieldName);
Schema.DescribeFieldResult F = field.getDescribe();
Boolean isFieldreq = F.isNillable();
System.debug('Required field' +fieldName);
}
Review below article regarding fields information on case.
https://help.salesforce.com/articleView?id=cases_fields.htm&type=5
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
All Answers
Seems like you are missing few mandatory fields on insertion of Case object.
Try below code to execute in anonymous block in your org it will give you list of mandatory fields.
Schema.DescribeSObjectResult r = Case.sObjectType.getDescribe();
Map<String,Schema.SObjectField> M = r.fields.getMap();
for(String fieldName : M.keySet())
{
Schema.SObjectField field = M.get(fieldName);
Schema.DescribeFieldResult F = field.getDescribe();
Boolean isFieldreq = F.isNillable();
System.debug('Required field' +fieldName);
}
Review below article regarding fields information on case.
https://help.salesforce.com/articleView?id=cases_fields.htm&type=5
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
Thanks .. this helps a lot.
the results were a little confising until I tweaked the output.
Good that it helped you.
Please mark as Best Answer if information was helpful so that it can help others in the future.
Thanks,
Vinay Kumar
This helped me find non-nillible fields but I still have the original issue : I'm using more fields now, all of those that were not nillible.
But still get same error
Try to check line 11 in trigger and try to use null point check.
Eg:-
if (case.Sourcelement__c) == 'X0')
Try to add null check.
if (case.Sourcelement__c) !=null') && if (case.Sourcelement__c) == 'X0')
Hope this will help you.
Thanks,
Vinay Kumar
You should find under Object Manager--->Case--->Triggers.
You can deactivate trigger and insert records using dataloader if you do not want to make any changes to your logic.
Thanks,
Vinay Kumar
Please mark as Best Answer if information was helpful so that it can help others in the future.
Thanks,
Vinay Kumar
Thanks,
Vinay Kumar