Sales invoice sub Form gives Error message

FreakyFreaky Member Posts: 125
I entered on the field cloumn Type option "Item" and the No. as well but when I try to click on the Description column it gives me the Error
"The value of ROUND parameter 2 is outside of the permitted range
the current value is :0.
The permitted range is from 1 to 2147483647".

I don't know why this is occuring. Can anyone please help

Thanks in advance.

Comments

  • matttraxmatttrax Member Posts: 2,309
    Do you have the ability to turn on the debugger? Or look at Code Coverage?
  • FreakyFreaky Member Posts: 125
    yes this is what it shows me
    Code
    UpdateButtons()
      IF CurrForm.Start.ENABLED = CODECOVERAGELOG THEN
        CurrForm.Start.ENABLED := NOT CODECOVERAGELOG;
      IF CurrForm.Stop.ENABLED = NOT CODECOVERAGELOG THEN
        CurrForm.Stop.ENABLED := CODECOVERAGELOG;
    Form - OnOpenForm()
      UpdateButtons;
    Form - OnActivateForm()
      UpdateButtons;
      CurrForm.UPDATE(FALSE);
    Form - OnAfterGetRecord()
      CoverageLine.SETRANGE("Object Type","Object Type");
      CoverageLine.SETRANGE("Object ID","Object ID");
      CoverageLine.SETRANGE("Line Type",CoverageLine."Line Type"::Code);
      CoverageLine.SETFILTER("Line No.",'<>0');
      NoOfLines := CoverageLine.COUNT;
      CoverageLine.SETRANGE("No. of Hits",0);
      NoOfLinesCovered := NoOfLines - CoverageLine.COUNT;
      IF NoOfLines = 0 THEN
        Ratio := 1
      ELSE BEGIN
        Ratio := NoOfLinesCovered / NoOfLines;
        CASE ROUND(Ratio,0.01) OF
          0:
            Ratio := ROUND(Ratio,0.01,'>');
          1:
            Ratio := ROUND(Ratio,0.01,'<');
          ELSE
            Ratio := ROUND(Ratio,0.01);
        END;
      END;
      
      Object.INIT;
      Object.Type := "Object Type";
      Object.ID := "Object ID";
      IF Object.FIND THEN;
    Start - OnPush()
      CoverageLine.DELETEALL;
      CODECOVERAGELOG := TRUE;
      UpdateButtons;
      CurrForm.Stop.ACTIVATE;
    Stop - OnPush()
      CODECOVERAGELOG := FALSE;
      UpdateButtons;
      CurrForm.Start.ACTIVATE;
    

    What does it do?
  • garakgarak Member Posts: 3,263
    is this the source copied from the debugger (did you use it?) or did you only start the CodeCoverage and copy the source from there?
    Do you make it right, it works too!
  • matttraxmatttrax Member Posts: 2,309
    Did you actually run code coverage on your action? It looks like you just clicked start and then stop and posted the code.

    You need to start it, do whatever you were trying to do, stop it, and then find the line of code. Debugger is really better for this if you have it.
Sign In or Register to comment.