static void FlushEventInbox(Args _args)
{
/*
To implement Alert functionality, Dynamics AX uses following tables:
EventParameters
EventCompanyRule
EventCUD
EventInbox
|
|- EventInboxData
|- EventRule
|
|-EventRuleData
|-EventRuleField
|-EventRuleIgnore
|-EventRuleIgnoreAggregation
|-EventRuleRel
|
|-EventRuleRelData
*/
EventRuleRelData EventRuleRelData;
EventRuleRel EventRuleRel;
EventRuleIgnoreAggregation EventRuleIgnoreAggregation;
EventRuleIgnore EventRuleIgnore;
EventRuleField EventRuleField;
EventRuleData EventRuleData;
EventRule EventRule;
EventInboxData EventInboxData;
EventInbox EventInbox;
;
if (Box::okCancel("Flush all Events related table?", DialogButton::Cancel, "Confirm deletion",
"Delete all records from: delete_from EventRuleRelData, EventRuleRel,"
+" EventRuleIgnoreAggregation, EventRuleIgnore, EventRuleField, EventRuleData,"
+" EventRule, EventInboxData, EventInbox") == DialogButton::Ok)
{
delete_from EventRuleRelData;
delete_from EventRuleRel;
delete_from EventRuleIgnoreAggregation;
delete_from EventRuleIgnore;
delete_from EventRuleField;
delete_from EventRuleData;
delete_from EventRule;
delete_from EventInboxData;
EventInbox.skipDeleteMethod(true);
EventInbox.skipDeleteActions(true);
delete_from EventInbox;
}
}
2020 release wave 2 Installed product version : 10.0.14 (10.0.605.20015) Installed platform version : Update38 (7.0.5778.41504)
Friday, December 4, 2009
Flush Events related tables quickly
Quick job to delete all records from Events related tables. Inspired by this posting of Nitesh Ranjan.
Hi,
ReplyDeletei think the use of skipDataMethods is in this context not correct. The method skipDataMethods(true) will skip future calls of update and insert methods. To skip future calls of the delete-method you'll have to use the skipDeleteMethod(true)
bxe,
SebDra
http://www.crazy-club.de/blog
Thank you for the remark. I changed the code.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete