You need to sign in to do that
Don't have an account?
Possible to run APEX with user-selected options?
Fairly new to APEX, and just wasn't really sure on where to even start looking for this. Also haven't had a chance to learn any Visualforce, yet.
Is it possible to create APEX code that runs based off of what a user selects from a list of options? For example, say I had a batch setup that automatically does some stuff with Opportunities in a custom object. Is there anything I can put into that batch to make it so the user can select, before it runs, to only look at certain types of Opps?
Essentially, I'm wondering if I can set the code up so that when it queries, for example, Opps, it selects the needed fields from Opp where Type equals *whatever types user selected*.
I don't believe you are referring to Apex Batchable context. You can have dynamic queries. You need to build your query string based upon the parameters the user enters then query with the string built.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_soql.htm