rules repository

A-0990 Always name buttons in uppercase.

Severity Warning Check + SQL-based Test Free New

Reason

A button's Name becomes the REQUEST value that page submits and server-side conditions test. REQUEST comparisons are case-sensitive, so a consistent upper-case convention (for example SAVE, DELETE) avoids subtle bugs where a condition like REQUEST = 'SAVE' silently fails to match a button named Save.

Rename the button so its Name is upper case, and update any REQUEST comparisons that referenced the old name.

Example

Non-Compliant Example

page 10 (
    // ...
    button save (
        buttonName: Save
        label: Save
        // ...
    )
)
Issues
LineColumnMessage
421Button Save is not upper case.

Compliant Solution - ★★★★★

page 10 (
    // ...
    button save (
        buttonName: SAVE
        label: Save
        // ...
    )
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || bt.page_id || '.' || bt.button_name as identifier,
       'Button ' || bt.button_name || ' in page ' || bt.page_id
         || ' of app ' || aa.alias || ' in ' || aa.workspace
         || ' is not upper case.' as message
  from apex_application_page_buttons bt
  join apex_applications aa
    on aa.application_id = bt.application_id
       and aa.workspace = bt.workspace
 where bt.button_name != upper(bt.button_name)
   and aa.workspace in (#ApexWorkspaces#)

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.10.SaveButton Save in page 10 of app CUSTOMERS in WORKSPACE is not upper case.-

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