modify a temp record

karuchuakaruchua Member Posts: 151
is it possible to modify temporary records in a form?

Comments

  • karuchuakaruchua Member Posts: 151
    from a report
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Changes made to temporary table are not stored in database.

    what exactly is your requirement?
  • karuchuakaruchua Member Posts: 151
    am running a report which is generating temp records in a form,i nid to pass a variable to the form to modify one of the fields value and then save the new changes to the record
  • imclever1205imclever1205 Member Posts: 94
    Hello ...What you need to do is to find the record set which storing the values and you need to modify this record set only so that you are able to see your changes.
  • karuchuakaruchua Member Posts: 151
    i have found the record set but when i modify the field,but it doesn't save the changes to the record.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Where are you checking for changes?
    As I said the changes made to temporary table records are not saved in database..
  • karuchuakaruchua Member Posts: 151
    this is wot am doing with my code and highlighted is the field am modifying,how do i make it save the changes or wot do i need to do?
    TempItemsREC.DELETEALL;
    LItemREC.RESET;
    LItemREC.COPYFILTERS(Item);
    LItemREC.SETFILTER("No.",'<>%1','');
    IF LItemREC.FINDSET THEN BEGIN
    TotalFields := LItemREC.COUNT;
    
     REPEAT
      z := z + 1;
      [b][color=#FF0000]LItemREC."Suggested Disposal Price":=LItemREC."Unit Price"+((Gpernt/100)*LItemREC."Unit [/color][/b]Price");
      Window.UPDATE(1,LItemREC."No.");
      Window.UPDATE(2,ROUND(z/(TotalFields)*10000,1));
       LItemLedgEntriesREC.RESET;
      LItemLedgEntriesREC.SETCURRENTKEY("Item No.","Posting Date");
      LItemLedgEntriesREC.SETRANGE("Item No.",LItemREC."No.");
      LItemLedgEntriesREC.SETRANGE("Posting Date",GMonthDates[2],WORKDATE);
      IF NOT LItemLedgEntriesREC.FIND('-') THEN BEGIN
         TempItemsREC := LItemREC;
         TempItemsREC.INSERT;
      END;
     UNTIL LItemREC.NEXT = 0;
     Window.CLOSE;
    END;
    
  • ufukufuk Member Posts: 514
    I can't understand from the code part why you use temporary records here and not directly modify the LItemREC table.
    If you have to do like that then you can reverse the assignment from temp to normal table as:
    Rec := TempRec;
    IF NOT REC.INSERT THEN
      REC.MODIFY;
    
    Ufuk Asci
    Pargesoft
  • karuchuakaruchua Member Posts: 151
    @ufuk,i ahvent understood wot u mean i modify the table directly,example code
  • ufukufuk Member Posts: 514
    LItemREC."Suggested Disposal Price":=LItemREC."Unit Price"+((Gpernt/100)*LItemREC."Unit Price");
    
    You assign a value to LItemREC but not modify it. You copy it to a temporary and insert the temporary. So the modification is realised only in the temporary record.

    This is why I said, you can reverse the assignment from temp to normal or do the modification directly on LItemREC table.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.