
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Experts,
We have AM9.32 in our environment. We have a requirement that is whenever Memory Value changes in amComputer table a notification has to be sent to Asset Manager.
Here we have a challenge for example : We have a configuration mail body as " The memory of the device "XYZ" has changed & the new value is [lMemorySizeMb]" but i need the previous value in the body text where am not able to refer it from amhistory.
Kindly someone please help me on this with the logic.
Regards,
Shrini
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Dim PreviousValue as String
PreviousValue = amDBGetString("SELECT a.PreviousVal FROM amHistory a WHERE a.lHistObjId = " & [lComputerId] & " AND a.Field = 'lMemorySizeMb' AND a.dtLastModif = (SELECT MAX(c.dtLastModif) FROM amHistory c WHERE c.lHistObjId = " & [lComputerId] & " AND c.Field = 'lMemorySizeMb')")
Above will get you the most current history record.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Use a script action instead of messaging action with same context and code logic for amActionMail() (see programmer's reference pdf guide under Docs folder where software installed).


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Dim PreviousValue as String
PreviousValue = amDBGetString("SELECT a.PreviousVal FROM amHistory a WHERE a.lHistObjId = " & [lComputerId] & " AND a.Field = 'lMemorySizeMb' AND a.dtLastModif = (SELECT MAX(c.dtLastModif) FROM amHistory c WHERE c.lHistObjId = " & [lComputerId] & " AND c.Field = 'lMemorySizeMb')")
Above will get you the most current history record.

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