Skip to main content
Solved

Create PO from SO

  • July 26, 2023
  • 3 replies
  • 223 views
  • Translate All

wikusvorster42
Jr Varsity II
Forum|alt.badge.img

 

Hi,

I did a process to create a PO from a SO in the Sales Order screen. It works a bit different than the current create PO process where you specify the vendor details on the SO line and create the PO by clicking on an Action.

The problem I have is when I call the

POCreate.CreateProc

I don't get any exception that there was an error creating the PO. I only see the error afterwards in the Trace.

PXLongOperation.StartOperation(Base, delegate ()
{
try
{
POCreate.CreateProc(list, poFilter.PurchDate, poFilter.OrderNbr != null);
}
catch (PXRedirectRequiredException ex)
{
// Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
// Acuminator disable once PX1051 NonLocalizableString [Justification]
throw new PXException(ex.Message, ex.InnerException);
}
});

The  PXRedirectRequiredException is not caught.

 

Best answer by darylbowman

Ah, I misunderstood your question.

 

In my understanding, you can't display user feedback in a PXLongOperation because it's a new thread (different from the UI thread).

In situations like this, I usually try to validate the required fields before starting the PXLongOperation.

View original

3 replies

darylbowman
Captain II
Forum|alt.badge.img+17

The trace indicates:

Error: ‘Owner’ cannot be empty.

Have you checked into this?

Translate

wikusvorster42
Jr Varsity II
Forum|alt.badge.img

Yes, that is easy to solve. My problem is reporting that error or any other error that occurs when the PO is not created in the SO.

Translate

darylbowman
Captain II
Forum|alt.badge.img+17

Ah, I misunderstood your question.

 

In my understanding, you can't display user feedback in a PXLongOperation because it's a new thread (different from the UI thread).

In situations like this, I usually try to validate the required fields before starting the PXLongOperation.

Translate