Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Validate post code of contacts

Posted on by 431

Hi All

I have contacts inserted in table ID 5050 - Contact. And I have updated table 225 - Post Code and now I want to validate field: Post Code on Table Contact.

I tried to use Rapid package to first export all records with all fields and I get error File is to large, thus export to Excel fails.

I am trying to write a processing report that will read all the values inserted on field: Post Code from table Contact and validate field: Post Code.

ContactRec.GET("No.");
PostCodeRec.SETFILTER(PostCodeRec.Code,ContactRec."Post Code");
 IF PostCodeRec.FINDFIRST THEN BEGIN
  CurrFieldNo := ContactRec."No.";
  "Post Code" := ContactRec."Post Code";
  City :=PostCodeRec.City; //V1
  County :=PostCodeRec.County; //V1
  CountryCode :=PostCodeRec."Country/Region Code"; //V1
  PostCodeRec.ValidatePostCode(City,"Post Code",County,"Country/Region Code",(CurrFieldNo <> '0') AND GUIALLOWED);
END;

It does find correct records and it fills them as expected, but after validating is done, it does not commit values on the appropriate fields of Contact table.

How would you validate a value of a field for all records in a table where field that has to be validated already has inserted values as expected.

Thank you, Damjan

  • Suggested answer
    Andy Sather Profile Picture
    Andy Sather on at
    RE: Validate post code of contacts

    Hello  Damjan- We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans