You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Using Count Function in Custom Object

edited Jun 24, 2024 4:58AM in Sales 1 comment

Hello,

I have an inquiry about using the "Count" function in the expression builder for a custom object. The case is explained below: I have created a custom object named "APP_POC" with a few fields, one of which is named "Sequence" and is of type "number".


We want to default the value of this field and use it as a separate sequence when the record is created.

I tried to write the below script (in default expression) to generate the sequence:


"if(OBJECTNAME.count('FIELDNAME') == 0)

return 1

else

return nvl(OBJECTNAME.max('FIELDNAME'),0) + 1"

but when I entered the name of the custom object, I got an error message saying that it was not identified. When I tried to select it from the function form, I couldn't find it. Can you please help me with this issue?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!