My JSON is as follows :-
{
"ok":false,
"status":400,
"statusText":"Bad Request",
"body":{
"message":"An error occurred while trying to update the record. Please try again.",
"statusCode":400,
"enhancedErrorType":"RecordError",
"output":{
"errors":[
],
"fieldErrors":{
"Product_L2__c":[
{
"constituentField":null,
"duplicateRecordError":null,
"errorCode":"FIELD_CUSTOM_VALIDATION_EXCEPTION",
"field":"Product_L2__c",
"fieldLabel":"Product L2",
"message":"Product L2 is required"
}
]
}
}
}
}
I want to get the errorCode(FIELD_CUSTOM_VALIDATION_EXCEPTION)
& message("Product L2 is required")
from this JSON.