https://netsuiteprofessionals.com logo
n

Netsuite Tragic

05/03/2022, 9:44 AM
We have a long formula which returns an integer which will project forward a date field. When I have [formula] + {today} it works. Edit the formula [formula] + {lastorderdate} which is a valid, native date field on Customer the search immediate returns "An unexpected error has occurred. Please click here to notify support and provide your contact information." I used the {today} example to prove up that the formula works and returns the value as expected. I have tried wrapping TO_DATE({lastorderdate}). Any ideas?
CASE
WHEN COUNT(DISTINCT CASE WHEN {transaction.trandate} > LAST_DAY(ADD_MONTHS({today}, -14)) AND {transaction.trandate} <= LAST_DAY(ADD_MONTHS({today}, -1)) THEN CASE WHEN {transaction.type}='Invoice' THEN {transaction.number} ELSE NULL END ELSE NULL END)>35 THEN 7 ELSE 90 END + {lastorderdate}
g

George McMullen

05/03/2022, 10:50 AM
Perhaps it’s the mix between an aggregation (COUNT) and {lastorderdate}? Does the formula have a summary type on it?
You could try one of the following. • Add an aggregation to
{lastorderdate}
like
MIN({lastorderdate})
• Change
COUNT(
to
COUNT/*comment*/(
Or maybe there is a null value in one of the records for
{lastorderdate}
that you could fix with
NVL()
n

Netsuite Tragic

05/03/2022, 9:06 PM
@George McMullen thanks for the aggregate reminder. It didn't work. I made the formula result a custom field with an update script and moved on.