Options

Rename Error on Form

jigneshdhandhajigneshdhandha Member Posts: 41
Hii Everyone

I am getting record from table on Form and after That I mark record based on condition
I am not Rename or Modify any record I am just getting record But
When i Close Form I got the message "Do you want to rename the record ?"

Please Help me...

Thank you....

Comments

  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,504
    Can you show us the code and where did you write?
  • Options
    jigneshdhandhajigneshdhandha Member Posts: 41
    I am getting record from current table and marking record on base on condition
    I am also getting marking record but when i close form that time Error Msg "Do you want to rename the record" ?

    I am also Set Property InsertAllowed,ModifyAllowed,DeleteAllowed to No still there is message

    Error - "Data Can not be modified on this form"

    Code :

    MARKEDONLY(FALSE);
    SETRANGE("Test 1",Test."Test 1");
    SETRANGE("Test 2","Test."Test 2");
    SETRANGE("Test 3","Test."Test 3");
    SETRANGE("Test 4","Test."Test 4");
    IF FINDSET(FALSE,FALSE) THEN BEGIN
    REPEAT
    MARK(TRUE);
    UNTIL NEXT = 0;
    END;
    SETRANGE("Test 1");
    SETRANGE("Test 2");
    SETRANGE("Test 3");
    SETRANGE("Test 4");
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,504
    What is your goal?

    Did you try to use recordvariable instead of using Rec.

    Like

    <SalesHeader>.SETRANGE("Test 1",Test."Test 1");
  • Options
    MikeyDMikeyD Member Posts: 1
    Hi

    Getting the same error as original poster. We need to check a running total when entering recipes into a Bill of Material. To do this, in Form 99000786 Production BOM, I've added a control 'Check Total Quantity' to the 'Functions' button, coded as follows:
    <Control1000000004> - OnPush()
    CurrForm.ProdBOMLine.FORM.CalcTotalQty;
    

    And in the Form 99000788 Production BOM Lines I've added the following:

    CalcTotalQty()
    FINDSET(FALSE,FALSE);
      REPEAT
        TotalQuantity := TotalQuantity + Quantity;
      UNTIL Rec.NEXT = 0;
    MESSAGE(Text001 + '%1' + '.', TotalQuantity);
    CLEAR(TotalQuantity);
    


    Gives me exactly what I need except that before the total quantity is shown in the message, I'm asked to confirm if I want to rename the record.
    I've run debugger with breakpoints on triggers and it shows no reference to any attempt to rename the record.
    Probably a schoolboy error, but I can't see it, so would appreciate a steer in the right direction.

    Thanks
  • Options
    FlowerBizFlowerBiz Member Posts: 34
    My suggestion is to add "CurrForm.UPDATE(FALSE)" at the end of your routine. I believe that you are moving the file pointer of the record set of the current form by traversing the table data via code. This is unexpected behavior. After the above command executes, the pointer on your form should be placed on the last record read in your code. If this is not desired, retrieve the record that you want the form to point to (ex. FINDFIRST) before executing the above UPDATE command.
  • Options
    MBergerMBerger Member Posts: 413
    MikeyD wrote:
    Hi

    Getting the same error as original poster. We need to check a running total when entering recipes into a Bill of Material. To do this, in Form 99000786 Production BOM, I've added a control 'Check Total Quantity' to the 'Functions' button, coded as follows:
    <Control1000000004> - OnPush()
    CurrForm.ProdBOMLine.FORM.CalcTotalQty;
    

    And in the Form 99000788 Production BOM Lines I've added the following:

    CalcTotalQty()
    FINDSET(FALSE,FALSE);
      REPEAT
        TotalQuantity := TotalQuantity + Quantity;
      UNTIL Rec.NEXT = 0;
    MESSAGE(Text001 + '%1' + '.', TotalQuantity);
    CLEAR(TotalQuantity);
    


    Gives me exactly what I need except that before the total quantity is shown in the message, I'm asked to confirm if I want to rename the record.
    I've run debugger with breakpoints on triggers and it shows no reference to any attempt to rename the record.
    Probably a schoolboy error, but I can't see it, so would appreciate a steer in the right direction.

    Thanks

    Don't work with Rec on a form. Make a copy of Rec in another variable and use that to do your calculations.
Sign In or Register to comment.