SPELL CODE to Make ACT / EVT INTERNAL

From SDU
Revision as of 08:54, 31 January 2010 by Mitcr01 (Talk | contribs) (added a simpler way to accomplish the requirement)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The requirement is that whenever an event / activity is performed - e.g. SLA VIOLATION - then that activity should be logged as Internal so that Employees would not be able to view it. If new activities are added - e.g. UPDATE FIELD - to ticket (CR) who's SLA is already violated then log that activity as Internal. To achieve the above requiremtn I have written two mod and spel files.

  1. MOD File (zactint.mod)
MODIFY alg POST_VALIDATE zevt_set() 125 FILTER( EVENT("INSERT")) ;
  1. SPEL File (zactint.spl)

<source lang="javascript"> //method zevt_set() //Sets the EVENT of SDMr12.1 as internal =>1 //author: adi : adi_g001@yahoo.com //********************************************************

alg::zevt_set( ... ) {

      logf(SIGNIFICANT, "SPELL zevt_set %s",type.code);

if(type.code == "EVT") { send_wait(0, this, "call_attr", "internal", "set_val", 1,"SURE_SET"); if ( msg_error() ) {

     	logf(ERROR, "Error initializing object:%s",msg[0]);

return;

   	}

} logf(SIGNIFICANT, "SPELL zevt_set %s",internal); } </source>


Save the above files in $NXOOT/site/mods/majic folder and bounce the SDMr12.1 services.


--Mitu 01:54, 31 January 2010 (MST) Of course, it is much simpler to actually mark the 'Event Occured' Activity type as Internal from the Administration ('Notifications->Activity Notifications') and no customization is needed.