Tuesday, July 20, 2010

Making MVG field Required

Method 1:
Original Field Name: “Dummy Field”
Create a new calculated field with the following details:
Name: “Dummy Field 2″ (We can actually play with Name/Display Name to make it meaningful)

Create a new calculated field with the following details:
Name: “Dummy Field 2″ (We can actually play with Name/Display Name to make it meaningful)

Calculated Value: [Dummy Field]
Force Active: TRUE
Required: TRUE


Method 2:
We can implement this by using the script below. I have tried to set this on a field called, “Dummy Field” for demo:
function BusComp_PreWriteRecord ()
{
var DummyField = this.ActivateField(”Dummy Field”);
DummyField = this.GetFieldValue(”Dummy Field”);
if ((DummyField == “”)||(DummyField == null))
TheApplication().RaiseErrorText(”DummyField is a required field.”);
return (ContinueOperation);
}

No comments:

Post a Comment