function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nahian IslamNahian Islam 

Populate blank value for percent field

I am in Setup>>Create>>Objects>>MyCustomObject>>PercentField(Value_c).

I have a validation set for this percent type field: Value_c< 0 ||  Value_c> 1.0 for which It displays error if this condition satisfies.

My Problem:

Whenever there is a 'blank' value sent to Value_c, it automatically reflects as 0%.
I want it to reflect as a simple blank in the field.

Please Guide!

 

ShivaKrishna(Freelancer)ShivaKrishna(Freelancer)
Hi Nihian,

Yeah, It takes that as 0 I guess. better you make default value as null in field attributes and also in code if you are setting blank anywhere. Null will be treated as null unlike blank as 0.

let me know, if it helps you :)

shiva.sfdc.backup@gmail.com
Nahian IslamNahian Islam

@Karthikyen... Default value is empty.

@Shiva Krishna..

Can you guide me with the formula that i need to put in the formula field in order to do so?

Nahian IslamNahian Islam
@Karthik ..It is a Percent field, and we don't have that option 'Blank Field Handling' available
sfdcMonkey.comsfdcMonkey.com
are you work with object  validation rule or work on apex code ?
Nahian IslamNahian Islam

@Karthik...Custom Object

User-added image

Nahian IslamNahian Islam
@piyush.. not validation.. I am working on the custom field itself.. Validation comes with error messages. I don't want that.
sfdcMonkey.comsfdcMonkey.com
try this onces
Value_c != null && (Value_c < 0 ||  Value_c > 1.0)
Thanks
Nahian IslamNahian Islam

This is for validation right?

I just want this:

If the input is a 'blank' .. then the field should reflect 'blank' and not a '0'

What should I put in the formula section of this PerctntCustom Field to achieve this?

Nahian IslamNahian Islam
I am still stuck with this issue.. Any suggestions will be appreciated!
Raja Velmurugan 5Raja Velmurugan 5
Hi @Nahian, did you get a solution for your problem? I'm stuck at the same issue. Please guide.