You need to sign in to do that
Don't have an account?
AnantGarg
FATAL_ERROR System.NullPointerException: Argument cannot be null.
I am here working on 'Product2' sObject where I have created a custom field mynamespace__post_id__c. Now with a piece of code, I am trying to update this post id. For a short brief of it please see the code.
productId = '01t0v000003SFQYAA4'; list<Product2> pro = [Select Id, Name, IsActive ,mynamespace__post_parent__r.mynamespace__post_id__c,(Select Id,Pricebook2Id,UnitPrice from PricebookEntries),mynamespace__post_id__c from product2 where Id =:productId]; string postId = 20; pro[0].mynamespace__post_id__c = Integer.valueOf(wooId.trim()); try { List<Database.SaveResult> updateResults = Database.update(pro, true); System.debug(updateResults); // This is giving result as (Database.SaveResult[getErrors=();getId=01t0v000003SFQYAA4;isSuccess=true;]) } catch (Exception e) { System.debug('exception in product update: '+e.getMessage()); }Now as the try block is showing isSuccess as true, the object is not getting updated. Also, the log is showing up a FATAL_ERROR. Can anyone help out where am I going wrong
Check it out.