We have an address entry form which has the postcode/zip as a required field so the property of the field is set to Required.
However, I am now deploying this to another country where this field is not mandatory and is rarely used.
I tried using the Field_SetBooleanProperty in SanScript to alter this property for the field.
However, in my script to save the record, it is failing on the "required()" test saying not all fields have been entered.
I have done a quick test (included in the code sample) to check the value and it isn't getting changed.
Here is the code I am using:
if Country of table Factors = "NZL" then
iResult = Field_GetBooleanProperty(Mail_PostCode of window Contact_Entry, FIELD_PROP_REQUIRED);
if iResult then
warning "Postcode is required";
else
warning "Postcode isn't required";
end if;
iResult = Field_SetBooleanProperty(Mail_PostCode of window Contact_Entry, FIELD_PROP_REQUIRED, false);
iResult = Field_GetBooleanProperty(Mail_PostCode of window Contact_Entry, FIELD_PROP_REQUIRED);
if iResult then
warning "Postcode is required";
else
warning "Postcode isn't required";
end if;
end if;
Any ideas?
*This post is locked for comments