rules repository

A-1130

πŸ†“
Warning

Always follow naming conventions for page items.

Reason

APEX automatically prefixes items with P{page_id}_. This ensures unique item names across an app and makes it predictable for developers to use them.

Example

Non-Compliant Example

page 3 (
    // ...
    pageItem FOLDER_NAME (
        // ...
    )
)
Issues
LineColumnMessage
314Page item FOLDER_NAME should be named P3_FOLDER_NAME.

Compliant Solution - β˜…β˜…β˜…β˜…β˜…

page 3 (
    // ...
    pageItem P3_FOLDER_NAME (
        // ...
    )
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || pi.item_name as identifier,
       'Item ' || pi.item_name || ' in app ' || aa.alias || ' of ' || aa.workspace 
       || ' should be named ' || 'P' || pi.page_id || '_' || pi.item_name || '.' as message
  from apex_application_page_items pi
  join apex_applications aa on pi.application_id = aa.application_id
       and pi.workspace = aa.workspace
 where not regexp_like(pi.item_name, '^P' || pi.page_id || '_(.+)$')
   and pi.item_name not like '%P' || pi.page_id || '%'
   and aa.workspace in (#ApexWorkspaces#)

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.FOLDER_NAMEItem FOLDER_NAME of app CUSTOMERS in WORKSPACE should be named P3_FOLDER_NAME.-

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
ApexWorkspacesComma-separated List of APEX workspaces owning APEX applications to check.dblinter, dbl_gui

References