Setting MaxIteration

hairyjimhairyjim Member Posts: 99
edited 2004-02-23 in Navision Attain
Hi,

Is it possible to set MaxIteration via C/SIDE code?

What I am trying to do is look at the first record and based on the data in a given field decide wheter to print the rest of the records or not.

Cheers
Jim
Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.

Comments

  • Christian_BuehlChristian_Buehl Member Posts: 145
    Step 1: Set a filter onto the wanted records:
    data.setrange(....)
    Step 2. Count the number of recors
    If data.count() > x then ....

    I recommend to use proper keys e.g. data.setcurrentkey(keylist) otherwise it will slow down as count reads all records in the filtered datarange

    Hope this works for you purpose
  • eromeineromein Member Posts: 589
    Just for the record...

    Please never use the MaxIteration propertie in your life.

    This propety was programmed into Navision by accident. People even say M$ is nitified every time you use this property and that they are administating everyone that ever used it. These people will then be shadowed for the rest of there lifes... Really, I'm not kidding here!

    Ooh, and besides that. The next programmer is spending hours and hours trying to figure out why not evey line is printed. Trust me... I've been there!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • eromeineromein Member Posts: 589
    or try to solve this issue with integer dataitems...
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • hairyjimhairyjim Member Posts: 99
    Ok. I get the point guys ;)

    So let me elaborate on what I am trying to achieve and then hopefully someone with a little more knowledge than I can help me.

    I have two tables defined on my report

    Support Header table
    Support Actions Table

    Actions is linked to support header via Incident No.

    What I wish to do is to create a report that only shows Incidents that have not had any actions attributed to them within the last seven days.

    So I thought that if I sorted call actions by date (So the most recent was first) I could check whether the date on the action was 7 days ago or not. If it was not posted within 7 days then print the the incident header and all actions associated to the incident. If it was within the last 7 days then do not print anything at all.

    Did I make sense? I am not sure where I need to add code to do this check and to decide whether to print the records or not.

    Im stuck. Any help would be greatly appreciated.

    Jim
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • eromeineromein Member Posts: 589
    Make a flowfield on the in the header that checks if there are any Action records for that header. You will have to create a datefilter flowfilter as well.

    set the correct datfilter in the report and calculate the field. Use it to check which record to print or not.



    my first post was not correct : "Use the printonlyifdetails property of the Support Header dataitem. This should solve your problem.

    Tip: Use a integer loop dataitem to print the header of your report. See the orderconfirmation or the invoice for a sample."
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • hairyjimhairyjim Member Posts: 99
    I think I follow.

    I will go have a play and let you know how I get on.

    Jim
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • eromeineromein Member Posts: 589
    Teach a hairyjim to create flowfields and he will have a play allday. Untill he gets it on...

    Mmmm....
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • hairyjimhairyjim Member Posts: 99
    You beauty!

    Wow - flowfields pretty neat stuff. My report is working an absolute charm now!

    Are there any decent online tutorials for C/Side? I mean its great I can ask questions on here and then refer to help files, but sometimes working through a tutorial is great.

    Jim
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • eromeineromein Member Posts: 589
    I don't know, but have look on the forum. I know you are not the only person asking for tutorials...
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.