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
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.
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;
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;
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.
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
what exactly is your requirement?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
As I said the changes made to temporary table records are not saved in database..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
If you have to do like that then you can reverse the assignment from temp to normal table as:
Pargesoft
This is why I said, you can reverse the assignment from temp to normal or do the modification directly on LItemREC table.
Pargesoft