Hello,
I have written an sql qeury:
public void run() { while select RecId from inventSum where inventSum.Closed == NoYes::No && (inventSum.PostedQty inventSum.Received - inventSum.Deducted inventSum.Registered - inventSum.Picked > 0) join RecId,ItemId from inventTableExpanded_ICL where inventTableExpanded_ICL.ItemId == inventSum.ItemId join RecId from inventDim where inventDim.inventDimId == inventSum.InventDimId join inventLocationId, wMSLocationId from wmsLocationIntermediate_ICL group by inventTableExpanded_ICL.ItemId, wmsLocationIntermediate_ICL.InventLocationId, wmsLocationIntermediate_ICL.WMSLocationId where wmsLocationIntermediate_ICL.InventLocationId == inventDim.InventLocationId && wmsLocationIntermediate_ICL.WMSLocationId == inventDim.wMSLocationId { //info(strfmt("%1 %2 %3 ",inventTableExpanded_ICL.ItemId, wmsLocationIntermediate_ICL.InventLocationId, wmsLocationIntermediate_ICL.WMSLocationId)) wmsOnlineCountingServer = WmsOnlineCountingServer::constructItem(inventTableExpanded_ICL.itemId, wmsLocationIntermediate_ICL.InventLocationId, wmsLocationIntermediate_ICL.WMSLocationId,NoYes::Yes); wmsOnlineCountingServer.run(); } }
this logic:
wmsOnlineCountingServer = WmsOnlineCountingServer::constructItem(inventTableExpanded_ICL.itemId, wmsLocationIntermediate_ICL.InventLocationId, wmsLocationIntermediate_ICL.WMSLocationId,NoYes::Yes); wmsOnlineCountingServer.run();
must be performed for each itemid retrieved by the query but for some itemids wmsOnlineCountingServer.run() returns exception and throws an appropriate infolog and of course my logic stops then. Is there any way to skip such itemids, show infolog and resume the logic with the next itemid? what is the approach should be if I'd like to implement such behavior?
Thanks in advance.
Many thanks. Worked for me:))
You can use a try-catch statement to handle the errors without ending your whole process.
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-exceptions
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156