while select dirpartylocation where dirpartylocation.Party == this.OMOperatingUnitID notExists join inventLocationLogisticsLocation where inventLocationLogisticsLocation.InventLocation == sInventLocation.RecId notExists join _logisticspostaladdress where inventLocationLogisticsLocation.Location == _logisticspostaladdress.Location { rolesCon = _rolesMap.lookup(_logisticspostaladdress.Location); //Create new location newLogisticsLocation = LogisticsLocation::create(LogisticsLocation::find(_logisticspostaladdress.Location).Description); //Create address newPostalAddress.clear(); newPostalAddress.data(logisticsPostalAddress::findByLocation(_logisticspostaladdress.Location)); newPostalAddress.Location = newLogisticsLocation.RecId; newPostalAddress.insert();
getting the error like "the value 0 is not found in map" in Line 8.
Hi mahiims18,
this error means that your map doesn't contain a value that would correspond to _logisticsPostalAddress.Location key.
You can use exist method to check whether a value exists in a map, and only call lookup if the value exists. This way you can avoid the error.
You should also be aware that your code will always result in _logisticsPostalAddress.Location being 0 on line 8, since you don't select any LogisticsPostalAddress. Instead _logisticsPostalAddress is used for notexist join.
We don't know how you populate _rolesMap, and your code also doesn't show what you do with rolesCon. But based on all the information that you shared, you could just remove line 8 completely. It would not impact how the rest of the (shared) code works.
docs.microsoft.com/.../gg911868(v=ax.60)
Hi Nikolaos
I have one more statement in my code after line 18.
i.e newInventLocationLogisticsLocation.addEntityLocation(rolesCon, true);
so I can't remove line 8.
then you need to fix your code. I have explained why you get the error. Please note that I also updated my previous comment, pointing out that your _logisticsPostalAddress.Location will always be 0 once your code reaches line 8.
Right now it's not possible to suggest exact fix to your code, there's simply not enough information available.
notExists join _logisticspostaladdress means you dont have that table record so why you are using a field from that table
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 765 Super User 2025 Season 2
CA Neeraj Kumar 743
Sumit Singh 551