Skip to Content
0
Former Member
Mar 18, 2009 at 01:30 PM

ESS: LOC_FROM and LOC_TO as required fields in VcTreMileageTable DC

13 Views

Hello,

I was trying make LOC_FROM and LOC_TO as required fields in VcTreMileageTable DC (package ess/tre/tre), but I didn't be successful.

I inserted this code in wdDoModifyView method:

IFieldControlNode nodeFieldControl = 
		(IFieldControlNode) wdThis.wdGetCustomizeController().getFieldControl();
		
for (int i = 0; i < nodeFieldControl.size(); i++)
{
	IFieldControlElement element = nodeFieldControl.getFieldControlElementAt(i);
						  
	if (element.getFieldname().equals("LOC_FROM") || element.getFieldname().equals("LOC_TO"))
		element.setRequired(true);
}

and in CustomController I had set:

startLocationField.setState(WDState.REQUIRED);
endLocationField.setState(WDState.REQUIRED);

but they didn't work.

If anyone have any input on this highly appreciated.

Thanks,

Damiano