function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jburns12jburns12 

Apex Custom Object

I have a button which pulls the next lead from a queue and assigns to current user...I am trying to modify this to work with a custom object, how do i access the object?

 

 

  //Find an open lead that is assigned to one of those queues
            List<Lead> leads = [select l.Id,l.OwnerId from Lead l where 
                                                        l.IsConverted=false 
                                                        and l.OwnerId in :listGroupIds 
                                                        limit 1 
                                                        for update];

 

 

  //Find an open lead that is assigned to one of those queues

            List<Lead> leads = [select l.Id,l.OwnerId from Lead l where 

                                                        l.IsConverted=false 

                                                        and l.OwnerId in :listGroupIds 

                                                        limit 1 

                                                        for update];

 

 

Please help!

 

JB

Chris JohnChris John

Custom Objects are referenced with the '__c' at the end of the Object Name.

 

E.g. a custom object 'MyObject' is referenced as 'MyObject__c'.

jburns12jburns12

thank you, i was aware of this...i have now gotten the code to work as follows:

 

//Find an open lead that is assigned to one of those queues
            List<Landing_Page_Lead__c> leads = [select Id,OwnerId from Landing_Page_Lead__c  l where 
                                                        hasbeencalled__c=false 
                                                        and l.OwnerId in :listGroupIds 
                                                        limit 1 
                                                        for update];

 

I do not want to package this apex class as the custom objects already exist in production, how do I transfer just the class to production?

Chris JohnChris John

I'm assuming your working in a Developer / Sandbox org?

 

You can use the force.com IDE to deploy code from these Orgs to Production:

 

http://wiki.developerforce.com/index.php/Deploy_Force.com_Applications_Faster

jkucerajkucera

Note to transfer to production you'll need code coverage of 75%.  That means you'll need a test method (code that runs your code to verify it works).

 

http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods