Sync data between two tables of HP Service manager tool

Hello Experts,

I have two tables in HP SM tool...contacts and businessunit tables.

In contact table, I have 2 fields namely contact.name, manager...

In business table, I have same fields as like contacts table,,namely contact.name, manager..

 

Now what my requirement is,,,I need to sync data from contacts table to businessunit table...I mean I need to copy whatever data is there in contacts tables fields contact.name, manager  to businessunit table fields namely contact.name,manager...

 

Please suggest.

 

Thanks in Advance

 

Regards,

 

 

 

  • 1. Delete all the data in businessunit table

    2. go to search contacts and export the contact.name and manager field alone as txt file.

    3. load the exported data into the business unit table using the text import wizard

    4. But movin forrward when you add a new contact you have to create a JS to push the new value to business unit table as well by adding a on-add trigger.

     

    AB!

  • Hello Expert,

     

    Thanks for your response......

    Actually in my environment don't want load manually...they want it to be happen automatically load from contacts table to businessunit table..

    Could you please share the javascript if it is working for you to do automatically?

    Thanks in Advance

    Regards,

     

  • I think you misunderstood the previous poster.  There ISN'T a javascript out of the box that will do this for you.  They were suggesting that, via javascript and post-add/post-update/post-delete triggers, you can keep this data in sync.  Alternatively, you could try setting up a Cascade Update record to keep the data in sync.  Or you could even use post.fc within your formatctrl records to keep the data synchronized as you update the records.

    But it isn't something that exists fully formed.  HP doesn't know your custom tables and custom fields and custom requirements.  But, it is something that should be easy to build, using some fairly standard methods in HPSM.

  • I think you misunderstood the previous poster.  There ISN'T a javascript out of the box that will do this for you.  They were suggesting that, via javascript and post-add/post-update/post-delete triggers, you can keep this data in sync.  Alternatively, you could try setting up a Cascade Update record to keep the data in sync.  Or you could even use post.fc within your formatctrl records to keep the data synchronized as you update the records.

    But it isn't something that exists fully formed.  HP doesn't know your custom tables and custom fields and custom requirements.  But, it is something that should be easy to build, using some fairly standard methods in HPSM.

  • I think you misunderstood the previous poster.  There ISN'T a javascript out of the box that will do this for you.  They were suggesting that, via javascript and post-add/post-update/post-delete triggers, you can keep this data in sync.  Alternatively, you could try setting up a Cascade Update record to keep the data in sync.  Or you could even use post.fc within your formatctrl records to keep the data synchronized as you update the records.

    But it isn't something that exists fully formed.  HP doesn't know your custom tables and custom fields and custom requirements.  But, it is something that should be easy to build, using some fairly standard methods in HPSM.

  • Do anyone know how to create a on add trigger

    I want to backup eventoutm1 table to eventoutbkupm1 table using trigger

    The goal is whenever a row is inserted to eventout, i want it automatically inserted to eventoutbkupm1 too

    Thank for your help?

  • Hi Hoang 

    Go to db --> triggers , search table name as eventout and add a new trigger with type as "2-After Add". Try the bwelow script. 

    AB!

    function backupEmail(eventid)
    {
    var events = new SCFile(“eventout”);
    var bkEmail = new SCFile("emailbackups");
    var sql = “evsysseq=\”” eventid ”\””;
     
    if (events.doSelect(sql) == RC_SUCCESS)
    {
     
      if (events.evtype ==”email”)
       {
     
         bkEmail.evfields = events.evfields;
         bkEmail.evtype = events.evtype;
         bkEmail.evsysseq = events.evsysseq;
         bkEmail.evtime = events.evtime;
         bkEmail.doAction("add");
     
       }
     
      else
       {
        print("the event is not of type email");
       }
    }
     
    else
    {
     print("The sequence number doesnt exist");
    }
    }
     
  • The cascade update function is able to perform the function. 

    Access database manager, file cascadeupd (I think). You can configure it against the contacts table to update fields in other tables conditionally. Check the help server: you need to add a trigger for it to be invoked.