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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

FlowField based on code

(0) ShareShare
ReportReport
Posted on by

I am disappointed to find that a FlowField cannot use a small amount of CAL code.
I am trying to calculate a substring of a UK Postcode on the Customer table, e.g.: AB12 3CD -> AB12
I have done this outside NAV in Excel reports by: PostcodeDistrict = Delete3CharsFromTheEnd(StripSpaces(Postcode))

What is the best way to do this in NAV to act just like a FlowField? In other words:

  • Is not stored in the database
  • Is available on the customer page
  • Is available on the web service

Thanks!
(For anyone wondering, I did it this way because the first part is not a fixed length.)

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jeremy Vyska Profile Picture
    727 on at

    Sadly, you just can't put code logic or even functions into FlowFields.

    Generally, you'd have to, on the Customer Page and in the Web Service you're exposing, set a variable, populate that variable with your logic during OnAfterGetRecord, then add the Variable to the page.

    Given the nature of the challenge you have, what you *could* do is make a new field that contains only the data you want.  Then, a quick bit of additional validation on the field when it changes to update the new PostPrefix field, along with a one-time run Processing Only routine that populates the data initially.

    Then you can do FlowFields all over the place against it.

  • Community Member Profile Picture
    on at

    Thanks for the reply Jeremy.

    I prefer your first variable solution over creating and updating a new database field, since the data is already in the database.

  • Community Member Profile Picture
    on at

    Would the variable be defined on the Page or the Table?

    And once I added it to the page, would the Web Service (based on that page) automatically get that variable?

  • Jeremy Vyska Profile Picture
    727 on at

    If you add the variable to the Page and add the variable to the page just like you would a field, and the Web Service exposes the Page object, then you will see the variable just like any field.  Sounds like that will hit your needs.  Hope that helps!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans