0

I need to set the value of a currency(18, 0) filed to null.
I am using the following command to update the value of Annual_Potential__c field to null sfdx data:record:update -o ,myusername.@<sandbox_name> -s Account -i 001U000000mAt8kIAC -v "Annual_Potential__c=Null" --json

This fails with an error

"message": "Cannot deserialize instance of currency from VALUE_STRING value Null or request may be missing a required field at [line:1, column:2]", "name": "JSON_PARSER_ERROR",

I have tried Nan, 'NaN', null, Null , 'null', #N/A, '#N/A'
all fail
I can browse to the Account object Edit it in the UI and set its value to null by leaving it blank and clicking the Save button

How to do it in code or sfdx cli?

4
  • Can you try with this -> sfdx force:data:record:update -s Account -i <recordId> -v "Annual_Potential__c=null" ? Jun 30 at 13:12
  • Hi @SubratSrivastava I have tried Nan, 'NaN', null, Null , 'null', #N/A, '#N/A' all fail Jun 30 at 18:02
  • Is there a reason you need null instead of 0?
    – Phil W
    Jul 1 at 7:16
  • Yes there is business logic to evaluate non null values and populate a formula field, Potential, with HighPotential or LowPotential. For null values the Potential fields remains blank. Jul 5 at 0:10

0

You must log in to answer this question.

Browse other questions tagged .