Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
759 views

What's the trick to adding activity actions to a new table?

We're running SM 9.50. 

I'm trying to drop in an activity action subform like in a lot of OOB forms (SDs, IMs, etc.) on a new table and have it record the changes to that record. But I haven't got it to work yet. 

  • I've put the activity.list subform on the new form. 
  • Changed the input to the new count field on the form itemId.vj (I think this is where the issue is)
  • and created a new Activity Action record for that table. 

Am I missing anything? Or is there any documentation on this area?

0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

Re: What's the trick to adding activity actions to a new table?

You need to add rules to the workflow of your object.
Compare with an example :
System Administration - Service Desk - Configuration - Workflows
select workflow "ServiceDesk"
Edit Workflow Properties (on top of the window)
Workflow Based Rule Sets - On update
Rule Set "sd.journalUpdate"

This calls at the end a Javascript:
lib.sdUtil.journalAction(record, '$update.action');

Screenshots are from SM9.62 but SM9.50 should be similar.

Thank you for using the MicroFocus ServiceManager Support and News Forum. If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: What's the trick to adding activity actions to a new table?

Thanks for the quick reply! 

What if i'm not using a workflow with the new table? I guess I would just have to trigger that script

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: What's the trick to adding activity actions to a new table?

I'm afraid that it's not simply calling that JavaScript from trigger. 

Look at the ScriptLibrary code "sdUtil" , function journalAction(record, actionVar, actionType) 

it's designed for Problem/Change/Request/Incident Updates. It will not work for your customized table. 

You might create your own JavaScript Code to get journal actions on customized tables. 

Thank you for using the MicroFocus ServiceManager Support and News Forum. If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: What's the trick to adding activity actions to a new table?

What we have documented is the Auditing:

https://docs.microfocus.com/itom/Service_Manager:9.64/ASAuditTrail
https://docs.microfocus.com/itom/Service_Manager:9.64/AuditProcessing
https://docs.microfocus.com/itom/Service_Manager:9.64/InvokeAuditingFromFormatControl

Thank you for using the MicroFocus ServiceManager Support and News Forum. If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..

Re: What's the trick to adding activity actions to a new table?

Hi. 

I have created couple new tables and added activity logging to them like this:

1. create new table like "activitynewmodule" ( replace *newmodule* with table name you want activity logging ) analogue to "activitydevice" with dbdict.
2. create new trigger for newly created "activitynewmodule" table. Lets call it  "activitynewmodule.pre.add". Make it similar to activitytcrectask.pre.add that assigned to "activitydevice" table. You can view it under "Sysdefinition >Tables - tablename ->triggers" .
3. add new record to number table (from Tailoring>Tailoring Tools>Sequential Numbers). Under class field add table name you choosed for activity record and "Last Record" to 0, for example "activitynewmodule". You can make it again similar as "activitydevice".
4. execute command db and table: activityactions. You need add two actions - one for adding and other for updating record. You can look how it done for "device" table. Create logging conditions.
5. add alias field for your custom table primary key, for example id.. You will be using this alias field as input for subformat in you main format.
6. Then you need add link line for your custom table, that reference previously created alias field to "activitynewmodule" number field
7. create subformat that displays "activitynewmodule" fields or use activity.list.g
8. add subformat to main format. Use alias created in input field and format from previous step. 

9. add "Activity log table" name under your created table Object record

I hope that I didnt missed some steps.

Here some screens to illustrate some steps:

Step 1 and 2 can be done exactly as for activitydevice:

Mart_9_0-1585141483094.png

number record:

Mart_9_1-1585141621322.png

activityactions:

Mart_9_2-1585141739683.png

link line:

Mart_9_3-1585141920467.png

update object record:

Mart_9_0-1585142828479.png

 

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.