05-30-2010 11:10 PM
I have never writting a plug in before, and I am looking to write small simple one.
Bascially I have a custom field in the opportunity panel, when user hit 'save' button for opportunity; if the value of this custom field is 'A', lets the system save as normal. if custom fields is 'B', display MessageBox and do not save.
How do I capture the save event? any help would be appreciated.
06-01-2010 08:11 AM - edited 06-11-2010 06:34 AM
Opportunities have an Updated event that you could monitor.
06-01-2010 05:19 PM
Just a suggestion - instead of a plugin you might want to consider implementing this as a custom control. You can write a control that self validates or tests for value on exit. Check out the Dynamic Label Control I posted on devnet downloads for a conceptual example of this. It shows how you can test for values of a field then change the control based on those values. You will need to write your own field write-back if you use that control as an example, but that's not especially difficult.
There's another example called Opportunity example control I believe on devnet downloads that shows a custom control for Opportunities in ACT! 2010 or higher - you need to use the IMutableEntity interface for Opportunities so that's a good example of that.
06-10-2010 11:11 PM
06-11-2010 06:44 AM
I'm thinking that when the save buttons is hit may not be the best event to monitor, there is an Upated event but I'm not sure how we'd halt the commit at that point.
We can capture the currentOpportunity from the application state and then monitor your field for changes.