Question

Diplay a error message on SOLine "The return quantity exceeds the quantity available for return for the related invoice line"

  • 21 September 2023
  • 4 replies
  • 94 views

Userlevel 3
Badge
  • Jr Varsity III
  • 37 replies

Hi,

 For RC Orders in Sales order Screen, Basically when we bring the values from “Invoice Filter” Action it brings inventory items with invoice Nbrs in SOLine. And it Sometimes  displays errror message on Qty feild “The return quantity exceeds the quantity available for return for the related invoice line AR010261, FOODCHIP36. Decrease the quantity in the current line, or in the corresponding line of another return document or documents AR010308, AR010316 that exist for the invoice line”,   i Have also created another Action button in the grid,that works excatly like  invoice filter action, i can bring the inventory items with invoice id to the SOLine grid, But i cannot display the error message that is being displayed with “Add Invoice Action”   , Upon doing some R&D, i came to know that the error message is being displayed from “MemoCheck()” Methrod of “SOOrderItemAvailabilityExtension” graph,  Hear is the sample code 

        public virtual bool MemoCheck(SOLine line, bool persisting)
        {
            if (line.Operation == SOOperation.Issue)
                return true;

            var result = MemoCheckQty(line);
            if (result.Success != true)
            {
                var documents = result.ReturnRecords?
                    .Select(x => x.DocumentNbr)
                    .Where(nbr => nbr != line.OrderNbr);

                RaiseErrorOn<SOLine.orderQty>(persisting, line, Messages.InvoiceCheck_DecreaseQty,
                    LineCache.GetValueExt<SOLine.invoiceNbr>(line),
                    LineCache.GetValueExt<SOLine.inventoryID>(line),
                    documents == null ? string.Empty : string.Join(", ", documents));
            }

            return result.Success;
        }

But iam not understanding how to implement this code into my Graph,  Is there any Way how to implement this Methord()? 

 


4 replies

Userlevel 4
Badge +2

If I understand correctly, you created a new action and want it to display an error like the existing MemoCheck() method does that you reference.  Do you want to call the same MemoCheck() method from your new action?  If so, you can simply instantiate the SOOrderItemAvailabilityExtension graph and call the method.  If this isn’t what you’re trying to do, please explain further.

Userlevel 3
Badge

Hi Tony,

  The MemoCheck() methord internally calls MemoCheckQty() methord which gives the result boolean true of false and based on that the error is displayed on SOLine,  iam not understanding how to implement this methord, it would be great if you can tell me how to implement it.   Iam Able to implement MemoCheck() Methord, but it doesnt seem to be working. 

 

 

public SOOrderItemAvailabilityExtension ItemAvailabilityExt => Base.FindImplementation<SOOrderItemAvailabilityExtension>();

 

ItemAvailabilityExt.MemoCheck(row, false);

 

Funtionally,

 I came to know that the error message is Comparing the "Qty of inventory item of that invoice" to the "qty of inventory item of RC orders" ("Qty of inventory item of that invoice"  -  "qty of inventory item of RC orders" )  and if the value of qty does not satisfy the condition then it is throwing the error

 

Userlevel 4
Badge +2

I’m not clear on what you’re trying to accomplish.  You mention MemoCheck() “doesn’t seem to be working”.  What specifically is not working?

Userlevel 3
Badge

Hi Tony,

            There is a class in “SOOrderItemAvailabilityExtension” graph extension,  in which there is a methord MemoCheck(), Memocheckqty(), but iam not able to acess those members,

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved