Set date on schedule job

Hi All,
I want to set “Start Date” as “Full LT Start Date”,
I am able to assign a static value to “Start Date”, but i cannot assign Full LT Start Date value to Start Date.
Can someone please help?
Thanks


That might be a custom/personalized Label for that field. I’ve never seen that field before. Can you check the screen in Developer mode and see if it is?

Some of the data fields are calculated and not editable, so it may be one of those.

Full LT start is:


and start Date is:

I can assign the value if I enter it in Data rules:

See the image above and look at the EpiBinding field - looks to be JobHead.Date01. That’s a custom field and will not be affected by the core code. It’ll be something you need to update manually or via BPM in conjunction with the Scheduler.

1 Like

Can’t say I am at all familiar with Full LT Start Date, what is the purpose of this date?

@MikeGross I was able to get the assign a static date in Erp.BO.ScheduleEngine.GetNewParamsForJob
using


but the date I want to use is present in Jobhead. How can I access jobhead table?
thanks.

Its our custom field, to define Lead time start date.

I have not worked with scheduler params methods so this might not work.

Generally, the idea is to grab and store the date, then use it in this BPM.

Since this is a ‘post’ method, I think you will need a ‘pre’ method BPM (which should include the JobHead dataset) to grab the LT Date and store it in one of the callcontextBPMData date fields.

Tthen the BPM you have on the ‘post’ method can refer to that date field b/c the callcontextBPMData fields are available.

@MikeGross thank you.
I created a pre method but the jobhead is not present.


Also there’s no db field associated with the date field in schedule engine.

You do have the jobnum, and could invoke a Jobhead BO method to fetch the data you want. You might even be able to do that in the “post” method as well.

You can put the jobnum in a variable and then use that with a linq statement to get Date01…
In an expression it can only be one line and not a foreach, but there are examples here.

@gpayne thank you.
How can I search for the examples?

I would have searched for Db. and bpm post processing, but I had this already in a similar bpm. This compiles, but has not been tested.

Db.JobHead.Where(h=> h.Company == callContextClient.CurrentCompany && h.JobNum == jobNum).Select(j => j.Date02).FirstOrDefault()

@gpayne thank you.
I am getting the error for this one:


I had not looked at the BO when I suggested the variable. jobNum is already available as a parameter. We are still doing a set field like you did with the hard coded date. it is only the expression that is changing.


@gpayne thank you so much.