Skip to main content
Question

Accessing a Custom Enumeration using expression

  • April 23, 2024
  • 5 replies
  • 140 views

Forum|alt.badge.img+3
  • Do Gooder (Partner)
  • 9 replies

Hi,

 When creating custom attributes, for inbuilt enumerations, I can use:

enumeration_name_Api.decode(‘db_value’);

 

But when I create a custom enumeration and try to use the same expression, it gives me errors.

Any idea on how to access a custom enumeration using a statement?

Error:
CUSTOM_ENUMERATION_API"."DECODE": invalid identifier

 

Please help

5 replies

Mayura Wasantha
Superhero (Employee)
Forum|alt.badge.img+19
  • Superhero (Employee)
  • 504 replies
  • April 24, 2024

shared with @deshan.ekanayake @Pushpa Veerappan @Jitharie @Madawa Boragolla - Please try to answer Kalindu 🙂.


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Partner)
  • 9 replies
  • April 24, 2024

Hello Mayura!!!!! :)
Really nice to hear from you!  


Thank you!
 


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Partner)
  • 9 replies
  • April 24, 2024

Hello, 
 Nevermind, I figured it out. It should be:
enumeration_name_CFP.decode(‘db_value’);

 

Thank you!


Mayura Wasantha
Superhero (Employee)
Forum|alt.badge.img+19
  • Superhero (Employee)
  • 504 replies
  • April 25, 2024

Hello Mayura!!!!! :)
Really nice to hear from you!  


Thank you!
 

🙂🙂


Forum|alt.badge.img+4
  • Sidekick (Customer)
  • 8 replies
  • June 6, 2024

I’ve used something like:

select db_value from CUSTOM_FIELD_ENUM_VALUES

where lu = 'CUSTOM_ENUM_NAME'

Replacing “CUSTOM_ENUM_NAME” with the actual name of the enumeration. Nice and simple. There’s probably a more elegant way using an API, but..