Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 2 of 2

Thread: In AssetCenter how to schedule assets to get delete?

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    3

    Default In AssetCenter how to schedule assets to get delete?

    Hi,

    We have a workflow scenario to schedule the asset deletion using "READY FOR DELETION" in the Serial# field, but somehow it is not working, it is throwing error.

    "
    Executing workflow rules for execution group 'Deletions'...
    2009/11/05 01:09:08.000 1 1 (0) Cannot delete record from table 'Assets (amAsset)' because it is referenced by at least one record from table 'Expense lines (amExpenseLine) (link 'Expense lines (ExpenseLines)').
    2009/11/05 01:09:08.000 1 1 (0) Runtime error - Application defined or object defined error.
    2009/11/05 01:09:08.000 1 1 (0) Runtime error at line 18 of Basic script ''Database action' of table 'Assets (amAsset)''
    2009/11/05 01:09:08.000 1 1 (0) Error evaluating function ''Database action' of table 'Assets (amAsset)'' in script:\n'Error codes\r\nSetMaxInst(0)\r\n'Delete asset that has been flagged with SerialNo = 'READY FOR DELETION'\r\n Dim lRc as Long\r\n Dim hqWfInstance As Long\r\n Dim count as long\r\n\r\n count = 0\r\n\r\n' SETMAXINST (0)\r\n hqWfInstance = AmQueryCreate()\r\n lRc = AmQueryExec(hqWfInstance, \"SELECT lAstId FROM amAsset WHERE SerialNo = 'READY FOR DELETION' ORDER BY dtLastModif\")\r\n 'Delete record\r\n Dim hrWfInstance As Long\r\n\r\n Do While lRc = 0 AND count < 50\r\n hrWfInstance = AmGetRecordHandle(hqWfInstance)\r\n lRc = AmDeleteRecord(hrWfInstance)\r\n lRc = AmReleaseHandle(hrWfInstance)\r\n lRc = AmQueryNext(hqWfInstance)\r\n count = count + 1\r\n Loop\r\n\r\nIf count = 0 then\r\n Print \"No records to delete\"\r\nelse\r\n Print \"Deletion of \" & count & \" assets successful\"\r\nEnd if
    2009/11/05 01:09:08.000 1 1 (0) Action 'Delete old assets' failed to execute
    2009/11/05 01:09:08.000 1 1 (0) Unable to complete operation in current state.
    "

    Need your help to schedule mass assets deletion in assetcenter Ver 3.60 SP2- build 1807.

    Regards,
    Uma

  2. #2

    Default

    The error suggests that your assets are linked to some other tables as well. Your workflow script has to take care of removing these links before the deletion.

    Hope this helps !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts