But I still gave it a shot and checked blank value before creating json input...
Although the code saved, I am getting an "Internal Server Error, Status Code= 500" everytiime I lauch the callout.Does any one have an idea how I can make the blank value as ' ' and not as "Null".Any help is appreciated.Thanks!@InvocableMethod
public static void postAccountToSystem(List<Id> acctIds){
Account acc = [SELECT Name,Display_Name__c,
Bio_URL__c,Image_URL__c
FROM Account WHERE Id = :acctIds[0]];
if(acc.Display_Name__c == NULL){
acc.Display_Name__c = '';
}
if(acc.Bio_URL__c == NULL){
acc.Bio_URL__c = '';
}
if(acc.Image_URL__c == NULL){
acc.Image_URL__c = '';
}
String jsonInput = '{\n' +
' "displayName" : "'+acc.Display_Name__c+'",\n'+
' "bioUrl" : "'+acc.Bio_URL__c+'",\n'+
' "imageUrl" : "'+acc.Image_URL__c+'",\n'+
System.enqueueJob(new QueueableCall(jsonInput, acc.Id));
}
Thanks enForcer for the response.But even your code is doing the same thing I did with for loop.Either way the error persists.. statuscode=500.