PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Tip
  • History of modifications
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HHistoryModification (Function)
In French: HHistoriqueModification
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Returns the modifications made to one or more items of a given record. The result can be displayed in a list box or in a table to allow the user to view the modifications made to the specified data file.
Notes:
  • This function is using the write-to-file log as well as all the archived logs.
  • WINDEV In a window linked to a data file, you have the ability to automatically display the history of the modifications performed on each item of the displayed record. To do so, the data file must be logged.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
WINDEV MobileiPhone/iPad This function is now available for the iPhone/iPad applications.
WINDEVWINDEV MobileUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 22
WINDEV MobileiPhone/iPad This function is now available for the iPhone/iPad applications.
WINDEVWINDEV MobileUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEV MobileiPhone/iPad This function is now available for the iPhone/iPad applications.
WINDEVWINDEV MobileUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Display in a table the users who changed the email of the current customer
// as well as the different values of the email over time
sHistory is string
sHistory = HHistoryModification(Customer, CustomerID, Customer.CustomerID, "Email", 5)
sModification, sItem, sStatus, sUser are strings
sModification = ExtractString(sHistory, firstRank, CR)
WHILE sModification <> EOT
sItem = ExtractString(sModification, 1, TAB)
sStatus = ExtractString(sModification, 2, TAB)
sUser = ExtractString(sModification, 5, TAB)
SWITCH sStatus
CASE "D"
ListAdd(LIST_ListModification, ...
StringBuild("The user %1 modified " + ...
"the Email item to give it the value %2", ...
sUser, sItem))
CASE "N"
ListAdd(LIST_ListModification,...
StringBuild("The user %1 modified " + ...
"the Email item to make it NULL", sUser))
END
  sModification = ExtractString(sHistory, nextRank, CR)
END
Syntax

Modifying a record identified by the value of a search key Hide the details

<Result> = HHistoryModification(<File Name> , <Name of Search Item> , <Sought Value> , <List of Items> [, <Number of Modifications> [, <Separator of Values> [, <Separator of Modifications>]]])
<Result>: Character string
This result has the following format:
<Values> + <Separator of Values> + <Information about Modifications> +
<Separator of Modifications>

Where:
  • <Values> has the following format:
    <Value of Item 1> + <Separator of Values> + <Status Item 1> +
    <Separatof of Values> + ... + <Separator of Values> + <Value of Item N>
    + <Separator of Values> + <Status Item N>
    • <Status of Item> corresponds to:
      • "D": the item is defined
      • "N": the item is NULL
      • 'I': the item does not exist in the archived log.
  • <Information about Modifications> has the following format:
    <Modification Date and Time> + <Separator of Values> +
    <Computer Identifier (value of HPost)> + <Separator of Values> + <Login> +
    <Separator of Values> + <Computer Name> + <Separator of Values> + <IP Address> +
    <Separator of Values> + <Application Name> + <Separator of Values> +
    <HInfoMsg> + <Separator of Values> + <Function Number>

HFSQL Login always corresponds to an empty string ("").
<File Name>: Character string (with or without quotes)
Name of the logged data file where the last modifications must be sought.
<Name of Search Item>: Character string (with or without quotes)
Name of the item used to select the record for which the last modifications are sought. The selected record corresponds to the record whose value is equal to <Sought Value>.
We recommend that you use a search key to optimize the performance.
The second syntax enables you to perform a search on a record number.
<Sought Value>: Type corresponding to the value
Value of the item that is sought in the data file. The list of modifications will be supplied for the record for which the value of <Item Name> corresponds to <Sought Value>.
<List of Items>: Character string
List of items taken into account for the last modifications. In this list, the different items are separated by commas or by CR characters (Carriage Return).
If this parameter corresponds to "*", all the items found in the data file will be included.
<Number of Modifications>: Optional integer
Maximum number of modifications returned (from the most recent one). All the modifications will be returned if this paramer is not specified.
<Separator of Values>: Optional character string
Separator for the different values. This separator corresponds to TAB if this parameter is not specified.
<Separator of Modifications>: Optional character string
Separator for the different modifications made to the specified record. This separator corresponds to CR if this parameter is not specified.

Modifying a record identified by its record number Hide the details

<Result> = HHistoryModification(<File Name> , <Record Number> , <List of Items> [, <Number of Modifications> [, <Separator of Values> [, <Separator of Modifications>]]])
<Result>: Character string
Values of the items of <List of Items> separated by <Separator of Values>. The following information is added after these values:
HFSQL
<Separator of Values> + <Modification Date and Time> + <Separator of Values> +
<Computer Identifier (value of HPost)> + <Separator of Values> + <Computer Name> +
<Separator of Values> + <IP Address> + <Separator of Values> +
<Application Name> + <Separator of Values> + <HInfoMsg> +
<Separator of Modifications>
HFSQL Client/Server
<Separator of Values> + <Modification Date and Time> + <Separator of Values> +
<Computer Identifier (value of HPost)> + <Separator of Values> + <Login> +
<Separator of Values> + <Computer Name> + <Separator of Values> + <IP Address> +
<Separator of Values> + <Application Name> + <Separator of Values> +
<HInfoMsg> + <Separator of Modifications>
<File Name>: Character string (with or without quotes)
Name of the logged data file where the last modifications must be sought.
<Record Number>: Integer
Number of the record where the modifications must be sought. You have the ability to use hCurrentRecNum to handle the current record.
<List of Items>: Character string
List of items taken into account for the last modifications. In this list, the different items are separated by commas or by CR characters (Carriage Return).
If this parameter is not specified or if it corresponds to "*", all the items found in the data file will be included.
<Number of Modifications>: Optional integer
Maximum number of modifications returned (from the most recent one). All the modifications will be returned if this paramer is not specified.
<Separator of Values>: Optional character string
Separator for the different values. This separator corresponds to TAB if this parameter is not specified.
<Separator of Modifications>: Optional character string
Separator for the different modifications made to the specified record. This separator corresponds to CR if this parameter is not specified.
Remarks

Tip

We recommend that you use the first syntax by using as search key the automatic identifier of the data file or a unique key. Indeed, using the record number may cause some unexpected effects: the record number is re-used when deleting and adding a record.
For example, in a Customer file, the record number of a deleted customer will be re-used when a new customer is created. The history of the modifications performed on this record number will take into account the modifications performed on the different customers associated with this record number.
WINDEV

History of modifications

In a window linked to a data file, you have the ability to automatically display the history of the modifications performed on each item of the displayed record. To do so, the data file must be logged.
To customize this window (or to translate it), all you have to do is include it in the project.
To include the window for the history of modifications in your application:
  1. Select "File .. Import .. WINDEV elements and their dependencies".On the "Project" pane, in the "Project" group, expand "Import" and select "WINDEV elements and their dependencies".
  2. Select the sub-directory containing the elements to import. The configuration window of the timer button is found in the "Programs\Data\Preset windows\AAF" sub-directory of the setup directory of WINDEV.
  3. WINDEV lists the elements found in the directory. This directory contains the different elements corresponding to the customizable AAFs. The window to import is named "WINDEVAaf_HFLogWindow.wdw".
  4. Validate. The window is included in the project and it can be modified. This custom window will be automatically taken into account when running the application.
Notes:
  • The window must not be renamed.
  • If this window is included in your application, you may not benefit from the improvements made to this window during the different updates. Don't forget to check whether this window has evolved.
  • Caution: To modify this window, the corresponding file must not be read-only. Modify the characteristics of the file in Windows if necessary.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment