You need to sign in to do that
Don't have an account?
put code in trigger, class or ???
Hi,
i have a piece of business logic, but don't know where to put it. It concerns the recalculation of leave entitlements.
If i put it in a trigger, it won't be available for me to use in a screen. For instance if i want to create a button 'recalculate leave entitlements' on a Visual Force page.
It seems to me that i have to put it in a separate class. This way i can call it from a trigger, and also from a Visual Force page (via the controller/extension).
But i also want to make sure leave entitlements are recalculated whenever i import data from for instance an Excel sheet.
What is my best option here?
Please advice.
Many thanks in advance!
if you use import function inside salesforce, you get an option to execute trigger on import, if you will call this function from the trigger, each record you import from excel sheet will also hit the trigger by selecting this option with import.
All Answers
Create a separate public class with this function, you can then call it either in VF page or in trigger.
But how can i use this code when i import data from an Excel sheet then?
if you use import function inside salesforce, you get an option to execute trigger on import, if you will call this function from the trigger, each record you import from excel sheet will also hit the trigger by selecting this option with import.
ok, that's what i needed to know.
Thanks a lot!
br, Marco
No problem, just a minor correction, the checkbox in import is for workflows not triggers. Triggers are by default fired on import.