Skip to main content
Solved

Using an Import Scenario to run Recalculate Prices from the Actions menu on a sales order


Forum|alt.badge.img

I am trying to use an import scenario to run price recalculation on a list of Sales Orders (provider is an Excel provider).  Here is my import scenario.  If anyone has any ideas about how to do this, I would appreciate it.

 

I’ve tried different variations of the OK button that are available in the list including <dialog answer>.  Also tried moving the OK button before the Action line.  Also tried the different Action->Recalculates that are in the list.

Any help is appreciated.

Best answer by Gabriel Michaud

​​​​​​Hi @MRoszkowski15,

A few tips that should hopefully get you to the finish line:

  • Invoking <Action: OK> (RecalcOK) is not the right way to confirm a dialog in an import scenario. Instead, you have to add a line before (that’s very important) calling <Action: Recalculate Prices> with:
    • Target Object: Order Summary
    • FIeld/Action Name: <Dialog Answer>
    • Source Field / Value: ='OK'
  • Also, you have to set OverrideManualPrices before invoking the action

This is counter-intuitive but since dialogs are modal/blocking, integration services need to know before the dialog opens what to do with it :)

Regards,

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

17 replies

Gabriel Michaud
Captain II
Forum|alt.badge.img+10

​​​​​​Hi @MRoszkowski15,

A few tips that should hopefully get you to the finish line:

  • Invoking <Action: OK> (RecalcOK) is not the right way to confirm a dialog in an import scenario. Instead, you have to add a line before (that’s very important) calling <Action: Recalculate Prices> with:
    • Target Object: Order Summary
    • FIeld/Action Name: <Dialog Answer>
    • Source Field / Value: ='OK'
  • Also, you have to set OverrideManualPrices before invoking the action

This is counter-intuitive but since dialogs are modal/blocking, integration services need to know before the dialog opens what to do with it :)

Regards,


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 29 replies
  • February 26, 2021

Thanks Gabriel, that made it work!!!!


Gabriel Michaud
Captain II
Forum|alt.badge.img+10

Fantastic, thanks for the quick reply, i’m glad to hear it worked out! Happy Friday @MRoszkowski15 😊


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 94 replies
  • April 19, 2021

@Gabriel Michaud, I was hoping you could provide some quick insight into my dilemma as well...very similar. 

When a service order is created from a Case, I want the case to Close and the Reason to be changed to value: SO - “SO Created” which is a custom drop-down value. 

I had this ordered so that <Actions: Close> was before the <Dialog Answer> and it was closing cases, but the reason was not changing from the default value. I then read your reply above and reordered the mapping so that <Dialog Answer> was first. I also moved Reason in between and even changed it to ‘SO Created’.

For whatever reason, now that I reordered, the import scenario is not firing at all. 

 

 


Gabriel Michaud
Captain II
Forum|alt.badge.img+10

Hi @sean21,

I think you’ll have to make the following changes:

  1. Change the Case ID → Case ID field to just Case ID
  2. Move the Reason field before you set the dialog answer.
  3. Change the Target Object of the Reason field to “Transition Parameters”

I’m not sure if the reason needs to be a code or the user-visible reason (Rejected, Resolved, etc.) -- this uses the new workflow engine in recent versions of Acumatica and I have yet to use that with an import scenario.

 


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 94 replies
  • April 19, 2021

Thanks @Gabriel Michaud! Appreciate your help. It’s firing again, but it’s still having problems with changing the reason. I’ve set to equal the value and the value description… going to sleep on it and try again tomorrow… 

 


sean21
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 94 replies
  • April 19, 2021

@Gabriel Michaud ...my stubbornness paid off. I had to do a little digging in the wikis, but I found an article that solved this. It works! I didn’t need the dialog answer in this case, since it was associated with a workflow. 

 

 

 


Gabriel Michaud
Captain II
Forum|alt.badge.img+10

Cool! Glad you found a solution 👏🏻


MRoszkowski15 wrote:

Thanks Gabriel, that made it work!!!!

Hi @MRoszkowski15

I’m stuck on this, would you kindly share how you made it work?

Kind regards


Hi @Gabriel Michaud,

Thanks a lot for the following solution:

I used this approach to run 2 Actions on Invoices and Memos screen and it works perfectly.


Gabriel Michaud
Captain II
Forum|alt.badge.img+10

For those stumbling on this post and struggling to get the Recalculate action to work from an import scenarios, I’d like to provide an update that might help users trying to achieve this. Another community member reached out to me asking for help, and I spent some time trying to understand what’s going on - it looks like the “Recalculate Prices” action triggers an Object Reference Not Set exception in current versions when you try to call it from an import scenario.

I didn’t get the opportunity to trace the code to see why it’s failing, but I noticed that there’s another action that you can use from import scenarios which doesn’t cause this error: “<Action: Recalculate Prices and Discounts on Import>”. Unfortunately, this action ignores the flags that are set on the Recalculate Prices view, so I went ahead and built a simple customization that adds a custom action:

 

In the custom action code, you can set all the flags directly; in the example above, only prices are getting recalculated.

The import scenario that you need is much, much simpler since you’re not dealing with a dialog and a filter view:

 

<Action: Save> is not even required because the action saves the record at the end.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2657 replies
  • April 22, 2022

Thank you for sharing this @Gabriel Michaud !


KellyBurns74
Freshman I
Forum|alt.badge.img

@Gabriel Michaud Thanks for posting!  This is fantastic!


Michaelh
Semi-Pro II
Forum|alt.badge.img+1
  • Semi-Pro II
  • 185 replies
  • February 27, 2023

@Gabriel Michaud - hitting the same wall, but with SALES ORDER INVOICES (SO303000). We’re trying to directly import Sales Order Invoices. We don’t have the <Action: Recalculate Prices and Discounts on Import> in the summary table, but we definitely get the object reference error when we enable the actions:

<Action: Recalculate Prices> (RecalculateDiscountsAction@Other Category)

OR

<Action: Recalculate Prices> (RecalculateDiscountsAction)

The document goes smoothly until we attempt to use either of those functions (with the dialog confirmation preceding them of course). The moment we use one of those, we get the object ref error.

You don’t happen to have a solution for this screen too do you?

 

 


  • Freshman I
  • 2 replies
  • May 9, 2023

Can someone help me? I am using a similar scenario to update order date, but for some reason it is giving me an error. This is my scenario

and this is the error:

 


Michaelh
Semi-Pro II
Forum|alt.badge.img+1
  • Semi-Pro II
  • 185 replies
  • May 9, 2023

@Muah - All document screens need a TYPE sent over to them. You only passed the Order Number, which MIGHT be unique, but the system can’t be certain so it requires a TYPE. Also notice at the top that the system has declared there are TWO key fields: OrderNbr and OrderType, you only set the value for OrderNbr.

For most imports on SO’s, you just need to add in:

Order Summary → Type → =’SO’ (or bind it to a field if your data source has it).

You also do not need the second call for a dialog. The answer you give in this segment is “saved” until a dialog appears. Technically your very first call could be Dialog = NO and your very last call could invoke that dialog box. You just need to invoke that BEFORE the box appears.

 

Also of note: Your error almost ALWAYS means the process couldn’t get past accessing or creating the document. If you see that error, check the order numbers and types being sent over, that’s usually where my issue lies.


  • Freshman I
  • 2 replies
  • May 9, 2023

thank you so much! that totally worked!


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