Form extension references

This SQL script looks for any form extension metadata to a particular .NET method name. This is helpful if you are looking in .NET code, and you see a method that appears to used in one of the events of a form extension, and you want to see on which forms the method is called.

FormKey, FormDescription, FormTitle - the form on which the form extension is linked to; note that the form extension might not necessarily be executed on this form; it might be executed on this form, other form(s), or not at all (which would make it be a child-less form extension).

ControlFormKey, ControlFormDescription, ControlFormTitle - These are the forms on which the extension has been placed as a form control.

If all the Form references are empty, but the obj_description is returned, this means it is an Object Extension.

SQL Script

declare @searchTerm nvarchar(100)
 
-- enter the name of the METHOD to search for here:
SET @searchTerm = 'PaintTimeNearLimitLabel'
 
--- do not change below this line ----
SELECT
obj_description,
obj_name,
[FormKey] = baseform.dyn_key,
[FormDescription] = baseform.dyn_description,
[FormTitle] = baseform.dyn_title,
[ControlFormKey] = controlform.dyn_key,
[ControlFormDescription] = controlform.dyn_description,
[ControlFormTitle] = controlform.dyn_title,
dyx_object_assembly,
dyx_object_typename,
dyx_object_initialize_method,
dyx_object_initialize_parameters,
dyx_object_load_method,
dyx_object_load_parameters,
dyx_object_before_save_method,
dyx_object_before_save_parameters,
dyx_object_after_save_method,
dyx_object_after_save_parameters
 
FROM md_dynamic_form_extension (nolock)
LEFT JOIN md_dynamic_form baseform (nolock)
ON baseform.dyn_key = dyx_dyn_key
JOIN md_object (nolock)
ON isnull(baseform.dyn_obj_key, dyx_obj_key) = obj_key
LEFT JOIN md_dynamic_form_control c (nolock)
ON c.dys_control_name = dyx_control_id
LEFT JOIN md_dynamic_form controlform (nolock)
ON c.dys_dyn_key = controlform.dyn_key
 
WHERE
dyx_object_initialize_method LIKE '%' + @searchTerm + '%'
OR dyx_object_load_method LIKE '%' + @searchTerm + '%'
OR dyx_object_before_save_method LIKE '%' + @searchTerm + '%'
OR dyx_object_after_save_method LIKE '%' + @searchTerm + '%'