You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|mode|Integer|->|`dk key as string`: primary key is returned as a string, no matter the primary key type|
610
-
|Result|Text|<-|Value of the text primary key of the entity|
611
-
|Result|Integer|<-|Value of the numeric primary key of the entity|
610
+
|Result|any|<-|Value of the primary key of the entity (Integer or Text)|
612
611
613
612
<!-- END REF -->
614
613
@@ -1603,11 +1602,11 @@ Returns:
1603
1602
1604
1603
#### Description
1605
1604
1606
-
The `.touched()` function <!-- REF #EntityClass.touched().Summary -->tests whether or not an entity attribute has been modified since the entity was loaded into memory or saved<!-- END REF -->.
1605
+
The `.touched()` function <!-- REF #EntityClass.touched().Summary -->returns True if at least one entity attribute has been modified since the entity was loaded into memory or saved<!-- END REF -->. You can use this function to determine if you need to save the entity.
1607
1606
1608
-
If an attribute has been modified or calculated, the function returns True, else it returns False. You can use this function to determine if you need to save the entity.
1607
+
This only applies to attributes of [`kind`](DataClassClass.md#returned-object) "storage" or "relatedEntity".
1609
1608
1610
-
This function returns False for a new entity that has just been created (with [`.new()`](DataClassClass.md#new)). Note however that if you use a function which calculates an attribute of the entity, the `.touched()` function will then return True. For example, if you call [`.getKey()`](#getkey) to calculate the primary key, `.touched()` returns True.
1609
+
For a new entity that has just been created (with [`.new()`](DataClassClass.md#new)), the function returns False. However in this context, if you access an attribute whose [`autoFilled` property](./DataClassClass.md#returned-object) is True, the `.touched()` function will then return True. For example, after you execute `$id:=ds.Employee.ID` for a new entity (assuming the ID attribute has the "Autoincrement" property), `.touched()` returns True.
1611
1610
1612
1611
#### Example
1613
1612
@@ -1649,7 +1648,7 @@ In this example, we check to see if it is necessary to save the entity:
1649
1648
1650
1649
The `.touchedAttributes()` function <!-- REF #EntityClass.touchedAttributes().Summary -->returns the names of the attributes that have been modified since the entity was loaded into memory<!-- END REF -->.
1651
1650
1652
-
This applies for attributes of the [kind](DataClassClass.md#attributename)`storage` or `relatedEntity`.
1651
+
This only applies to attributes of [`kind`](DataClassClass.md#returned-object) "storage" or "relatedEntity".
1653
1652
1654
1653
In the case of a related entity having been touched (i.e., the foreign key), the name of the related entity and its primary key's name are returned.
Copy file name to clipboardExpand all lines: docs/API/FileClass.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -572,7 +572,7 @@ You want to rename "ReadMe.txt" in "ReadMe_new.txt":
572
572
573
573
The `.setAppInfo()` function <!-- REF #FileClass.setAppInfo().Summary -->writes the *info* properties as information contents of an application file<!-- END REF -->.
574
574
575
-
The function must be used with an existing, supported file: **.plist** (all platforms), **.exe**/**.dll** (Windows), or **macOS executable**. If the file does not exist on disk or is not a supported file, the function does nothing (no error is generated).
575
+
The function can only be used with the following file types: **.plist** (all platforms), existing **.exe**/**.dll** (Windows), or **macOS executable**. If used with another file type or with a **.exe**/**.dll** file that does not already exist on disk, the function does nothing (no error is generated).
576
576
577
577
***info* parameter object with a .plist file (all platforms)**
578
578
@@ -582,6 +582,8 @@ The function only supports .plist files in xml format (text-based). An error is
582
582
583
583
:::
584
584
585
+
If the .plist file already exists on the disk, it is updated. Otherwise, it is created.
586
+
585
587
Each valid property set in the *info* object parameter is written in the .plist file as a key. Any key name is accepted. Value types are preserved when possible.
586
588
587
589
If a key set in the *info* parameter is already defined in the .plist file, its value is updated while keeping its original type. Other existing keys in the .plist file are left untouched.
Copy file name to clipboardExpand all lines: docs/API/WebServerClass.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -607,7 +607,7 @@ The `.start()` function <!-- REF #WebServerClass.start().Summary -->starts the w
607
607
608
608
The web server starts with default settings defined in the settings file of the project or (host database only) using the `WEB SET OPTION` command. However, using the *settings* parameter, you can define customized properties for the web server session.
609
609
610
-
All settings of [Web Server objects](../commands/web-server.md-object) can be customized, except read-only properties ([.isRunning](#isrunning), [.name](#name), [.openSSLVersion](#opensslversion), [.perfectForwardSecrecy](#perfectforwardsecrecy), and [.sessionCookieName(#sessioncookiename)]).
610
+
All settings of [Web Server objects](../commands/web-server.md-object) can be customized, except read-only properties ([.isRunning](#isrunning), [.name](#name), [.openSSLVersion](#opensslversion), [.perfectForwardSecrecy](#perfectforwardsecrecy), and [.sessionCookieName](#sessioncookiename)).
611
611
612
612
Customized session settings will be reset when the [`.stop()`](#stop) function is called.
Copy file name to clipboardExpand all lines: docs/Concepts/error-handling.md
+8-54Lines changed: 8 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ Within a custom error method, you have access to several pieces of information t
100
100
4D automatically maintains a number of variables called [**system variables**](variables.md#system-variables), meeting different needs.
101
101
:::
102
102
103
-
- the [`Last errors`](../commands-legacy/last-errors.md) command that returns a collection of the current stack of errors that occurred in the 4D application.
103
+
- the [`Last errors`](../commands/last-errors.md) command that returns a collection of the current stack of errors that occurred in the 4D application.
104
104
- the `Call chain` command that returns a collection of objects describing each step of the method call chain within the current process.
105
105
106
106
@@ -158,7 +158,7 @@ Try (expression) : any | Undefined
158
158
159
159
If an error occurred during its execution, it is intercepted and no error dialog is displayed, whether an [error-handling method](#installing-an-error-handling-method) was installed or not before the call to `Try()`. If *expression* returns a value, `Try()` returns the last evaluated value, otherwise it returns `Undefined`.
160
160
161
-
You can handle the error(s) using the [`Last errors`](../commands-legacy/last-errors.md) command. If *expression* throws an error within a stack of `Try()` calls, the execution flow stops and returns to the latest executed `Try()` (the first found back in the call stack).
161
+
You can handle the error(s) using the [`Last errors`](../commands/last-errors.md) command. If *expression* throws an error within a stack of `Try()` calls, the execution flow stops and returns to the latest executed `Try()` (the first found back in the call stack).
162
162
163
163
:::note
164
164
@@ -255,7 +255,7 @@ For more information on *deferred* and *non-deferred* errors, please refer to th
255
255
:::
256
256
257
257
258
-
In the `Catch` code block, you can handle the error(s) using standard error handling commands. The [`Last errors`](../commands-legacy/last-errors.md) function contains the last errors collection. You can [declare an error-handling method](#installing-an-error-handling-method) in this code block, in which case it is called in case of error (otherwise the 4D error dialog box is displayed).
258
+
In the `Catch` code block, you can handle the error(s) using standard error handling commands. The [`Last errors`](../commands/last-errors.md) function contains the last errors collection. You can [declare an error-handling method](#installing-an-error-handling-method) in this code block, in which case it is called in case of error (otherwise the 4D error dialog box is displayed).
Exceptions that interrupt code execution are returned by 4D but can have different origins such as the OS, a device, the 4D kernel, a [`throw`](../commands-legacy/throw.md) in your code, etc. A returned error is therefore defined by three elements:
302
+
Exceptions that interrupt code execution are returned by 4D but can have different origins such as the OS, a device, the 4D kernel, a [`throw`](../commands-legacy/throw.md) in your code, etc. An error is therefore defined by three elements:
303
303
304
-
- a **component signature**, which is the origin of the error
305
-
- a **message**, wich explains why the error occurred
304
+
- a **component signature**, which is the origin of the error (see [`Last errors`](../commands/last-errors.md) to have a list of signatures)
305
+
- a **message**, which explains why the error occurred
306
306
- a **code**, which is an arbitrary number returned by the component
307
307
308
-
These information are returned for every error (when available) by the [4D error dialog box](../Debugging/basics.md) and the [`Last errors`](../commands-legacy/last-errors.md) command. Keep in mind that, if you intercept and handle errors using a [error-handling method](#installing-an-error-handling-method), you need to process all information since a simple error code could not be correctly interpreted.
309
-
310
-
#### 4D component signatures
311
-
312
-
|Component Signature|Component|
313
-
|--|---|
314
-
|4DCM|4D Compiler runtime|
315
-
|4DRT|4D runtime|
316
-
|bkrs|4D backup & restore manager|
317
-
|brdg|SQL 4D bridge|
318
-
|cecm|4D code Editor|
319
-
|CZip|zip 4D apis|
320
-
|dbmg|4D database manager|
321
-
|FCGI|fast cgi 4D bridge|
322
-
|FiFo|4D file objects|
323
-
|HTCL|http client 4D apis|
324
-
|HTTP|4D http server|
325
-
|IMAP|IMAP 4D apis|
326
-
|JFEM|Form Macro apis|
327
-
|LD4D|LDAP 4D apis|
328
-
|lscm|4D language syntax manager|
329
-
|MIME|MIME 4D apis|
330
-
|mobi|4D Mobile|
331
-
|pdf1|4D pdf apis|
332
-
|PHP_|php 4D bridge|
333
-
|POP3|POP3 4D apis|
334
-
|SMTP|SMTP 4D apis|
335
-
|SQLS|4D SQL server|
336
-
|srvr|4D network layer apis|
337
-
|svg1|SVG 4D apis|
338
-
|ugmg|4D users and groups manager|
339
-
|UP4D|4D updater|
340
-
|VSS |4D VSS support (Windows Volume Snapshot Service) |
341
-
|webc|4D Web view|
342
-
|xmlc|XML 4D apis|
343
-
|wri1|4D Write Pro|
344
-
345
-
346
-
#### System component signatures
347
-
348
-
|Component Signature|Component|
349
-
|--|---|
350
-
|CARB|Carbon subsystem|
351
-
|COCO|Cocoa subsystem|
352
-
|MACH|macOS Mach subsystem|
353
-
|POSX|posix/bsd subsystem (mac, linux, win)|
354
-
|PW32|Pre-Win32 subsystem|
355
-
|WI32|Win32 subsystem|
308
+
The [4D error dialog box](../Debugging/basics.md) displays the code and the message to the user.
356
309
310
+
To have a full description of an error and especially its origin, you need to call the [`Last errors`](../commands/last-errors.md) command. When you intercept and handle errors using an [error-handling method](#installing-an-error-handling-method) in your final applications, use [`Last errors`](../commands/last-errors.md) and make sure you log all properties of the *error* object since error codes depend on the components.
0 commit comments