Hi there good people!! Please help ](*,)
I've created a report which has the following dataitems
(
Customer
Sales Cr.Memo Header
Account Types
Customer Bank Account
)Indented in that order and i have this code under Sales Cr.memo Heder(
PostedDocDimension.SETRANGE(PostedDocDimension."Table ID",114);
PostedDocDimension.SETRANGE(PostedDocDimension."DimensionCode",'ACCTYPE');
PostedDocDimension.SETFILTER(PostedDocDimension."Document No.","Sales Cr.Memo Header"."No.");
PostedDocDimension.SETFILTER(PostedDocDimension."Line No.",'0');
IF PostedDocDimension.FIND('-') THEN;
vCust.SETFILTER("No.",AccType."Customer No.");
vCust.FIND('-');
CampaignNo := "Sales Cr.Memo Header"."Campaign No.";)
Itried to the SETCURRENTKEY(SETCURRENTKEY("Sell-to Customer No.","No."),
It is working very well,but it is very very slow
0
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
SET DataItemTableView and DataItemLinkReference and DataItemLink ...
BTW, is there any other code in your report? I don't think it should be that slow while running so few codes...
Why are you not using GET instead of FIND - look to me like you are looking up the primary keys on the customer and posted document dimension tables
i.e.
if PostedDocDimension.GET(114,.","Sales Cr.Memo Header"."No.", 0, 'ACCTYPE' ) then
...
if vCust.GET(AccType."Customer No.") then
...
This may not be the only cause for the report to slow down - the links on the dataitems would need to be examined.
Hope this helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
I have these on the DataitemTableviewof Sales Cr Memo(SORTING(Sell-to Customer No.,No.) and Customer(Sorting(No.))and Customer Bank Account(SORTING(Customer No.,Code)) the DataItemLink are fine.
maybe it's "only" a complicated elaboration on a huge amount of data...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Can you explain what you are trying to acheive as the design of report is very important.
For example you have a dataitem for customer and are then using a variable vCust to get customer details again :-s
Also on the dataitem link you don't seem to have (or maybe didn't post) any where clause so this would mean looping all credit notes for each customer and not just the credit notes for that customer.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
That is the way it looks.It works very well but its slow ](*,)