Workflow Actions
What are Actions?#
Actions are the tasks that workflows perform. They're the "do something" part of your workflow logic - sending emails, updating fields, creating records, and more.
Types of Actions#
Send Email Action#
Send automated email notifications to users, customers, or any email address.
Configuration:
- Sender: From record field, specific employee, or generic email
- Recipient: Specific users, roles, or from record
- Subject: Text with field references
- Body: Plain text or HTML with field references
- Attachments: Include PDFs, files, or records
Example: Order Confirmation
Action: Send EmailSender: {salesrep.email}Recipient: {entity.email}Subject: Order Confirmation - {tranid}Body: Dear {entity.firstname}, Thank you for your order #{tranid} placed on {trandate}. Order Total: {total} Expected Ship Date: {shipdate} You can track your order at: {url} Best regards, {salesrep.firstname} {salesrep.lastname}Advanced Options:
- CC/BCC recipients
- Reply-to address
- Include transaction PDF
- Use email templates
- HTML formatting
Set Field Value Action#
Update field values on the current record or related records.
Target:
- Current record (most common)
- Related record (customer, vendor, etc.)
- Parent/child records
Value Types:
- Static value: "Approved"
- Field reference: {amount}
- Formula: {amount} * 1.1
- Current date/time: {today}, {now}
- Current user: {currentuser}
Examples:
Simple Field Update:
Action: Set Field ValueField: StatusValue: Pending ApprovalCalculated Value:
Action: Set Field ValueField: custbody_discount_amountValue Formula: {amount} * 0.10Date Stamp:
Action: Set Field ValueField: custbody_approval_dateValue: {today}User Tracking:
Action: Set Field ValueField: custbody_approved_byValue: {currentuser}Related Record Update:
Action: Set Field ValueTarget: Customer RecordField: custentity_last_order_dateValue: {trandate}Create Record Action#
Generate new records automatically.
Record Types:
- Custom records
- Tasks
- Calendar events
- Support cases
- Phone calls
- Any standard NetSuite record
Configuration:
- Record type
- Field values (can reference current record)
- Owner/assignee
- Link to parent record
Example: Create Follow-up Task
Action: Create RecordRecord Type: TaskFields: Title: Follow up on Order {tranid} Assigned To: {salesrep} Due Date: {trandate} + 3 days Priority: Medium Status: Not Started Company: {entity} Transaction: {current record} Message: Please follow up with customer regarding order {tranid}. Order amount: {total}Example: Create Custom Record Entry
Action: Create RecordRecord Type: Equipment Maintenance Log (custom)Fields: custrecord_equipment: {custbody_equipment_id} custrecord_maintenance_date: {today} custrecord_maintenance_type: Scheduled Service custrecord_performed_by: {currentuser} custrecord_notes: Automatic service entry from workflowTransform Record Action#
Convert one transaction type to another.
Common Transformations:
- Sales Order โ Item Fulfillment
- Sales Order โ Invoice
- Item Fulfillment โ Invoice
- Purchase Order โ Item Receipt
- Purchase Order โ Vendor Bill
- Estimate โ Sales Order
Configuration:
- Source record type (automatic)
- Target record type
- Field mappings
- Line item handling
Example: Auto-Invoice
Action: Transform RecordTransform Type: Sales Order to InvoiceTrigger: When Item Fulfillment completedCopy Fields: - Terms - Ship Date - Memo - All custom fieldsReturn User Error Action#
Stop workflow execution and display error message to user.
Use Cases:
- Validation failures
- Business rule violations
- Missing required data
- Insufficient permissions
Configuration:
- Error message text
- Can include field references
- Prevents record save (Before Submit workflows)
Example: Credit Limit Check
Action: Return User ErrorCondition: {entity.creditlimit} < ({entity.balance} + {amount})Message: Cannot save order. Customer credit limit exceeded. Credit Limit: {entity.creditlimit} Current Balance: {entity.balance} Order Amount: {amount} Please contact credit department for approval.Example: Required Field Validation
Action: Return User ErrorCondition: {shipdate} is emptyMessage: Ship Date is required for all orders over $1,000.Go To State Action#
Force transition to a specific state.
Use Cases:
- Skip intermediate states
- Jump to error handling state
- Restart process
- Emergency exits
Configuration:
- Target state
- Execution conditions
Example: Emergency Approval Override
Action: Go To StateTrigger: Button Press (Override Approval)Target State: ApprovedConditions: Current User Role = AdministratorPrior Actions: - Log override in notes - Send notification to audit team - Set custom flag fieldExecute Script Action#
Run custom SuiteScript for complex logic.
Script Types:
- Workflow action scripts
- Custom deployment parameters
- Access to workflow context
Use Cases:
- Complex calculations
- External API calls
- Advanced data manipulation
- Integration with other systems
Configuration:
- Select deployed script
- Pass parameters
- Handle return values
Example: Calculate Complex Pricing
Action: Execute ScriptScript: Custom Pricing CalculatorParameters: customer_id: {entity.id} order_amount: {amount} product_category: {custbody_category}Returns: calculated_price โ Set in custbody_final_price fieldAdd Button Action#
Add custom buttons to record forms.
Configuration:
- Button label
- Button location
- Conditions for display
- Actions to execute on click
Example: Quick Approval Button
Action: Add ButtonLabel: Quick ApproveLocation: Transaction bodyDisplay When: {approvalstatus} = 'Pending Approval'On Click Actions: 1. Set Field: approvalstatus = 'Approved' 2. Set Field: custbody_approved_by = {currentuser} 3. Set Field: custbody_approval_date = {today} 4. Send Email to Requester 5. Go To State: ApprovedRemove Button Action#
Hide standard buttons based on conditions.
Use Cases:
- Restrict certain actions
- Enforce process flow
- Prevent user errors
Example:
Action: Remove ButtonButton: EditCondition: {approvalstatus} = 'Approved' AND Current User Role != AdministratorCreate Task Record Action#
Simplified task creation (alternative to Create Record).
Configuration:
- Task title
- Assigned to user/role
- Due date
- Priority
- Status
- Company/contact
Example:
Action: Create Task RecordTitle: Review High Value Order - {tranid}Assigned To: Sales ManagerDue Date: {today} + 1 dayPriority: HighStatus: Not StartedCompany: {entity}Message: Order amount: {total} Customer: {entity.companyname} Sales Rep: {salesrep.firstname} {salesrep.lastname} Please review and approve.Send Campaign Email Action#
Send marketing emails through NetSuite campaigns.
Requirements:
- Campaign setup
- Email template
- Subscription management
Use Cases:
- Welcome emails
- Nurture campaigns
- Post-purchase follow-up
- Re-engagement
Send Notification Action#
Internal NetSuite notifications (not external email).
Configuration:
- Recipients (users/roles)
- Subject
- Message
- Link to record
Example:
Action: Send NotificationRecipients: Accounting Team RoleSubject: Large Invoice Created - {tranid}Message: A large invoice has been created: Customer: {entity} Amount: {total} Terms: {terms} Click here to view: {url}Initiate Workflow Action#
Trigger another workflow.
Use Cases:
- Complex multi-step processes
- Separate concerns
- Modular workflow design
Configuration:
- Target workflow
- Context record
- Parameter passing
Action Timing#
On Entry Actions#
Execute when entering a state.
Order of Execution:
- State entry actions (in order)
- Transition evaluation
- Exit actions if transitioning immediately
Best For:
- Initial setup
- Sending notifications
- Creating related records
- Status updates
Example:
State: Order Received
On Entry Actions: 1. Set Field: custbody_received_date = {today} 2. Set Field: custbody_received_by = {currentuser} 3. Send Email: Order confirmation to customer 4. Create Task: Process order (assigned to fulfillment)On Field Changed Actions#
Execute when specific field values change while in the current state.
Configuration:
- Which fields to monitor
- Conditions to check
- Actions to take
Best For:
- Reactive updates
- User-driven transitions
- Dynamic responses
Example:
State: Pending Approval
On Field Changed: Approval Status If {approvalstatus} = 'Approved': Actions: 1. Set Field: custbody_approved_date = {today} 2. Send Email: Approval notification 3. Go To State: Approved If {approvalstatus} = 'Rejected': Actions: 1. Set Field: custbody_rejected_date = {today} 2. Send Email: Rejection notification 3. Go To State: RejectedOn Exit Actions#
Execute when leaving a state.
Best For:
- Cleanup
- Final updates
- Logging
- Transition preparation
Example:
State: In Review
On Exit Actions: 1. Set Field: custbody_review_completed_date = {today} 2. Set Field: custbody_time_in_review = {today} - {custbody_review_started_date} 3. Update related records 4. Archive documentsBefore Record Submit Actions#
Execute before record saves (Before Submit workflows only).
Best For:
- Validation
- Required field checks
- Calculated field updates
- Preventing save with errors
Special Characteristics:
- Can prevent record save
- Access to old and new values
- Must complete quickly
After Record Submit Actions#
Execute after record saves (After Submit workflows).
Best For:
- External communications
- Creating other records
- Triggering integrations
- Updates requiring saved record
Special Characteristics:
- Record already saved
- Has internal ID
- Can safely send emails
- More processing time available
Action Conditions#
Control when actions execute within a state.
Execution Context#
Always Execute
- No condition
- Runs every time
If Workflow Condition is True
- Uses workflow-level condition
- Most common approach
If Custom Condition is True
- Action-specific condition
- More granular control
Example: Conditional Email
State: Order Processing
Action: Send Email to Premium Customers Execution Context: If Custom Condition is True Condition: {entity.custentity_customer_tier} = 'Premium' Email: Premium customer order processing notification Action: Send Email to Standard Customers Execution Context: If Custom Condition is True Condition: {entity.custentity_customer_tier} != 'Premium' Email: Standard order processing notificationComplex Action Sequences#
Multiple Actions in Sequence#
Actions execute in order listed:
State: Approve Order
On Entry Actions: 1. Set Field: Status = Approved โ 2. Set Field: Approved By = {currentuser} โ 3. Set Field: Approved Date = {today} โ 4. Send Email: Notify customer โ 5. Send Email: Notify fulfillment โ 6. Create Task: Process order โ 7. Update Customer: Last order date โ 8. Go To State: Ready for Fulfillment โConditional Action Chains#
Different action sets based on conditions:
State: Process Payment
Action Set 1: For Credit Card Condition: {paymentmethod} = 'Credit Card' Actions: 1. Execute Script: Process credit card 2. Set Field: Payment Status = 'Paid' 3. Send Email: Payment receipt 4. Create Invoice Action Set 2: For Net Terms Condition: {paymentmethod} = 'Terms' Actions: 1. Set Field: Payment Status = 'Terms' 2. Set Field: Due Date = {trandate} + {terms} 3. Send Email: Invoice with terms 4. Create Task: Follow up on payment Action Set 3: For Wire Transfer Condition: {paymentmethod} = 'Wire Transfer' Actions: 1. Set Field: Payment Status = 'Awaiting Wire' 2. Send Email: Wire instructions 3. Create Task: Verify wire receiptAction Best Practices#
Email Actions#
Clear Subject Lines
Good: - "Order {tranid} Confirmation" - "Action Required: Approve {tranid}" - "Invoice {tranid} Payment Due"
Avoid: - "Notification" - "Update" - "FYI"Professional Content
Good Email Body: - Clear purpose - Relevant details - Call to action - Professional tone - Link to record - Contact information
Avoid: - Too much information - Unclear purpose - No action items - Informal languageTest Email Recipients
- Use test accounts initially
- Verify email addresses
- Check spam filters
- Test with different email clients
Field Updates#
Atomic Updates
Good: Set Field: Status = 'Approved' Avoid: Set Field: Status = {field1} + {field2} + complex calculation (Use formula fields or scripts for complex logic)Track Changes
Always update tracking fields: - Date of change - User who made change - Previous value (if needed) - Reason for changeAvoid Circular Updates
Bad Pattern: Workflow 1: Field A changes โ Update Field B Workflow 2: Field B changes โ Update Field A (Creates infinite loop!) Good Pattern: Workflow: Field A changes โ Update Field B Use conditions to prevent loopsRecord Creation#
Link Records Properly
When creating task: - Set Company field - Set Transaction field - Set Contact field - Provides context - Enables reportingSet All Required Fields
- Don't rely on defaults
- Explicitly set key fields
- Validate before creation
Consider Volume
- Each created record uses resources
- Batch operations in scheduled workflows
- Monitor governance limits
Error Handling#
Graceful Failures
Action: Execute ScriptOn Error: - Log error details - Send notification to admin - Set error flag on record - Don't leave record in broken stateUser-Friendly Messages
Good Error Message: "Unable to process order. Ship date must be at least 2 days from order date. Please update and try again."
Bad Error Message: "Error: Validation failed"Performance Considerations#
Action Count Limits#
Workflow Governance:
- Limit actions per execution
- Each action consumes units
- Monitor usage
Best Practices:
- Combine related updates
- Use conditions to limit execution
- Consider scheduled workflows for bulk
Expensive Actions#
High Cost:
- External scripts
- Record transformations
- Complex searches
- Multiple record creations
Lower Cost:
- Field updates
- Simple emails
- Basic conditions
Optimization Tips#
Batch Field Updates
Instead of: Action 1: Set Field A Action 2: Set Field B Action 3: Set Field C
Consider: Single script that updates A, B, and C togetherConditional Execution
Add conditions to expensive actions: Action: Execute Complex Script Condition: Only when {amount} > 10000 (Saves resources on smaller transactions)Testing Actions#
Test Checklist#
Email Actions:
- Recipient receives email
- Subject line correct
- Body content accurate
- Field references populate
- Links work
- Attachments included
- From address correct
Field Updates:
- Field updates correctly
- Formula calculates properly
- Related records update
- No unexpected side effects
- Audit trail correct
Record Creation:
- Record created successfully
- All fields populated correctly
- Links to parent record work
- Owner/assignee correct
- Appears in correct lists
Scripts:
- Script executes without errors
- Parameters passed correctly
- Return values handled
- Error cases caught
- Performance acceptable
Testing Scenarios#
Happy Path
- Normal workflow execution
- All conditions met
- Expected results
Edge Cases
- Missing optional data
- Minimum/maximum values
- Unusual combinations
Error Conditions
- Invalid data
- Missing required fields
- Permission issues
- System errors
Load Testing
- Multiple concurrent executions
- Large data volumes
- Complex conditions
Troubleshooting Actions#
Common Issues#
Emails Not Sending:
- Check recipient email address
- Verify sender permissions
- Check for email template errors
- Review execution log
- Verify workflow has email permission
Fields Not Updating:
- Check field permissions
- Verify field is not read-only
- Check execution conditions
- Review field dependencies
- Look for conflicting workflows
Records Not Creating:
- Verify all required fields set
- Check user permissions
- Review field values
- Check for validation errors
- Monitor governance limits
Scripts Failing:
- Check script deployment
- Verify parameters
- Review error logs
- Check script permissions
- Test script independently
Debug Mode#
Enable Workflow Logging:
- System > Diagnostics > Workflow Execution Log
- Shows every action attempted
- Displays errors and results
- Critical for troubleshooting
Add Logging Actions:
Action: Set Field (for debugging)Field: custbody_debug_logValue: Reached state X at {now}, amount={amount}Action Examples by Use Case#
Approval Process#
State: Pending Approval
On Entry: 1. Set Field: Status = 'Pending Approval' 2. Create Task: Review and approve Assigned To: {approver} Due: {today} + 2 days 3. Send Email: Approval request To: {approver} Subject: Approval Needed - {tranid}
On Field Changed: Approval Status = 'Approved' 1. Set Field: Approved By = {currentuser} 2. Set Field: Approved Date = {today} 3. Send Email: Approval confirmation 4. Go To State: Approved
On Field Changed: Approval Status = 'Rejected' 1. Set Field: Rejected By = {currentuser} 2. Set Field: Rejected Date = {today} 3. Send Email: Rejection notice with reason 4. Go To State: RejectedOrder Fulfillment#
State: Ready to Ship
On Entry: 1. Create Record: Item Fulfillment From: {current sales order} Ship Date: {shipdate} 2. Set Field: Fulfillment Status = 'In Progress' 3. Send Email: Shipping notification To: {entity.email} Include: Tracking information 4. Create Task: Prepare shipment Assigned To: Warehouse Team
On Item Fulfillment Complete: 1. Transform Record: Create Invoice 2. Send Email: Invoice to customer 3. Set Field: Order Status = 'Billed' 4. Go To State: CompletedCustomer Onboarding#
State: New Customer
On Entry: 1. Send Email: Welcome email to customer 2. Create Task: Schedule kickoff meeting Assigned To: {salesrep} Due: {today} + 3 days 3. Create Task: Request W-9 Assigned To: Accounting Due: {today} + 5 days 4. Create Custom Record: Onboarding Checklist 5. Set Field: custentity_onboarding_status = 'In Progress' 6. Send Notification: New customer alert to team 7. Go To State: Onboarding In ProgressNext Steps#
Continue to:
- Workflow Conditions: Master conditional logic
- Workflow Examples: Complete real-world workflows