|
|
|
|
|
HSave (Function) In french: HEnregistre Modifies the current record if it exists, otherwise adds a new record. ScreenToFile(Client)
HSave(Client)
Syntax
<Result> = HSave([<Data file> [, <Options>]])
<Result>: Boolean - True if the addition or the modification was performed,
- False if an error occurs.
<Data file>: Optional character string Name of the data file, view or query used. If this name is not specified, HSave will use the last data file used by the last HFSQL function (function starting with "H"). <Options>: Optional integer constant Used to configure:- the effect of addition or modification on the current iteration.
- the mode for calculating the automatic identifier. For more details, see Managing the automatic identifier during an addition.
- the lock mode of the added or modified record.
- the management of duplicates.
- the management of integrity.
| | hAffectBrowse | Influence of addition/modification on route: Addition or modification assigns route. For example, HReadNext used after HSave positions on the record found after the added/modified record. The hAffectBrowse constant has priority over the hWriteDefault constant. | hCheckDuplicates | Duplicate management mode: Controls duplicates for this operation, even if duplicate control is switched off (function HSetDuplicates).. A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
| hCheckIntegrity | Integrity management mode: Controls operation integrity even if automatic integrity control is disconnected (function HSetIntegrity). A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
| hForceIDAuto | Automatic identifier calculation mode: The automatic identifier is not calculated when the automation is added.. The identifier corresponds to:- the value assigned to the item through programming (CUSTOMERID = 7 for example)
- the default identifier value specified in the data model editor (if the data file was just opened, with no record read)
- the identifier value found in memory (identifier value for the last record read in the data file).
Once the record is added, the next automatic identifier calculated by the HFSQL engine will be calculated while ignoring the value added by hForceIDAuto. A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time. | hIgnoreDuplicates | Duplicate management mode: Ignores duplicate control for this operation, even if automatic duplicate control is connected (function HSetDuplicates).. A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
| hIgnoreIntegrity | Integrity management mode: Ignores the integrity check on this add operation, even if the automatic integrity check is connected (function HSetIntegrity).. A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
| hLockNo (default value) | Blocking mode for added or modified Record No blocking: the added or modified record will not be blocked.
| hLockReadWrite | Lock mode for added or modified record Lock in read/write mode: the added or modified record will be locked in read and write mode. This record cannot be read or modified by another application. Only the current application can modify it, read it or unlock it.
| hLockWrite | Lock mode for added or modified record Lock in write mode: the added or modified record will be locked in write mode. This record can be read by another application but it cannot be modified by another application. Only the current application can modify it or unlock it.
| hRecalculateIDAuto | Automatic ID calculation mode The Record's automation ID will be recalculated when the record is written. This constant has priority over hForceIDAuto and hSetIDAuto.
| hSetIDAuto | Automatic ID calculation mode The automatic identifier is not calculated at the time of addition: the identifier value will be that memorized at the time of addition. The next identifier value calculated by the HFSQL engine will correspond to the greatest identifier value in the file +1. A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time. | hWriteDefault (default value) | Influence of addition or modification on route: Addition or modification does not assign current route. For example, HReadNext used after HSave positions on the record found after the current record before the addition or modification. The hAffectBrowse constant has priority over the hWriteDefault constant. |
Remarks - If the NewRecord property is set to True, HSave adds the record to the data file (HAdd). For more details, see the documentation about HAdd.
- If NewRecord is set to False, HSave modifies the record in the data file (HModify). For more details, see the documentation about HModify.
- Warning: The HReset function modifies the NewRecord property: if the HReset function is used, the NewRecord property changes to True.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|