Solved

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

  • 25 February 2021
  • 17 replies
  • 1041 views

Userlevel 3
Badge

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.

icon

Best answer by Gabriel Michaud 26 February 2021, 15:44

View original

17 replies

Userlevel 7
Badge +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,

Userlevel 3
Badge

Thanks Gabriel, that made it work!!!!

Userlevel 7
Badge +10

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

Userlevel 4
Badge +1

@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. 

 

 

Userlevel 7
Badge +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.

 

Userlevel 4
Badge +1

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… 

 

Userlevel 4
Badge +1

@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. 

 

 

 

Userlevel 7
Badge +10

Cool! Glad you found a solution 👏🏻

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.

Userlevel 7
Badge +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.

Userlevel 7
Badge

Thank you for sharing this @Gabriel Michaud !

Badge

@Gabriel Michaud Thanks for posting!  This is fantastic!

Userlevel 5
Badge

@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?

 

 

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:

 

Userlevel 5
Badge

@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.

thank you so much! that totally worked!

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