example-reset-and-sample-scripts¶
This section provides example scripts for resetting the context menu configuration and seeding sample menu items for testing and demonstration purposes.
Comprehensive Example Templates¶
For complete, production-ready context menu implementations, see these detailed templates in the example scripts:
Comprehensive Workflow Integration Template - Advanced comprehensive template demonstrating all major MFSQL integration patterns including: - Complete parameter validation and error handling - Temporary table processing for complex operations - Valuelist item management and synchronization - Object relationship handling - Automated email notifications for error conditions - Batch processing optimizations - Complete audit trail and debugging support
custom DoCMObjectActionForWorkFlowState - Focused workflow state action template
custom DoCMObjectAction - Basic context menu object action template
Template - custom procedure - Minimal custom procedure template
Testing and Validation¶
After setting up the sample menu items:
Test Menu Visibility: Verify menu items appear for users in the ContextMenu group
Test Procedure Execution: Execute menu actions and verify logging in MFProcessBatch
Test Error Handling: Trigger errors intentionally and verify error logging works
Test Workflow Integration: Set up workflow state actions using the StateAction items
Sample Testing Scripts:
-- Check process batch logs after execution
SELECT TOP 10
pb.ProcessType,
pb.LogText,
pb.LogStatus,
pb.Created,
pbd.LogProcedureStep,
pbd.LogText AS DetailText
FROM dbo.MFProcessBatch pb
LEFT JOIN dbo.MFProcessBatchDetail pbd ON pb.ProcessBatch_ID = pbd.ProcessBatch_ID
WHERE pb.ProcessType LIKE '%Comprehensive%'
ORDER BY pb.Created DESC, pbd.ID;
-- Check for any errors in the log
SELECT * FROM dbo.MFLog
WHERE SPName LIKE '%Comprehensive%'
ORDER BY ID DESC;
Development Guidelines¶
When developing custom context menu procedures:
Start with Templates: Begin with the comprehensive template and remove unused sections
Implement Logging: Always use ProcessBatch logging for audit trails
Handle Errors Gracefully: Implement comprehensive error handling
Test Thoroughly: Test with various object types and failure scenarios
Document Customizations: Update procedure headers with specific implementation details
Security Review: Ensure all dynamic SQL follows security best practices