Please Login with your Salesforce ID to post, promote or comment.
Salesforce IdeaExchange
FAQs | Terms of Use8282 Ideas; Promoted 177409 Times; 17086 Comments.
- Suggest a New Product Concept
- Promote Ideas That You Want to See Developed
- Discuss With Product Managers and Other Users
- See What We Are Planning To Deliver
Apex and Visualforce Comments
| Apex and Visualforce Ideas
|
Force.com Platform Comments
| Force.com Platform Ideas
Enable Apex Code SOQL queries of fields not known at compile time
It is currently impossible to write Apex Code that will permit users to add fields to the database after the code has been written. You have to explicitly name all fields in the SOQL.
This is just about OK for code written by final customers, but horribly restricting for ISV developers. One of the big denefits of developing apps on the Salesforce platform is the easy customisability - and this blocks it. Apex Code can currently only be used with fixed data structures.
This could be done with a SELECT * FROM XXX statement. Or a way to inspect the metadata and build a query dynamically. The implementation doesn't matter too much - just to make it possible.
|
Scott_Jorgensen 09/26/07 |
You should be using the "Partner WSDL" if you're an ISV. You are correct that the "Enterprise WSDL" is specific to a particular Organization, but the "Partner WSDL" is identical across all Organizations. You can learn more about the Partner WSDL here: http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_quic.... |
|
cic 09/27/07 |
I am refering to Apex Code SOQL - not the API. |
|
Scott_Jorgensen 10/04/07 |
Aha!! I stand corrected. You've got a great suggestion: add the ability to have queries be dynamic in Apex just like the API does using the Partner WSDL. |
|
Rusty12 11/19/07 |
i'm sure there are a number of technical challenges to make this happen, but if implemented it would increase the power/potential of what type of Apps can be built w/ Apex Code by 10 fold. |
|
Wilmer 11/20/07 |
This could be very useful to developers to design and develop really customizable customer app and extend power of Salesforce. |
|
jholtz17 11/20/07 |
I second that! |
|
misterk17811122007 11/27/07 |
Agree. This would be a very powerful feature. |
|
billa 11/28/07 |
APEX is near worthless until this is done. |
|
megar@apprivo.com Jan 22 |
There is also a need for dynamic SOQL when field names are known. This is important for bulking up queries. There isn't any way to do this for queries where the IN operator can't be used. |
|
BobMorrell Feb 11 |
Agree with billa. This is a base line feature if this is to be considered a viable development environment. |
|
Siddharth Apr 21 |
I agree with megar, APEX should allow to build a dynamic query using the if else blocks. |
|
xn Apr 25 |
In short, you should be able to use a string as a soql query. |
|
TehNrd May 14 |
According to the summer08 release notes this should be marked as 'Coming Summer 08' |
|
Scott_Jorgensen May 19 |
TehNrd: This idea has made it to Developer Preview for Summer '08...so I think "Under Consideration" is more appropriate. Here are the details from the Release Notes: https://na1.salesforce.com/help/doc/en/salesforce_summer08_release_notes.pdf Dynamic Apex Dynamic Apex is composed of dynamic SOQL and SOSL queries, as well as dynamic DML. Dynamic SOQL and SOSL queries provide the ability to execute SOQL or SOSL as a string at runtime, while dynamic DML provides the ability to create a record dynamically and then insert it into the database using DML. Using dynamic SOQL, SOSL, and DML, an application can be tailored precisely to the organization as well as the user's permissions. This can be useful for applications that are installed from the AppExchange. For more information, see: Dynamic SOQL Dynamic SOSL Dynamic DML |
|
Scott_Jorgensen May 19 |
Changed status to Ideas Under Consideration. |
|
TehNrd May 20 |
Yup, I totally lapsed on that one. Thanks for clarifying. |
|
din Jul 6 |
Merged Idea
originally posted 05/06/07
Dynamic SOQL in Apex code
Allow dynamic SOQL in Apex Code. This will enable executing business rules dynamically based on user selections.
|
|
Wilmer Jul 22 |
Hi Scott, Well, now we're on Summer'08 and the truth is that unfortunately this feature has not been officially released because look what happened to us... 1) It was necessary to contact a support agent to turn it on in our Sandbox, 2) Finally, when we developed a new solution based on this new feature (which is very good in fact) we've been told ACTIVATION in production wasn't possible at this moment because there were some internal testing pending. So, we couldn't use it at all. Please, let us know when this could be possible. Thanks. |
|
chuckgoss02202008 Aug 6 |
Please make this generally available without restriction, so we can deploy it in our managed package! |
|
elinkbiz Aug 11 |
Merged Idea
originally posted Aug 7
Dynamic SOQL Support in APEX
The ability to dynamically generate and execute SOQL code in APEX. This feature would provide the following:
- Allow dynamic creation of stored proceedure like strings and execute - The ability to start creating resource bundles of SOQL code that can be reused easier throughout the application - The ability to introspect objects and create custom SOQL code based on object descriptions - This is EXTREMELY useful for Partners & Developers writing APEX applications - It could support auto-boxing between SOQL Code implementation today and SOQL String based implementations Example code snipet: String statement = 'select id, name from Account where name=blah'; Account [] accountList = SOQLService.execute(statement); |
|
tmatthiesen 3 days ago |
Changed status to Ideas Under Consideration. |
Please log in to post a comment
recently promoted by:
- arlon_wilber
- cool
- bradley_herman
- mark2008
- cv_sam
- elinkbiz
- rdoss
- ptognini
- cliffa
- chuckgoss02202008
- kyle_roche
- paul_rodibaugh
- Jakester
- Francesco23
- Wilmer
- killian_mchale
- EricB
- cmail04052008
- md1
- stuart_bernstein
- pedro_angulo
- werewolf
- J_Dub_Ya
- MicaiahF
- andrew_heinlein
- 10/10/2007_5:51
- bradymj
- anton_mochalin
- virago81
- padpaw
- rlucas
- vorno
- alex.lares@v2sa.com
- brian_wagstaffe
- craskulinecz
- soof
- bhuvana_subramanian
- jorgerbaker
- App_Dev1
- JimCRC
- xn
- 04/9/2007_20:14
- dotneteric
- mrudman01302008
- smillion@secure-res.com
- mark.litherland@grizzard.com
- yehuda_katz
- raver
- ejwilburn10092007
- Drew1815
- cberko
- mfriend01232008
- BobMorrell
- adab
- mulveling
- TehNrd
- jonathan_board
- megar@apprivo.com
- mPanning
- andreas_krebs
- ejw
- sridhar
- BenB
- billa
- misterk17811122007
- jdoran@copperkey.com
- Vijay_Raut
- justin_pizzala
- jholtz17
- nbanovic
- Rusty12
- ron_hess
- DevAngel
- silvia@mm
- mike_c
- sparky
- EQC_Admin
- gr
- hemm
- james2000
- Scott_Jorgensen
- AlexCRMmanager
- rflorig1
- cic
- BoolsEye
- din
recently demoted by:
- elessenger