Converting FlowFields to C/AL report

Hey fellow NAV developers,

So I currently have a report that pulls from the Customer table. In the Customer table I have added a few FlowFields which the report pulls and exports to excel. The report is incredibly slow and I figured there must be a way to use C/AL and add another DataItem instead of using a bunch of FlowFields.

Here is an example of one calcformula on a FlowField in the Customer table:

Min(“Sales Line Archive”.“Order Date” WHERE (Sell-to Customer No.=FIELD(No.),No.=FILTER(40800)))

Can anyone help show me what this would look like in the report using C/AL? Also, am I correct to assume that it will be faster by not using flowfields?

Thanks!

Hi

I believe flowfield is faster, however if your Sales Line Archive table is indexed based on a key including ‘Order Date’.

You may check this out, maybe you need to create a new combined key including ‘Sell-to Customer No’ and’Order Date’!!

Jay is right - flow fields are normally faster, but the exact flow field filter you listed above is not good.

You should always try to avoid hard coding account or item numbers into your code. Instead let this field be feeded from a setup table or similar.

Could you provide a simple example of what you mean? What would be a faster alternative to pull the same information?

Also, could anyone point me towards a good resource to learn more about keys/SumIndexFields?

Thanks for your help by the way!

Hi Dan,

Examples to what? Coding without hardcoding? A faster alternative? Using SumIndexFields is really the fastes way, if done correctly.

You can read more about sub index fields here:
http://msdn.microsoft.com/en-us/library/dd301342.aspx

Examples to coding without hardcoding. For instance, if I’m trying to find No. 40800 everytime, is there a way to do this without hardcoding it like I did above?

A typical way to do it is to create a new field where you store this number. Either in a setup table or in the request page of the report.