Tuesday 13 March 2018

Delete AIF exception logs

Here we are going to learn, how to delete AIF exception logs that are created before some xxx date.

static void MK_ClearAIFLogs(Args _args)
{
    SysExceptionTable  aiflog;
    ;
    ttsbegin;
    delete_from aiflog where
    aiflog.createdDateTime <  datetobeginUtcDateTime(today()-30, DateTimeUtil::getUserPreferredTimeZone());
    ttscommit;
}

There are few points to be noted about the above code.
1. The AIF exceptions are stored in SysExceptionTable.
2. How to use date and time range in the select query
3. Set set based statement. (Speeding Up SQL Operations)


No comments:

Update NuGet package to new MS D365FO version

1. Import the NuGet package files from LCS for that particular version please take the PU version files only. a. Goto LCS-->Asset Libra...