Skip to main content
September 8, 2025
Solved

Custom Record Field a!customFieldSum() - Not Handling Null Values

  • September 8, 2025
  • 3 replies
  • 0 views

HI all 

I have a record for sum insured values let's say he below:

id: Primary Key (QuoteID)

riskType1SumInsured: Aggregate field of all RiskType1 sum insureds

riskType2SumInsured: Aggregate field of all RiskType2 sum insureds

riskType3SumInsured: Aggregate field of all RiskType3 sum insureds

totalSumInsured: a!customFieldSum(riskType1SumInsured, riskType2SumInsured,riskType3SumInsured ) 

When all the risk type 1,2 and 3 sum insured values have a value (Not Null) the totalSumInsured works correctly, however as soon as one or many of the risk type 1,2 and 3 sum insured values are null, the totalSumInsured simply returns a null.

I have tried wrapping the risk type 1,2 and 3 sum insured values in the a!customFieldSum(), with a!defaultValue() as well is a!isnullOrEmpty(), but no change in behaviour.

Is there something i am missing?

Best answer by shubhama926776

Have you tried this

totalSumInsured: a!customFieldSum(
  a!customFieldDefaultValue(riskType1SumInsured, 0),
  a!customFieldDefaultValue(riskType2SumInsured, 0),
  a!customFieldDefaultValue(riskType3SumInsured, 0)
)


When you tried wrapping the fields with a!defaultValue() or a!isNullOrEmpty(), these functions aren't compatible with custom record fields that evaluate in real-time.

3 replies

shubhama926776
September 8, 2025

Have you tried this

totalSumInsured: a!customFieldSum(
  a!customFieldDefaultValue(riskType1SumInsured, 0),
  a!customFieldDefaultValue(riskType2SumInsured, 0),
  a!customFieldDefaultValue(riskType3SumInsured, 0)
)


When you tried wrapping the fields with a!defaultValue() or a!isNullOrEmpty(), these functions aren't compatible with custom record fields that evaluate in real-time.

September 8, 2025

Thanks Shubham - this has resolved the issue. Sometimes when you've stared at these things for too long you cannot see the wood for the trees. Thank you for the assistance

shubhama926776
September 8, 2025

I completely understand, I've been there too!