Custom Quote Action

Prev Next

Purpose

Allows you to add a business-specific button to the quote detail screen. When users select this button, your script runs automatically to perform a defined task or workflow.

This functionality allows you to execute specialized processes directly from a quote, such as exporting quote data to an external system, sending a quote for custom approval, or triggering a company-specific integration.

Setup

Follow these steps:

  1. Upload a script.

  2. Enable the script and custom button.

Upload a script

Upload a script for Custom Quote Action.

For details about uploading and configuring Groovy scripts, read Upload a Groovy script.

Enable the script and custom button

  1. From the application left navigation area, select Administration.

  2. From the top navigation bar, select Master Data Management.

  3. Move through or search to locate Setting Boolean and select it from the list.

  4. Select Enable Custom Quote Action.  

  5. Set the Setting Value Boolean switch to YES.

  6. Select Save.

The Custom Quote Action button appears in the Actions dropdown in quotes. By default, the button is hidden. To configure it:

  • In the Classic view—Manage both the button label and any UI profile–based restrictions through the UI Customization screen.

  • In the New UI—Read Customize actions for instructions on configuring and managing the button.

Binding variables

In addition to the common binding variables, the following binding variables are available for this extension point.

Variable name

Class

Description

salesItemsTree

SalesItemsTree

Represents the quote. It contains the functions you can use to query and modify the quote and its line item  

data.

accountInfo

AccountInfo

Basic data about the account, including its address.

userInfoList

Set<UserInfo>

List of all users in the system.

sourceQuotePFRecords

Set<PartnerFunctionRecord>

List of partner function records in the quote. If the script is triggered due to the quote copy action, the system populates this variable with information about the source quote’s partner functions.  

accountPFRecords

List<PartnerFunctionRecord>

List of partner function records for the account of the quote.

Expected output

The script should return one of the following Boolean values:

  • True—Script ran successfully.

  • False—Error occurred while executing the script.

Script execution

A script that you upload for this extension point runs automatically when users select the Custom Quote Action button from the Actions dropdown button in quotes.

Sample script

// Import necessary classes for the script
import com.imc.vocabulary.Schema
import com.imc.iss.groovy.salesitem.SalesItemsTree
import com.imc.iss.groovy.salesitem.SalesItemNode

System.out.println('Script Execution: SalesItemsTree Started');
def quoteTitle = salesItemsTree.getQuoteDataAttributeValue(Schema.objectName.getUriAsString());
System.out.println('Quote URI:- ' + salesItemsTree.getQuoteURI());
System.out.println('Quote Title: ' + quoteTitle);

for (SalesItemNode salesItemNode: salesItemsTree.getChildren()) {
	accessSalesItem(salesItemNode);
}
void accessSalesItem(SalesItemNode salesItemNode) {
	def position = salesItemNode.getSalesItemDataAttributeValue(Schema.salesItemPosition.getUriAsString());
	def ihQuantity = salesItemNode.getSalesItemDataAttributeValue(Schema.itemHeaderQuantity.getUriAsString());
	
	System.out.println('itemHeaderQuantity at ' + position + ' : ' + ihQuantity);
	
    List<SalesItemNode> salesItemNodes = salesItemNode.getChildren();
    for (SalesItemNode child: salesItemNodes) {
        accessSalesItem(child);
    }
}

return true;