Dear all,
I am sorry for not trying to look first about what will I ask to you guys.
Cause I rather run out of time.
I am rather confuse about this variable type.
Does this kind of variable has the same function as DATASET in VB.Net or C#? If I not mistaken, the dataset is think like a cache in our computer so when I do some changes, the changes only in my computer not to the database unless, I make it to insert to the database.
If I use that as a record of a table, does it will took all of the record?
When this kind of variable will take the record? Does it will take the record after I say Record.Setrange?
If I declare this kind of record without define it as a temporary, does the changes I made will also changes the record in the real table?
:-k
TIA
Michael Darmawan Teja
0
Comments
You can make a record variable temporary, but then it has no link to the database. So if you have a customer with number 123, and you do Customer.GET('123') with a temporary customer record variable, you will get an error message, even though the customer exists in the database.
RIS Plus, LLC
A record is a 'storage' for 1 DB-record. When you get (FIND or GET) a record, it is stored in that variable. If you change it, it isn't changed in the DB until you do a MODIFY. If you have to change just 1 field in a record, you still have to get the record (GET,FIND), change the field (TheRecord."Field" := Value ; TheRecord.VALIDATE("Field",Value) ; and write record back (MODIFY). Until you do a MODIFY, the DB will not contain your new value.
SETRANGE,SETFILTER,SETCURRENTKEY does nothing to the values in the record. Only until you do FIND (or NEXT), the first (or a next) record will be put in the variable.
Temporary is like it says temporary. All changes you do on it will not be written in the DB. It exists only in the object where you declared it as a global (or a function in which you declared it as a local). When you enter in an object, a temptable will be empty (even if in the DB, there are records).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
When I must use COMMIT?
From what I read, it say COMMIT is used when your write a trx (into a table?) and then you write terx again.
But IF the write trx only do it once in code, then the system will commit by it self.
So whenever i use
Repeat
(insert,modify,delete)
--> must COMMIT??
Until
or I don't have to use the COMMIT?
An error will rollback the database to the point of last commit.
The COMMIT statement can be used to alter this behavior. This statement will commit any open transaction. Most of your Navision coding will not require the use of an explicit COMMIT statement.
RIS Plus, LLC