Expand my Community achievements bar.

SOLVED

Enumerations Label As Value In Query Filter

Avatar

Level 1

Dear,

    I'll describe my problem first. Enumerations comes from Salesforce synchronization. The useful values are Label and Internal Name. However, the values between the two are inconsistent. The database stores the value of Internal Name, but when I do Query, THE SQL splicing takes the Label of Enumerations as the condition to Query. Is there no transformation here?

jianghait960580_2-1606379404289.png

 

jianghait960580_1-1606379396708.png

 

   However, in the Schema, Enumerations syntax, the forwarding between Label and value can be implemented.

    

                         jianghait960580_0-1606379370750.png

 

I expect that enumeration can also achieve the effect of syntax in enumeration in schema.

 

Thanks,

Abel

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

There are 2 usages of db enums in schema:

  • userEnum - Use @label for everything, ignore existence of @name
  • dbEnum - Use @name for value, @label for display (your expectation)

 

Product doc is unhelpful and also wrong here, so use xtk:operator/@securityZone as a reference.

  • userEnum (string): receives the internal name of an “open” enumeration. The values of the enumeration can be defined by the user in the interface.
  • dbEnum (string): receives the internal name of a “closed” enumeration. The enumeration values must be defined in the <srcschema>. 

 

Thanks,

-Jon

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

There are 2 usages of db enums in schema:

  • userEnum - Use @label for everything, ignore existence of @name
  • dbEnum - Use @name for value, @label for display (your expectation)

 

Product doc is unhelpful and also wrong here, so use xtk:operator/@securityZone as a reference.

  • userEnum (string): receives the internal name of an “open” enumeration. The values of the enumeration can be defined by the user in the interface.
  • dbEnum (string): receives the internal name of a “closed” enumeration. The enumeration values must be defined in the <srcschema>. 

 

Thanks,

-Jon