Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have a visualforce page that updates a custom object. After the update an email is sent to a related contact. I have to add a checkbox to the page with which the user can choose to send the email or not. Do I have to create a new custom field on the custom object, save the value of the checkbox, and check that field in the trigger that sends the mail, or is there another way (preferably without a new custom field)?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You could use a static property on the visualforce controller (or another Apex class). The value that is set would be available for the duration of the transaction and thus accessible to the trigger. However, once the transaction has completed you would have no visibility that the user ever checked the box, which, from your description, sounds like it wouldn't be a problem.

share|improve this answer
    
Wow, I did not expect this to work (no offence, of course). Great! Thanks! –  Lex Jan 16 '13 at 8:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.