How to execute same subroutine for different modules (Requirements and Defects)
I'm trying to customize (like setting the field order) the fields in both the requirements and defects module. Under workflow, I set the subroutine (see below) only changing Bug_Fields (used for defects) to Req_Fields under the requirements section:
Sub SetFieldApp( FieldName, Vis, Req, PNo, VOrder )
.IsVisible = Vis
.IsRequired = Req
.PageNo = PNo
.ViewOrder = VOrder
When I use the subroutine in both modules (seems like this is the problem), I'm getting:
A failure has occurred in the workflow script in function <SetFieldApp>)
Error at Line 613 (character 3)
Type mismatch: 'Bug_Fields'.
It's pointing to "With Bug_Fields(FieldName)" as the problem. Should I be able to use the same subroutine (only changing fields referencing to) under the workflow for 2 different modules?
When I only had the code under the Requirements module - it was okay.
Thanks Alex. I tried that earlier and it did get rid of the error. However, it didn't sort the fields displayed based on how I had it defined. I ended up keeping the subroutine under the requirements and set the example below for the defects:
Bug_Fields("BG_DETECTION_DATE").ViewOrder = 1