Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OnSave Record Deactivation

0 views
Skip to first unread message

Matt Pring

unread,
Jan 5, 2010, 1:07:02 AM1/5/10
to
Hi, I am trying to write a simple script in the OnSave event but cannot get
it to work.

We would like to automatically deactivate a record when a particular field
(date field) is populated and the record is saved.

Can anyone tell me, firstly if this is possible, and secondly what should
the script be?
--
Matt Pring

Dave Ireland

unread,
Jan 5, 2010, 11:20:57 AM1/5/10
to
Matt;
I think to script this, you would need to call web services from your
script - it is no longer a 'simple' script at that point. Any reason you
can't use workflow to change the status of the record? To me, that seems
like a simple solution, no coding involved.

Dave Ireland

"Matt Pring" <Matt...@discussions.microsoft.com> wrote in message
news:E0C7EC8A-BF4E-4D7B...@microsoft.com...

Patrick

unread,
Jan 6, 2010, 4:59:01 AM1/6/10
to
A script cannot do this as the OnSave event is fired before the save actually
occurs. The deactivate can (and must) only be done after the record is saved.

A workflow would indeed be the easy method to do this without coding.
However it can take several some time between the save and the record being
actually deactivated. After saving the record it will reopen as an active
record and users can still make modifications.
The safe method would be to create a post-create/update plugin which does
the deactivation, but this is a more complex approach.
--
Patrick Verbeeten (MCPD)
CRM/.NET Consultant
Aviva IT

Tools for CRM Developers and Administrators
http://www.patrickverbeeten.com/Tools.aspx

"Dave Ireland" wrote:

> .
>

0 new messages