Skip to main content
Solved

Is there a way to update a custom field in the Customer record when the status of a Sales Order changes to Completed?

  • January 22, 2022
  • 8 replies
  • 536 views

Forum|alt.badge.img+1

We need to record somewhere the most recent completed order date for a customer so we can report later on how recently a customer made an order.  Is there any way to do this automatically when changing status to Completed on the Sales Order? The field we want to update is on the Customer record. Is this something that can be done using a Customization?

Best answer by KishoK

I couldn’t post the answer . So attached as a file

View original
Did this topic help you find an answer to your question?

8 replies

Forum|alt.badge.img+1
  • Jr Varsity III
  • 35 replies
  • January 22, 2022

This looks like it will be a good use of the new workflow engine.  


KishoK
Jr Varsity I
  • Jr Varsity I
  • 15 replies
  • Answer
  • January 24, 2022

I couldn’t post the answer . So attached as a file


deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • 62 replies
  • January 24, 2022

hi @ppowell,  the standard acumatica Business Accounts screen shows the orders, placed by this customer. 

You can either use the same screen or create a GI or reports based on this. 

If your particular looking for customer screen, custom field only to show the last completed order then it has to customized. Let me know if you need help on the approach for customization.

 

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • 134 replies
  • January 25, 2022
KishoK wrote:

I couldn’t post the answer . So attached as a file

Thanks so much.  I’ll have a look at this and see if it does what we need.  It’s useful to see some code so I can at least get an idea of how things work with this. Really appreciate your help.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • 134 replies
  • January 25, 2022
deebhane wrote:

hi @ppowell,  the standard acumatica Business Accounts screen shows the orders, placed by this customer. 

You can either use the same screen or create a GI or reports based on this. 

If your particular looking for customer screen, custom field only to show the last completed order then it has to customized. Let me know if you need help on the approach for customization.

 

 

Unfortunately what we need is a single entry showing the most recent order date for each customer (so max(Order.OrderDate)) for completed SO or WO orders. This is because we have to report on how many customers has their most recent order in each month.  A GI doesn’t seem to have a way to group by Max(SOOrder.OrderDate) as well as count the customers in a given month. As we don't seem to be able to do it as a GI I decided the best option is to record the most recent order date somewhere when we complete the order which then gives us a single entry per customer and I can group by that date instead.

 

Thanks for your input

 

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • 134 replies
  • January 25, 2022
deaster93 wrote:

This looks like it will be a good use of the new workflow engine.  

I’ll have to look into the workflow engine.  I’m pretty new to Acumatica and still learning what is possible and what isn’t and the best way to achieve the results we desire.

 

Thanks for your input


gprice27
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 25 replies
  • January 25, 2022
KishoK wrote:

I couldn’t post the answer . So attached as a file

We have used this method as well - over-riding the Persist on the Sales order is the best way to update the user field on the Customer


deebhane
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • 62 replies
  • January 25, 2022
ppowell wrote:
deebhane wrote:

hi @ppowell,  the standard acumatica Business Accounts screen shows the orders, placed by this customer. 

You can either use the same screen or create a GI or reports based on this. 

If your particular looking for customer screen, custom field only to show the last completed order then it has to customized. Let me know if you need help on the approach for customization.

 

 

Unfortunately what we need is a single entry showing the most recent order date for each customer (so max(Order.OrderDate)) for completed SO or WO orders. This is because we have to report on how many customers has their most recent order in each month.  A GI doesn’t seem to have a way to group by Max(SOOrder.OrderDate) as well as count the customers in a given month. As we don't seem to be able to do it as a GI I decided the best option is to record the most recent order date somewhere when we complete the order which then gives us a single entry per customer and I can group by that date instead.

 

Thanks for your input

 

 

hi @ppowell 

Below event / logic will help you to build the logic to update the sales order count. 

  protected virtual void SOOrder_RowPersisted(PXCache sender, PXRowPersistedEventArgs e, PXRowPersisted baseEvent)
        {

            baseEvent?.Invoke(sender, e);
            SOOrder row = (SOOrder)e.Row;
            if (row == null)
            {
                return;
            }

            if (e.TranStatus == PXTranStatus.Completed && row.Status == SOOrderStatus.Completed)
            {
                 // You can build logic here based on to update the count of the customer ID and additional filter if required.              
                
            }     

        }

Let me know this helps. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings