- 05 Oct 2023
- 3 Minutes to read
- Print
- DarkLight
Editable or deletable lines and columns
- Updated on 05 Oct 2023
- 3 Minutes to read
- Print
- DarkLight
By default, all lines on a deal are editable and deletable. You can control the status of certain lines for a user. For example, you will see all product type lines but you won't be able to edit the lines of a Type = “Carpet” product.
If your business logic is complex, you can use a custom Apex hook. For more information, see Line Items Operations Configurer.
You can use both a filter and an Apex hook to define the status of a line. If you do this, the results of both approaches must evaluate as TRUE for it to be Editable or Deletable.
To define lines as editable
Use a Salesforce formula field to control the editable status of a line on the zpl_ContractLineItem_c, zpl_PriceLookupLineItem_c, and zpl_DealLine_c objects.
- From the Lightning App Launcher, go to the appropriate Product Selector Configuration.
- In the Related tab, in the Edit Line Dialog Filters section, select New.
- In the New Edit Line Dialog Filter dialog:
- Line Item Field Name—Enter the API name of a Boolean Salesforce formula field on the Contract Line Item or the Price Lookup Line.
- Select Save.
When the field evaluates as TRUE on any given line item, the dialog filter will set the Editable flag on that line when it is loaded into the Line Items list.
- If you create several edit line dialog filters, all of them must evaluate as TRUE on any given line for it to be Editable.
- If the line is set to non-editable, then:
- You can still select it together with other lines. However, when you select Edit, the line will not open in the Edit Lines modal dialog.
- The row-level Edit button will not be displayed on the line.
To define lines as deletable
Use a Salesforce formula field to control the deletable status of a line on the zpl_ContractLineItem_c, zpl_PriceLookupLineItem_c, and zpl_DealLine_c objects.
- From the Lightning App Launcher, go to the appropriate Product Selector Configuration.
- In the Related tab, in the Delete Line Dialog Filters section, select New.
- In the New Delete Line Dialog Filter dialog:
- Line Item Field Name —Enter the API name of a Boolean Salesforce formula field on the Contract Line Item or the Price Lookup Line.
- Select Save.
When the field evaluates as TRUE on any given line, the dialog filter will set the Deletable flag on that line when it is loaded into the Line Items list.
- If you create several delete line dialog filters, all of them must evaluate as TRUE on any given line for it to be Deletable.
- If the line is set to non-deletable, then:
- You can still select it together with other lines. However, when you select Delete, the line will not be deleted.
- The row-level Delete button will not be displayed on the line.
To hide non-editable lines
You can decide to hide non-editable lines from the Line Items list. This simplifies the search and enhances your productivity.
- From the Lightning App Launcher, go to the appropriate Product Selector Configuration.
- In the Details tab, select the Hide Non-Editable Lines checkbox.
- Select Save.
You will now be able to see only the lines that you can edit.
To add editable/deletable columns to the list
You can add two special columns—Editable and Deletable—to the Line Items list by using the Line List Columns object. And you can mark these columns as visible to enable their filtering.
- From the Lightning App Launcher, go to the appropriate Product Selector Configuration.
- In the Related tab, in the Line List Column section, select New:
- Column Editable Indicator Type—Editable/Deletable.
- Line List Column Name—Editable/Deletable.
- Visible by Default checkbox—Checked.
- Select Save.
- If you add the Editable/Deletable columns to the line list then you will be able to filter these columns by using the filter panel controls.
- These columns do not have to be in the Filter Field Set. They will be available as filters automatically.
- If you do not want these columns to be visible in the list, you can still have them configured and clear the Visible by Default checkbox.