Start a conversation

Configuring the Sales Order Related Tab and Attachment Delete Button Visibility

Symptom

The "Related" tab (containing "Generated" and "Uploaded" document sections) is not visible on the Sales Order page. Or, the Delete button on attachments needs to be hidden for certain users.

Cause

The Related tab visibility is controlled by the Sales Order Summary Spec (SOSS) JSON configuration. If the SOSS explicitly defines a tabs array without including a relatedItems section, the Related tab will not appear. Additionally, a custom CSS rule in a Static Resource may force display: none on the tab.

The Delete button visibility is controlled by the CloudSense State Manager Apex hook, not by standard Salesforce permissions.

Resolution

Option A - Rely on default tabs (simplest)

If the Sales Order Summary Spec JSON does not define a tabs array, the app builds a default tab set that already includes a Related tab. Simply remove the tabs key from the SOSS JSON.

Option B - Explicit tabs

If your SOSS JSON defines a tabs array (to control Detail and Line Items tabs), you must explicitly add a tab with a relatedItems section:

{
  "tabs": [
    {
      "label": "Detail",
      "sections": [...]
    },
    {
      "label": "Line Items",
      "lineItemRelatedList": [...]
    },
    {
      "label": "Related",
      "sections": [
        {
          "type": "relatedItems"
        }
      ]
    }
  ]
}

Check for CSS overrides

If the tab is still not visible after configuration, check custom Static Resources for CSS rules that may be hiding the tab (e.g., display: none on the Related tab container).

Controlling the Attachment Delete Button

The Delete button in both the "Generated" and "Uploaded" sections is controlled by the State Manager:

  1. Navigate to Custom Settings > SalesOrderAPI
  2. Find the SalesOrderStateManager field -- it contains the API name of an Apex class implementing csmso.SalesOrderAPI.SalesOrderStateManager
  3. In that Apex class, the getFieldAttributesForSalesOrder method returns a Map that can include the key attachmentDeleteButtonVisibility

Visibility values:

Value Effect
H Hidden -- Delete button is not shown
D Disabled -- Delete button is visible but not clickable
(omitted) Delete button is shown and enabled

Implement logic in the State Manager class to return H or D based on user profile, permission set, or Sales Order status.

Additional Notes

  • The "Generated" section shows system-generated documents (e.g., insertion orders) with Create, Download, Delete, and Click Approve actions
  • The "Uploaded" section shows user-uploaded files with Upload, Download, and Delete actions
  • Section labels come from custom labels Attachments_Heading_Generated and Attachments_Heading_Uploaded
  • The State Manager controls Delete for both sections simultaneously -- there is no separate control per section
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments