Changing Finite checkbox to true on Job Schedule Form

I am trying to change the initial load of the finite checkbox to true, but I don’t manage to get the right name of the field. How do I address the field?

private void ScheduleForm_Load(object sender, EventArgs args)
{
// Add Event Handler Code

scheduleJobPanel1.chklFinite = true;
}

One way to do it is by adding an EpiViewNotification event from the “Form Event Wizard” (form load event could work too, but the EpiViewNotification is easier in my opinion since the wizard generates the code for the view you want to edit), changing the NotifyType to initialize, then adding a view edit. For the code beloew, the wizard generates everything but the 3 lines in the second if statement (also some code gets generated in the initialize and destroy section). Also need to change the NotifyType. (other options get listed in generated comments)

private void edvSchedulingProcess_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
		{
			if ((args.Row > -1))
			{
					view.dataView[view.Row].BeginEdit();
					view.dataView[view.Row]["FiniteLoad"]=true;
					view.dataView[view.Row].EndEdit();
			}
		}
	}

There’s probably an easier way, but this isn’t too bad.

Edit: This example with the epibinding “FiniteLoad” pertains to the Global Scheduling form, but the same approach could be applied to the job scheduling.

1 Like

We have this set up for our Resource Scheduling Board and Multi Resource Scheduling Board Schedule Job windows. It’s best to modify the dataview rather than the control directly:

	private void RescheduleForm_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		EpiDataView edvSched = this.oTrans.Factory("ScheduleEngine");
		var row = edvSched.CurrentDataRow;
		if (row != null)
		{
			row.BeginEdit();
			row["Finite"] = true;
			row.EndEdit();
		}
	}

You can use the Properties tab and select the Finite Schedule checkbox to see the Data View and Field names you need to set.

1 Like

It is working, thank you guys, much appreciated!

1 Like

Good day everyone,
We have the same requirement and wondering where I can find the job scheduling form to set the finite field to true.
Is it under processes?
Please help.

Hi all,
Where did you apply the customization?
Is there a separate menu for Job Schedule Form?
Thanks

Hello @chemuelmardie,

When there is a subform customization, you need to create another customization (even with nothing in it) with the EXACT same name on the calling form. The customization name is passed through to the subform.

1 Like

Thank you so much @Mark_Wonsil !!