You need to sign in to do that
Don't have an account?
Use of classes with Custom Objects
Hi,
I'm wondering what the best approach is when developing an application with custom objects & classes.
We created custom objects and would like to create some kind of assistance class for each object.
Example:
- custom object car: Car__C
- we need custom methods for the creation and deleting (createCar, removeCar)
- but also for changing (example: addTyre(4); )
Has salesforce something standard to support us? Do we need to create those classes ourselves (with the possibility of a static call)?
Or do salesforce has something built-in where we can add methods to custom objects? If so, are there already methods we can call on custom objects?
What is the best approach?
Kind regards,
Bruno
When you create a custom object, you do have standard functionalities available with it like New, edit, delete. You can use these for your cars object to create a car(using New), modify a car (using Edit), remove a car (using Delete). However this will behave exactly in the same manner as your standard objects New, Edit or delete works. When you want to over ride the standard functionality provided by salesforce you need to create classes/pages or override standard buttons like New, EDIT, Delete etc.
The trigger acts a dispatcher and calls the specific method on the static class to process the request. I also pass the trigger context variables to the methods.
Regards,
Satish Kumar
Thanks for the replies!
We will proceed in this way.