
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I am trying to add activity to device table according to knowledge document as in below thread.But activities are not adding to activity table.I am using activitydevice table to log the activities for device.
I have seen lots of thread on forum and from document itself, it says that sc.activity RAD(use to add activity to table) is OOB called if se.base.method is called. But it is not happening.
Then I tried to add sc.activity in corresponding DO and FC as per below thread and document but no luck.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1443183
Also from RAD debugger trace it seems that no activity table found in object record when calling the RAD(RAD: sc.activity in panel decide.use.module).But I already defined it.
Any help will be appreciated.
Regards,
Tushar
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Any one have some clue on this..
I am using SMv7.03
Regards,
Piku
Assign Kudo, if found post useful and mark it accepted if solves the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Any one please.
Thanks,
Assign Kudo, if found post useful and mark it accepted if solves the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Thanks for your wonderful document.It worked as stated.
But I am facing a problem, since in our we usually change the logical name also so audit history will not be visible in that case.
Do you have any solution to this issue?Does device table have any other unique number or field?
It means I would not be able to see audit history if I will change unique field value(becoz only logical name is unique filed in device table to identify device record)
However I am still looking for the solution to my actual problem i.e. why activity are not logging in activitydevice table.
Thanks,
Assign Kudo, if found post useful and mark it accepted if solves the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Can you tell me how r u trying to store the activity in activitydevice table. I mean what all things u have done in order to store activity into the activitydevice table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
1) dbdict "activitydevice" created
2) created "activitydevice" form with file name "activitydevice" (Note: in your link, the file name of "activitychange" is "cm3r". Is it rather "activitychange" file instead of "cm3r"?)
3) created "activitydevice" in number file
4) "activitydevice" in notebook tab "Activities" of device Object (Document Engine)
5) Added the following two actions: (in "activityaction"/device table)
1. Name:Open
Condition:$L.mode="add"
Description:{"Device " + logical.name in $L.file + "added"}
2. Name: Update Activities
Table: device
Mode: update
Condition: $L.mode="update"
Details:
Name: Change Status
Condition: not same(istatus in $L.file,istatus in $L.file.save)
Description: {"State of the device changed from" + istatus in $L.file.save + "to" + istatus in $L.file}
6) Added "activitydevice.pre.add" trigger in device table.
I also called the sc.activity application with the parameters you mentioned in the link (cm3r being replaced by device).
Now, when I change the status of a device, nothing is written to activitydevice table. It does not work.
as in follow thread
http://www.sc-resources.net/threads/2533-Device-activity-(history)-in-SC6?highlight=activitydevice
I also tried to call sc.activity in device FC
and in DO of save but no success at all.
Thanks,
Assign Kudo, if found post useful and mark it accepted if solves the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
I had similar kind of requirement for OCML. I did with the help of javascript.
function create_activity2(nameTabAct,itemNo,typeAct,descAct,visible)
{
var now = new Date();
var future = new Date(2199,12,31,17);
var delta = future -now - (30*86400000);
var days = String(parseInt(delta/86400000));
var hours = String(parseInt((delta - (days*86400000))/3600000));
var minutes = String(parseInt((delta - (days*86400000) - (hours*3600000))/60000));
var seconds = String(parseInt((delta - (days*86400000) - (hours*3600000) - (minutes*60000) )/1000));
var negdatestamp = new XMLDate( "P"+days+"DT"+hours+"H"+minutes+"M"+seconds+"S");
var fAct = new SCFile(nameTabAct);
fAct.type = typeAct;
fAct.description = new Array(descAct);
fAct.number=itemNo;
fAct.datestamp=system.functions.tod();
fAct.negdatestamp=negdatestamp.getDatum();
fAct.operator=vars.$lo_user_name;
fAct.cust_visible=visible;
var rc = fAct.doSave();
if ( rc == RC_SUCCESS )
{
//print("Activity Created "+typeAct);
return true;
}
else
{
print("Création of activity is not possible.");
return false;
}
}
Call this script from the fc of device table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Thanks for your script and idea.
But I am just trying to figure out why the activity are not generating.In tried to use JS as last workaround to implement if no OOB functionality is available or not working.
Here I want to ask one thing that 2199,12,31,17 is using for what.
Thanks,
Assign Kudo, if found post useful and mark it accepted if solves the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
Yes it seems to be due to joinfile but it is working for the some one else as mentioned in other thread.and this is the thing making me confused.
I am still waiting for positive reply from some one who had successfully implemented the same.
Thanks,
Assign Kudo, if found post useful and mark it accepted if solves the issue.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Add Activity to device table
I know that a long time passed since last update on this thread but i have found why activities won't start on device and a valid solution to let activities works again (without workaround)
The problem is in sc.activity rad: when the query to search activities defintion is build ($L.act.query in get.actions panel), results in this:
(table="joindisplaydevice" or table=NULL) and (mode="save" or mode=NULL)
where Table is different depending on join definition in CI type.
So the simplest solution is to change activityactions. How to change it really depends on how many different device type you want to include in activity.
You can simply fill Table field with the name of join defined in CI Type (joindisplaydevice in above example)
or
You can leave Table field empty and add a condition like this to filter only relevant device type:
filename($L.file) isin {"joinofficeelectronics", "joincomputer", "joindisplaydevice", "joinstorage", "joinhandhelds"}
There is still a problem with thenumber field on activitydevice that is not filled.
I created a trigger on activitydevice Before Add that call getnumber.fc rad to populate that field if it is empty, like this:
if ( record.thenumber == null ) {
var rteReturnValue = new SCDatum();
var rteNames = new SCDatum();
var rteValues = new SCDatum();rteNames.push("record");
rteNames.push("name");
rteNames.push("prompt");rteValues.push(record);
rteValues.push("activitydevice");
rteValues.push("thenumber");
system.functions.rtecall("callrad",
rteReturnValue,
"getnumb.fc",
rteNames,
rteValues,
false);}
Hope it helps!