Skip to main content

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()? 
 

 

In the Row Selected event on SOLine, use the following pseudocode

if (some check is true)

      PXUIField.SetError<Dac.fieldToSetTheError>(e.Cache, e.Row, SomeNewValue if needed, Your Error Message);

 

And you will get an error message like you want


Hi Kyle,

            Thanks for the response, but the above code which you mentioned is needed to Externaly display the error message to the paticular feild, but in my case the validations for the quantity feild are linked to 2 or 3 invoices. So in this case iam Implementing a methord MemoCheck() from the base code which throws this type of error, but iam unable to do it


Hi @Atiq were you able to find a solution? Thank you!


Hi @Chris Hackett  I have updated the code in the FeildUpdated event and RowPersisting event and it is working for me  

Thank You

          


Reply