Skip to main content
Question

Acumatica Mobile – "Sequence Contains No Matching Elements" Error When Selecting Adjacent Location in Receive and Put Away

  • June 16, 2026
  • 0 replies
  • 12 views

We have developed a custom Adjacent Locations dialog in the Receive and Put Away mobile screen. The dialog displays a list of available warehouse locations, and users can select a location for processing.

The customization works correctly in the Acumatica Web UI. However, when testing the same functionality in the Acumatica Mobile App, selecting a location from the dialog results in the following error:

 
Server returned an error
Sequence contains no matching element

Steps to Reproduce

  1. Open the Receive and Put Away screen in the Acumatica Mobile App.
  2. Open the custom Adjacent Locations dialog.
  3. Select any available location (e.g., 01-17-B-02).
  4. The mobile app displays the error.

Expected Result

The selected location should be accepted and processing should continue normally, consistent with the behavior in the Web UI.

Actual Result

The mobile application displays:

Server returned an error
Sequence contains no matching element

 

Code:

public PXAction<ScanHeader> AdjLocations;
        [PXButton(CommitChanges = true)]
            [PXUIField(DisplayName = "Adjacent Locations", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
        protected virtual IEnumerable adjLocations(PXAdapter adapter)
        {
           const string Caption = "Adjacent Locations";
     
         if (AdjLoc.AskExt() == WebDialogResult.OK)
            
            {
        
                var filter = AdjLoc.Current;
                if (filter == null)
                {
                    return adapter.Get();
                }
      
             POReceipt doc = Base.Document.Current;
              
             if (doc == null)   return adapter.Get();
      
               POReceiptSplitToTransferSplitLink  ObjPORecSplit =
                            PXSelect< POReceiptSplitToTransferSplitLink,
                            Where< POReceiptSplitToTransferSplitLink.receiptNbr, Equal<Required<POReceiptSplitToTransferSplitLink.receiptNbr>>>>
                           .Select(Base, doc.ReceiptNbr);

                // If location not scanned yet → show all available locations
              if (ObjPORecSplit == null)   return adapter.Get();
     
      
              INTran objINTran =
                          SelectFrom<INTran>
                          .Where<INTran.refNbr.IsEqual<@P.AsString>>
                          .OrderBy<Desc<INTran.lineNbr>>
                          .View
                          .Select(Base, ObjPORecSplit.TransferRefNbr)
                          .TopFirst;
      
               ItemAllocatedLocationsMaint ItemAllocatedLocationsGraph = PXGraph.CreateInstance<ItemAllocatedLocationsMaint>();
              
               INSiteMaint graph = PXGraph.CreateInstance<INSiteMaint>();
           
               // Load warehouse once
               INSite warehouse = PXSelect<INSite,
                                         Where<INSite.siteID, Equal<Required<INSite.siteID>>>>
                                        .Select(graph, objINTran.SiteID);

               graph.site.Current = warehouse;
                  
           List<int?> selectedLocationIDs = new List<int?>();  
 
          foreach (INLocation obj in AdjLoc.Select())
           
    INLocationExt locExt = PXCache<INLocation>.GetExtension<INLocationExt>(obj);
              
    PXTrace.WriteInformation($"Selected={locExt?.Selected}");
    PXTrace.WriteInformation($"LocationID={obj.LocationID}, LocationCD={obj.LocationCD}");

           if (locExt.Selected == true)
             {                      
              selectedLocationIDs.Add(obj.LocationID);
      
               PXTrace.WriteInformation($"ALocationID={obj.LocationID}, ALocationCD={obj.LocationCD}");
                  
              INLocation nextloc = SelectFrom<INLocation>
              .Where<INLocation.locationID.IsEqual<P.AsInt>
              .And<INLocation.siteID.IsEqual<P.AsInt>>>
              .View.Select(Base, obj.LocationID, obj.SiteID)
              .TopFirst;

              if (nextloc == null) return adapter.Get();

              // Set current location in warehouse
              graph.location.Current = nextloc;

              // Deactivate
              nextloc.Active = false;
              graph.location.Update(nextloc);
               }
            }

        if (selectedLocationIDs.Count== 0) return adapter.Get();
        // Save only once
        graph.Actions.PressSave();
      
        int? firstAdjLocationID = null;
        int? secondAdjLocationID = null;
        int? thirdAdjLocationID = null;

        if (selectedLocationIDs.Count >= 1)
            firstAdjLocationID = selectedLocationIDs[0];

        if (selectedLocationIDs.Count >= 2)
            secondAdjLocationID = selectedLocationIDs[1];
      
       if (selectedLocationIDs.Count >= 3)
            thirdAdjLocationID = selectedLocationIDs[2];

        // 4. Insert second split
          ItemAllocatedLocations ObjItemAlloLoc = new ItemAllocatedLocations();
              // ObjItemAlloLoc.TranRefNbr=row.RefNbr;
               ObjItemAlloLoc.InventoryID=objINTran.InventoryID;
               ObjItemAlloLoc.SiteID=objINTran.SiteID;
               ObjItemAlloLoc.ToLocationID=objINTran.ToLocationID;
              
               ObjItemAlloLoc.FirstAdjLocationID = firstAdjLocationID;
               ObjItemAlloLoc.SecondAdjLocationID = secondAdjLocationID;
               ObjItemAlloLoc.ThirdAdjLocationID = thirdAdjLocationID;
               
                ItemAllocatedLocationsGraph.IALView.Insert(ObjItemAlloLoc);

                ItemAllocatedLocationsGraph.Actions.PressSave();
      
          //  AdjLoc.View.RequestRefresh();
      
           }
      
        AdjLoc.View.RequestRefresh();
           return adapter.Get();
         
      }
    }