Require Need By Date in Order Entry

I’m trying to prevent the user from leaving the sales order if the Need By Date field is blank.

So far I have a BPM set up on Update, I have a UI customization set up when exiting the form, and I have the Need By Date field set as Required in the Extended Properties.

These three handle 95% of the cases.

The one I’m stuck on is when a user uses the Create Order from Quote and it pulls it in with no date (since there wasn’t one in the quote). At that point, everything is saved, so the update won’t fire. If they exit, it will stop them, but if they enter a new sales order ID and tab to that new order, it won’t prevent them from doing so. I’m having trouble finding the right trigger in that situation. Any ideas?

Could you create a pre-processing BPM on Quote.CreateOrderFromQuote (not sure if that’s the name) to check the quote data Req/Need By dates for blank and throw an exception there?

1 Like

I could, but currently, our process does not require the users to enter dates on the quote, so I think that would cause a lot of grief.

You could do a post processing BPM on Create Order From Quote that prompts for the Date on a BPM Form.

1 Like

Is it because they just forget and are ok fixing it once the issue is known? or is it that they just don’t want to do it at all? If it’s the former, I’ve had some success using BAQ gadgets on the home screen to alert someone that there is a problem (like an arrived but not received condition, or when customers are on credit hold and they have an order that needs to be shipped in the next 30 days so something needs to happen, or time entries that are entered but not submitted) Then when they see the problem they just go and fix it.

If you have to force them do stuff, then I got nothin’…

Why not just make the field required under Extended Properties? That automatically creates a pop up warning. I just forget if it tells you the specific field.

Jose–I’ll play around with that and see if that will suffice.

Brandon–From what I’m told, it’s just people making mistakes. My boss would like to poka-yoke the process to prevent them from making the mistake in the first place.

John–The extended properties for that field is already set as “Required”, but it has no effect in this situation.

Jose, that seems like it will do the trick.
Thanks.

1 Like

Hi Hannah,

We are trying to implement the same process as you as we have the exact same need. We want to make the need by and ship by dates required on order entry. We also created the BPM on Update and created a UI customization when exiting the form, we have been working on creating this post-processing BPM on Create Order From Quote for awhile now and for some reason we can’t seem to figure it out.

We’ve tried multiple iterations of our BPM and each one falls back down to the same issue, when the date fields on the data form is filled in we are trying to save to the database, it won’t actually save that to the permanent OrderHed table from the temp table.

We are calling the data form after each condition that checks to see if the NeedBy/ShipBy dates are null, and setting the input dates using the Set Field workflow elements to the CallContextBpmData.Date01-02 expressions which are tied to the NeedBy and Ship By dates of the Order Hed table. Finally were invoking the update method. But that doesn’t seem to save those input dates to the database.

Did you take a different approach when you were going through this ?

int oNum = result.OrderHed.Select(r=>r.OrderNum).FirstOrDefault();

var order = (
  from oh in Db.OrderHed.With(LockHint.UpdLock)
  where oh.Company == Session.CompanyID &&
        oh.OrderNum == oNum
  select oh).FirstOrDefault();
  
using(var scope = IceDataContext.CreateDefaultTransactionScope())
{
  if( order != null )
  {
    order.NeedByDate  = callContextBpmData.Date01;
    order.RequestDate = callContextBpmData.Date02;
    
    Db.Validate();
  }
  scope.Complete();
}

2 Likes

Thank you very much for the quick response.
I appreciate it.

It seems im getting an error because TransationScope is defined in an assembly that I am not referencing in my BPM, but it does not state which assembly it is I am missing. We are running epicor in the cloud, not on prem, so how which assembly would I need to run in order for my code to validate ?

Im relatively new with BPMs so pardon my lack of understanding here.

edit
Sorry, it does say which assembly, but System.Transactions.Local is not present in my standard references which I assume is because we are not on-prem.

This may be helpful: Kinetic 2022.1.1 Transaction Scope - Kinetic 202X - Epicor User Help Forum (epiusers.help)

1 Like

I saw that post at one point when I was doing research before resulting to responding to your post and that is the same situation I am having

The problem for me though is unfortunately the solution posted there is to download and install NET 6 SDK on the client and I do not have access to that because we are running Epicor through the cloud not on Prem.

Iv’e been trying to figure out a work around and I was hoping maybe you had a solution that avoided that.

Seems as though all of my issues I am running into with this BPM are related to being on the cloud :frowning:

You download it to your client, AKA your own computer, not the server.

1 Like

Oh my goodness lol, thank you. I tried that and it got the code to validate! :smiley:
Now, would I want to run this in a separate BPM that runs with my existing BPM, or add this to my existing BPM?

1 Like

Use that code after your conditional, then remove everything else. You’re setting the fields and doing the update within that code.

1 Like

Alright awesome.

I insert that into my code and got rid of the unnecessary elements you mentioned.
It seems to work, but it is not setting the date automatically so it is still allowing the order’s to save without a date. I assume I have to prompt the user to input a need by/ship by date for the newly created order, or am I misunderstanding how this code works, and I am missing a step.

I got it to work! I needed to reinsert my Data Form call to prompt the user to insert the dates. I deleted when I needed it. Thank you so much! I altered it to update the line and release levels’ Need By and Ship By dates as well! I appreciate you reviving this dead thread to help! :smiley:

1 Like