Exemple de champ personnalisé calculé : afficher l’historique des modifications d’un champ
Si les utilisateurs et utilisatrices mettent régulièrement à jour les champs personnalisés et que vous souhaitez capturer un journal de toutes les modifications apportées à un champ ainsi que la date à laquelle ces modifications ont eu lieu, vous pouvez capturer ces informations dans un champ personnalisé calculé.
The following example shows you how to build the Instructions Edit History calculated field to capture all the change made to a single-line text field called Instructions.
This does this following:
-
Limits the Instructions Edit History field to the most recent 2000 characters to stay within the Workfront database limit.
-
Checks if the current value of the Instructions field matches the front of the Instructions Edit History value; it assumes it is blank and if it is not, it does the following:
- If they match, it leaves the Instructions Edit History as is;
- If they do not match, it replaces the Instructions Edit History with the latest value in the Instructions field, followed by the current date in parentheses, a vertical bar, and the previous Instructions Edit History, which preserves the previous value(s) and the date(s) when they were entered.
Conditions d’accès
Conditions d’accès
| table 0-row-2 1-row-2 2-row-2 3-row-2 layout-auto html-authored no-header | |
|---|---|
| Package Adobe Workfront | Tous |
| Licence Adobe Workfront |
Standard Plan |
| Configurations des niveaux d’accès | Administrative access to Custom Forms |
| Autorisations d’objet | Autorisations de gestion sur les formulaires personnalisés |
Pour plus d’informations, voir Conditions d’accès requises dans la documentation Workfront.
Conditions préalables
Pour ajouter un champ calculé qui affiche l’historique des modifications d’un champ dans un formulaire personnalisé, vous devez tout d’abord :
- Créer le formulaire personnalisé
- Ajouter le champ dont vous voulez capturer l’historique au formulaire personnalisé
Afficher l’historique des modifications d’un champ
-
Accéder au formulaire personnalisé dans lequel vous souhaitez ajouter le champ calculé.
-
Pour créer un champ personnalisé de texte sur une seule ligne, par exemple, procédez comme suit :
- Click Single line text.
- Specify a Label for the custom field. For example, you can name it " Instructions".
- Cliquez sur Appliquer.
-
Cliquez sur Calculé pour ajouter un champ personnalisé calculé au formulaire.
-
Specify a Label for the calculated custom field. For example, you can name it "Instructions Edit History".
This is the field that will capture any changes made to the first field you created ("Instructions").
-
Cliquez sur Enregistrer et fermer.
-
Cliquez sur le nom du formulaire dans lequel vous avez ajouté deux champs pour le rouvrir.
-
Click the calculated custom field Instructions Edit History, then copy and paste the following in the Calculation box:
code language-none LEFT(IF(LEFT({DE:Instructions Edit History},LEN(IF(ISBLANK({DE:Instructions}),"-",{DE:Instructions})))={DE:Instructions},{DE:Instructions Edit History},CONCAT(IF(ISBLANK({DE:Instructions}),"-",{DE:Instructions})," (",$$NOW,") | ",{DE:Instructions Edit History})),2000) -
(Recommandé) Collez le même calcul dans le champ Instructions sur le champ calculé du formulaire.
-
Make sure that Text is selected in the Format field to format the calculated custom field as text.
Il s’agit de la valeur par défaut.
-
Cliquez sur Enregistrer et fermer.
Now, when you attach the custom form to an object and then someone changes the information in the Instructions field, the Instructions Edit History field displays the latest value, followed by the current date in parentheses, and a vertical bar. Si d’autres modifications sont apportées, elles sont ajoutées à ces informations de la même manière.
Dans le calcul ci-dessus, vous pouvez remplacer Instructions par le nom exact de votre champ de texte à une seule ligne dont vous voulez suivre l’historique, et Historique des modifications des instructions par le nom exact de votre champ calculé.