Is there a trick to setting a Date on an Order?

I am trying to set the Need By Date on the OrderHed through a BPM. No matter what I do, I can’t get it to stick. I have tried setting it through a Method Directive and a Data Directive. The thing is, everything I try I put a message right after it to display the field and there is a date there. But every time when the screen loads, the date is not there nor has it saved to the DB.

I have even tried various forms of formatting and nothing has worked.

Any help is greatly appreciated!!

Do a trace, what does epicor do when you set it by hand?

I have no problem setting it with an InTran DD.

What is supposed to trigger setting it to a different value?

I can’t tell because it is part of a method, Create Order From Quote.

I had an issue with setting the salesperson too, but I eventually figured out that I could set it on a Data Directive with some flags that let me know that the record went through that particular Method.

If I manually change the Need By Date on an order, it kicks off a method On Change of Need By Date, or something like that. I don’t think that is firing when you copy a Quote.

What format is your date in?

So, when a user creates an order from a quote, I check to see if there is a need by date, if not, I pop up a BPM Form for them to enter the date. I am then filling the ttOrderHead by query and have tried many ways to get the Need By Date to stick. I used an expression that was just the Call COntext field the date is in, I tried setting the Call Context field to a variable and using that, I’ve tried just setting the field directly instead of through the query. Since none of that worked, I also tried setting it on InTran DD. No matter what I have tried, it won’t stay.

And like I mentioned earlier, I have shown a message after everything I have tried to make sure it was in the tt table, and it always is. I even checked it against the Order Date field to make sure they were the same format, and they looked like they were. :face_with_symbols_over_mouth:

Don’t forget, that making a quote into an order can be done by pushing a Quote to an Order (in Quote Entry) MD - Quote.CreateOrder. Or by pulling a quote into an Order (in Order Entry) MD - SalesOrder.CreateOrderFromQuote. These use separate methods. So you need to modify both if you want to do it from either.

P.S. There’s a third one too, MD - SalesOrder.CreateOrderFromQuoteSaveOTS

If your intent is to ensure that user selects a need by date before an order can be created from a quote, you’re probably better off creating an exception message that checks if need by date is null when “Create Order” is selected. Same end goal as the BPM form, but you’re forcing the correction before the order tables are created. Should be a pre-processing directive. Will need to do a trace to find the right method.

The down side to that is that the Quote needs to be opened, the NeedBy updated, and then “Create Order” performed.

Where as if you’re in Order entry and just want to pull that quote in and set the NeedBy now, if it is blank.

And I’d not be surprised if NeedBy on quotes are merely first guesses. Some business may never bother entering them as they could be meaningless. While others strictly adhere to them.

I’m basing it on the assumption that they are using the create sales order wizard. You can set the need by date from there without un-quoting. The timing of when the orderhed record is created using this method probably doesn’t allow a data directive / bpm form scenario to work.

If you’re using the “pull” method I believe you have to have a sales order/customer ID already saved. BPM on the UpdateMaster method on sales order should be used in that instance.

No, you select the quote and lines to suck in. It all gets created at once.

1 Like

You probably want to put it on the the post processing side of the last method called then. It sounds like the base method is overriding changes made during preprocessing.

So, I hacked it to make it work. I put a message at the very end of my DD and watched as it popped up 7 times and saw that the date got cleared on the second to last pop up. Not sure what is doing that. But I had put the RowMod in my pop up and saw that the first one was A and all the rest were U.

I just changed my InTran DD to trigger off of U instead of A and it stuck. I clear my CallContext in the post-method and everything is good.