web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Field_SetBooleanProperty isn't working

(0) ShareShare
ReportReport
Posted on by 6

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

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Dan Liebl Profile Picture

Dan Liebl 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans