-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fflib_QueryFactory support for toLabel()? #163
Comments
Anyone? |
Sorry @dudunato for the delayed response. I don't see a way of doing this currently no. @capeterson and proposals on the best API design to accomplish this, maybe overload the select method with a boolean param 'toLabel' ? |
Thanks for the reply @afawcett! Wouldn't it be better if we would have the option on a field level? Or even Idk, just ideas! |
Yes, your second idea is the one i was suggesting actually. Though your first is more flexible, it just means the query factory cannot validate the field as its an expression being passed. |
Is there already a solution for this? I'm trying to get the label of a Data Category in a subquery on Knowledge Articles. |
HI @tomjansen13, I don't think this solutions was implemented. What I ended up doing was to use replace() function after building up the whole query. Super ugly, but... ¯_(ツ)_/¯ |
Hi @dudunato Thanks for the 'solution'. I guess this is better than nothing at all! |
I was actually working on a similar requirement and I believe you can specify an alias to the field. SObject.get('') gives you the correct answer. Example
I am guessing it must be possible to add an alias to a toLabel field somewhere. |
Suggested PR change to allow toLabel within the fflib framework can be found here: #258 |
Is there a way to use QueryFactory and get the translation for a picklist? Like:
The text was updated successfully, but these errors were encountered: