Unable to use FlowFields in Reports?

This is perhaps an odd situation, and I’m not sure how to best handle it.

We want to print the customer’s phone number on the picking list when preparing their order for shipment - not sure why exactly, I’m just the IT guy, I don’t run the business [:P]

So at any rate. The report in question primarily pulls its data from Sales Header. The Sales Header data, while it does have the customer’s address(es) and customer name and number, it didn’t originally have their phone number anywhere… that was exclusively stored on the Customer table.

In order to view this data on the form, I created a FlowField called Phone No. that does a simple lookup.
Lookup(Customer.“Phone No.” WHERE (No.=FIELD(Sell-to Customer No.)))

However, when editing the report, I can’t see the data when I go to print it. It works with any other fields, just not the FlowFields. Is this an intentional behavior of reports or do I have to do something differently?

The only other solution I could think of would be to use C/AL code to insert the customer’s phone number when an order is created, that way it’s just a regular field… but that would also mean going through hundreds of open orders and adding phone numbers once getting rid of the FlowField aspect.

We’re using NAV 2009 R2, for what it’s worth. I do have a development license that allows me to edit C/AL code. If there’s anything else somebody would like to know in order to help, let me know. Thanks

in OnAfterGetRecord

“Sales Header”. CALCFIELDS(“Your flowfield”)

[;)]

Where do I put that code exactly, on the report or on the table?

Makes sense, either way.

Sales Header - OnAfterGetRecord trigger in report

Alright, I’ll try that out at work tomorrow and let you know if it works.

OK, it works, thanks!

First of all the decision of making a flow field in Sales Header was useless because a table in NAV has limited fields so avoid using such flow fields only for reporting purpose. For this you have to take a customer record and use setrange in order to get the Phone number. Now coming to your query just use CALCFIELDS fnc and you will get no. printed in your report.

First of all the decision of making a flow field in Sales Header was useless because a table in NAV has limited fields so avoid using such flow fields only for reporting purpose. For this you have to take a customer record and use setrange in order to get the Phone number. Now coming to your query just use CALCFIELDS fnc and you will find no. in your report.