need to get in a custom body field de employee who...
# ask-stanley-ai
m
need to get in a custom body field de employee who last modified the transaction. how can I do this?
c
AI generated answer (using internal Slack threads):
To get the employee who last modified the transaction in a custom body field, you can follow these steps: 1. Create a custom transaction body field. You can do this by navigating to
Customization > Lists, Records, & Fields > Transaction Body Fields > New
. Set the type to
List/Record
and select
Employee
from the list. 2. Create a workflow that triggers on the transaction record type you are interested in. You can do this by navigating to
Customization > Workflow > Workflows > New
. Set the
Record Type
to the transaction type you want to track. 3. In the workflow, add a
Set Field Value
action that triggers
Before Record Submit
. Set the
Field
to the custom field you created in step 1, and set the
Value
to
Current User
. This will set the custom field to the current user every time the transaction is edited. 4. Optionally, you can add a
State
to the workflow that checks the
context
of the transaction edit. This allows you to only capture edits made directly by users in the User Interface or by CSV Import, and ignore edits made by scripts or APIs. Here is a sample code snippet for the workflow action:
Copy code
javascript
var workflowAction = record.create({
    type: record.Type.WORKFLOW_ACTION,
    isDynamic: true,
});
workflowAction.setValue({
    fieldId: 'custbody_last_edited_by',
    value: runtime.getCurrentUser().id,
});
workflowAction.save();
Please note that this will only track the last user who edited the transaction, not the history of all edits. If you need to track all edits, you may need to use the
System Notes
feature or create a custom record to log all changes. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83093673
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830171704
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829699934
Please provide your feedback on this answer.