// runAs currentUser and process all messages in the container. /*new RunAsPermission(runAsUserId).assert(); // BP deviation documented runas(runAsUserId, classnum(AifOutboundProcessingService), staticmethodstr(AifOutboundProcessingService, processAsUser), messageIdContainer, runAsCompany, '', runAsPartition); // Revert the permission CodeAccessPermission::revertAssert(); */
AifOutboundProcessingService::processAsUser(messageIdContainer);
//new AifDispatcherPermission().demand();Do not forget to delete your changes after debugging.
class VKTraceAif extends RunBase { } static server public void main(Args args) { AifMessageId aifMessageId; AifDispatcherPermission b = new AifDispatcherPermission() ; AifUtil::flushAifCaches(); b.assert(); aifMessageId = str2guid('{A1645959-29BF-4C56-814D-B40B832C9C36}'); VKTraceAif::processMessage(aifMessageId); CodeAccessPermission::revertAssert(); } public static void processAsUser(container messageIdContainer) { AifGatewayQueue gatewayQueue; AifMessageId messageId; int messageIdContainerIdx = 1; ; // Process all messages in the container. for (messageIdContainerIdx = 1; messageIdContainerIdx <= conLen(messageIdContainer); messageIdContainerIdx++) { messageId = conPeek(messageIdContainer, messageIdContainerIdx); new SkipAOSValidationPermission().assert(); // BP deviation documented gatewayQueue.skipAosValidation(true); select gatewayQueue where gatewayQueue.MessageId == messageId; CodeAccessPermission::revertAssert(); if(gatewayQueue.RecId) { gatewayQueue.CallServiceDirectly = true; AifInboundProcessingService::processAsyncRequest(gatewayQueue); } } } public static void processMessage(AifMessageId messageId) { AifGatewayQueue gatewayQueue; int messageIdContainerIdx = 1; SkipAOSValidationPermission a = new SkipAOSValidationPermission(); ; a.assert(); // BP deviation documented gatewayQueue.skipAosValidation(true); select gatewayQueue where gatewayQueue.MessageId == messageId; if(gatewayQueue.RecId) { gatewayQueue.CallServiceDirectly = true; AifInboundProcessingService::processAsyncRequest(gatewayQueue); } CodeAccessPermission::revertAssert(); }
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.