Highlighted
Absent Member.. Absent Member..
Absent Member..
622 views

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,

 

 

 

0 Likes
6 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Sync data between two tables of HP Service manager tool

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!

Kindly assign kudos if the post is helpful!
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Sync data between two tables of HP Service manager tool

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,

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Sync data between two tables of HP Service manager tool

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.

0 Likes
Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..

Re: Sync data between two tables of HP Service manager tool

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?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Sync data between two tables of HP Service manager tool

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");
}
}
 
Kindly assign kudos if the post is helpful!
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Sync data between two tables of HP Service manager tool

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.

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.