diff --git a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_0.sh b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_0.sh index 3f2b1305..fbf2d781 100644 --- a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_0.sh +++ b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_0.sh @@ -1,3 +1,5 @@ curl --request GET \ ---location 'https://.my.salesforce.com/services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \--data '' - +--location 'https:///services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' +--header 'Accept: application/json' \ diff --git a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_1.sh b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_1.sh index 057099dd..09e32b13 100644 --- a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_1.sh +++ b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_1.sh @@ -1,4 +1,6 @@ -curl --location --request PATCH 'https://.my.salesforce.com/services/data/v58.0/sobjects/Opportunity' \ +curl --request PATCH \ +--location 'https:///services/data/v58.0/sobjects/Opportunity' \ +--header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "AccountId": "", @@ -7,3 +9,4 @@ curl --location --request PATCH 'https://.my.salesforce.com/service "CloseDate": "", "Amount": "" }' + diff --git a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_2.sh b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_2.sh deleted file mode 100644 index af7b692e..00000000 --- a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_2.sh +++ /dev/null @@ -1,3 +0,0 @@ -curl --request GET \ ---location 'https://.my.salesforce.com/services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \ ---data '' diff --git a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_3.sh b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_3.sh deleted file mode 100644 index 057099dd..00000000 --- a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_3.sh +++ /dev/null @@ -1,9 +0,0 @@ -curl --location --request PATCH 'https://.my.salesforce.com/services/data/v58.0/sobjects/Opportunity' \ ---header 'Content-Type: application/json' \ ---data '{ - "AccountId": "", - "Name": "", - "StageName": "", - "CloseDate": "", - "Amount": "" -}' diff --git a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_4.yaml b/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_4.yaml deleted file mode 100644 index cbe3952e..00000000 --- a/plugins/salesforce-create-opportunity-for-account/.codeblocks/block_4.yaml +++ /dev/null @@ -1,21 +0,0 @@ -steps: - - action: - output_key: account_id - action_name: Get_Account_Id_By_Name - progress_updates: - on_complete: Account ID retrieval completed - on_pending: Retrieving Account ID - input_args: - Account_Name: data.Account_Name - - action: - output_key: result - action_name: Create_Opportunity_for_Account - progress_updates: - on_complete: Opportunity creation completed - input_args: - StageName: data.StageName - CloseDate: data.CloseDate - Name: data.Name - AccountId: data.account_id.records[0].Id - Amount: data.Amount - diff --git a/plugins/salesforce-create-opportunity-for-account/README.md b/plugins/salesforce-create-opportunity-for-account/README.md index 0d130733..467541f2 100644 --- a/plugins/salesforce-create-opportunity-for-account/README.md +++ b/plugins/salesforce-create-opportunity-for-account/README.md @@ -1,7 +1,7 @@ --- description: A plugin that creates a new sales opportunity for an account in Salesforce. difficulty_level: BEGINNER -fidelity: TEMPLATE +fidelity: GUIDE installation_asset_uuid: e401ffde-6b9d-412d-8aff-b93e7af5c75d name: Create a New Sales Opportunity for an Account purple_chat_link: https://developer.moveworks.com/creator-studio/developer-tools/purple-chat/?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+create+a+new+sales+opportunity+for+an+account.%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Sure%2C+I+can+help+with+that.+What+is+the+account+name%3F%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Acme+Corp%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Got+it.+What%27s+the+name+of+the+opportunity%3F%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Q1+Enterprise+Deal%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EUnderstood.+What+stage+should+I+set+the+opportunity+to%3F%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EThe+stage+should+be+set+as+Introduction.%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I%27ll+create+a+new+opportunity+with+the+given+details.%22%7D%2C%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EPlease+confirm+the+opportunity+details%3C%2Fstrong%3E%3Cbr%3E%5Cn%3Cstrong%3EAccount+Name%3A+%3C%2Fstrong%3EAcme+Corp%3Cbr%3E%5Cn%3Cstrong%3EOpportunity+Name%3A+%3C%2Fstrong%3EQ1+Enterprise+Deal%3C%2Fp%3E%5Cn%3Cp%3E%3Cstrong%3EOpportunity+Stage%3A+%3C%2Fstrong%3EIntroduction%3Cbr%3E%5Cn%3C%2Fp%3E%22%7D%2C%7B%22buttons%22%3A%5B%7B%22buttonText%22%3A%22Create+Opportunity+in+Salesforce%22%2C%22style%22%3A%22filled%22%7D%2C%7B%22buttonText%22%3A%22Edit+Details%22%2C%22style%22%3A%22outlined%22%7D%2C%7B%22buttonText%22%3A%22Cancel%22%2C%22style%22%3A%22outlined%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Creating+opportunity+in+Salesforce...%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22Opportunity+Created%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Q1+Enterprise+Deal%22%2C%22connectorName%22%3A%22salesforce%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D @@ -14,247 +14,74 @@ time_in_minutes: 10 # **Introduction :** -Salesforce is a CRM platform, and the **Salesforce Account Opportunity Creation** plugin streamlines the process of creating opportunities for specific accounts by leveraging the Account ID. By integrating this functionality into your bot, users can efficiently and seamlessly create opportunities for accounts, thereby improving productivity and organization. +The “**Create Opportunity For Account”** plugin enables users to quickly create new Opportunities in Salesforce that are directly linked to a specific Account, all through the Moveworks AI Assistant. With this plugin, users can efficiently add sales opportunities, helping to streamline pipeline management and accelerate sales processes. -This guide provides detailed, step-by-step instructions on incorporating the **Salesforce Account Opportunity Creation** feature into your bot using Creator Studio. +This guide will help you install and configure the plugin in Agent Studio within minutes. -Let us get started! +Let’s get started! # Prerequisites : -- Salesforce Connector built in Creator Studio (follow the [Salesforce Authentication](https://developer.moveworks.com/creator-studio/resources/connector/?id=salesforce) guide to create your connector) +- Access to Agent Studio # What are we building? -## **Conversation Design** +## **Agent Design** -This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat/?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+create+a+new+sales+opportunity+for+an+account.%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Sure%2C+I+can+help+with+that.+What+is+the+account+name%3F%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Acme+Corp%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Got+it.+What%27s+the+name+of+the+opportunity%3F%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Q1+Enterprise+Deal%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EUnderstood.+What+stage+should+I+set+the+opportunity+to%3F%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EThe+stage+should+be+set+as+Introduction.%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I%27ll+create+a+new+opportunity+with+the+given+details.%22%7D%2C%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EPlease+confirm+the+opportunity+details%3C%2Fstrong%3E%3Cbr%3E%5Cn%3Cstrong%3EAccount+Name%3A+%3C%2Fstrong%3EAcme+Corp%3Cbr%3E%5Cn%3Cstrong%3EOpportunity+Name%3A+%3C%2Fstrong%3EQ1+Enterprise+Deal%3C%2Fp%3E%5Cn%3Cp%3E%3Cstrong%3EOpportunity+Stage%3A+%3C%2Fstrong%3EIntroduction%3Cbr%3E%5Cn%3C%2Fp%3E%22%7D%2C%7B%22buttons%22%3A%5B%7B%22buttonText%22%3A%22Create+Opportunity+in+Salesforce%22%2C%22style%22%3A%22filled%22%7D%2C%7B%22buttonText%22%3A%22Edit+Details%22%2C%22style%22%3A%22outlined%22%7D%2C%7B%22buttonText%22%3A%22Cancel%22%2C%22style%22%3A%22outlined%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Creating+opportunity+in+Salesforce...%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22Opportunity+Created%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Q1+Enterprise+Deal%22%2C%22connectorName%22%3A%22salesforce%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. +This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat-builder/?workspace=%7B%22title%22%3A%22My+Workspace%22%2C%22botSettings%22%3A%7B%22name%22%3A%22%22%2C%22imageUrl%22%3A%22%22%7D%2C%22mocks%22%3A%5B%7B%22id%22%3A6518%2C%22title%22%3A%22New+Mock%22%2C%22transcript%22%3A%7B%22settings%22%3A%7B%22colorStyle%22%3A%22LIGHT%22%2C%22startTime%22%3A%2211%3A43+AM%22%2C%22defaultPerson%22%3A%22GWEN%22%2C%22editable%22%3Atrue%2C%22botName%22%3A%22%22%2C%22botImageUrl%22%3A%22%22%7D%2C%22messages%22%3A%5B%7B%22from%22%3A%22USER%22%2C%22text%22%3A%22I+need+to+create+a+new+sales+opportunity+for+an+account.%22%7D%2C%7B%22from%22%3A%22BOT%22%2C%22text%22%3A%22I+can+help+you+create+a+new+sales+opportunity+for+an+account.+Could+you+please+provide+the+following+details%3A+1.+Name+of+the+account+2.+Close+date+for+the+opportunity+3.+Name+of+the+opportunity+4.+Stage+name+of+the+opportunity%22%7D%2C%7B%22from%22%3A%22USER%22%2C%22text%22%3A%22account+name+%3A+Royal+Enfield%2C+++++++++++++++++++++++++++close+date+%3A+30th+january+2025%2C+++++++++++++++++++opportunity+name+%3A+Furniture++++++++++++++stagename+%3A+Propose%22%7D%2C%7B%22from%22%3A%22BOT%22%2C%22text%22%3A%22The+new+sales+opportunity+for+the+Royal+Enfield+account+has+been+successfully+created+with+the+following+details%3A+++++++++++++++++++++++++++++++-+Opportunity+Name%3A+Furniture+++++++++++++++++++++++++++++++++++++++++-+Close+Date%3A+January+30%2C+2025+++++++++++++++++++++++++++++++++++++++-+Stage+Name%3A+Propose%22%7D%5D%7D%7D%5D%7D) shows the experience we are going to build. -# **Creator Studio Components** +# **Installation Steps** -- **Triggers**: - 1. Natural Language -- **Slots**: - 1. Fetch Account ID - 2. Create Opportunity from retrieved Account ID with Opportunity Name, Stage Name, Close Date, and Amount. -- **Actions**: - 1. **Retrieve Account details by account name:** - - Query the account information by using the account name to obtain its unique Account ID. - 2. **Create the opportunity of the account:** - - Use the content provided by the user to create an opportunity associated with the specified account. -- **Guidelines:** - 1. None +While you can create a connector during plugin installation, we recommend setting up the connector in **Agent Studio** beforehand to streamline the process. Please follow our [**Salesforce Connector Guide**](https://developer.moveworks.com/marketplace/package/?id=salesforce&hist=home%2Cbrws#how-to-implement) for detailed instructions. Once completed, proceed to install the plugin and complete the setup efficiently. -# **API Research** +For this plugin, ensure the Salesforce integration user has the following permissions: -To build this use case, we will utilize two APIs. Since our goal is to fetch the Account Id and create opportunity for associated with the specified account, we'll focus on Salesforce's Opportunity-related APIs. Only two API calls are required to achieve this. +- `Read` access to the **Account** object +- `Read` and `Create` access to the **Opportunity** object -![image.png](image.png) +After configuring the connector, refer to our **[plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation)** for more details on completing the setup! -## API #1: Fetch Account ID from Account Name - -The [**Retrieve Account ID by Account Name**](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-account-details.html) API facilitates the retrieval of an **Account ID** from Salesforce using a given **Account Name**. By leveraging a SOQL query, this API ensures efficient and precise data retrieval, even in environments with numerous opportunities. - -- **Purpose**: Retrieves the **Account ID** associated with a specified **Account Name**. -- **Features**: Filters data by **Account Name** and provides accurate results, even in large datasets. -- **Example**: Executes a query in Salesforce to identify the **Account ID** linked to a given **Account Name**. - - ```bash - curl --request GET \ - --location 'https://.my.salesforce.com/services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \--data '' - - ``` - - -## **API #2: Create Opportunity for Account in salesforce** - -The [**Create Opportunity for Account in Salesforce**](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm) API allows you to create a new **Opportunity** record in Salesforce and link it to a specific account using the provided **Account name**. By including required fields such as retrieved **Account** **Id**, **Opportunity name**, **Stage name**, **Close date** and **Amount** in the payload. - -- **Purpose**: Creates a new **Opportunity** in Salesforce linked to a specified account. -- **Features**: Supports the inclusion of required fields like **Account** **Id**, **Opportunity name**, **Stage name, Close date** and **Amount.** -- **Example**: Creates an opportunity in Salesforce associated with the specified account using the provided details. - - ```bash - curl --location --request PATCH 'https://.my.salesforce.com/services/data/v58.0/sobjects/Opportunity' \ - --header 'Content-Type: application/json' \ - --data '{ - "AccountId": "", - "Name": "", - "StageName": "", - "CloseDate": "", - "Amount": "" - }' - ``` - -- ****: Your Salesforce instance domain (e.g., yourcompany.my.salesforce.com). -- **,, , ,**: The Opportunity details and the associated account ID.s - -# **Steps** +# **Appendix** -## **Step 1: Build HTTP Action** - -Define your HTTP Actions for fetching all the backlog ideas of a specific project : - -### **1.** Fetch Account ID from Account Name - -- In Creator Studio, create a new Action. - - Navigate to plugin section > Actions tab - - Click on CREATE to define a new action - - ![m1.png](m1.png) - -- Click on the  IMPORT CURL option and paste the following cURL command: - - ```bash - curl --request GET \ - --location 'https://.my.salesforce.com/services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \ - --data '' - ``` - -- Click on Use Existing Connector > select the Salesforce [](https://developer.moveworks.com/creator-studio/resources/connector/?id=jira)connector that you just created > Click on Apply. This will populate the Base URL and the Authorization section of the API Editor. -- **Query Parameters for Salesforce Account Query** - - Key ( q ) : ****Value (  **SELECT+Id+FROM+Account+WHERE+Name= '{{Account_Name}}’** ) - -- This **SOQL query** filters out the accounts by searching for the one with a specific **Name** value. The {{Account_name}} is a dynamic placeholder that will be replaced with the actual account name when the query is executed. This query will return the **Id** of the account that matches the provided name. - - ![image.png](image%201.png) - -- **Input Variables** : - - Account_Name : Example Value ( **Acme Corp**). - - ![image.png](image%202.png) - -- Click on Test to check if the Connector setup was successful and expect a successful response as shown below. You will see the request response on the left side and the generated output schema on the right. If the output schema does not match the API response or fails to populate automatically, kindly click the GENERATE FROM RESPONSE button to refresh and align the schema with the API response. - - ![image.png](image%203.png) - -- Add the **API Name** and **API Description** as shown below, then click the Save button - - ![image.png](image%204.png) - - -### 2. Create Opportunity for Account - -- Repeat the steps above to create another action. -- Click on the IMPORT CURL option and paste the following cURL command: - - ```bash - curl --location --request PATCH 'https://.my.salesforce.com/services/data/v58.0/sobjects/Opportunity' \ - --header 'Content-Type: application/json' \ - --data '{ - "AccountId": "", - "Name": "", - "StageName": "", - "CloseDate": "", - "Amount": "" - }' - ``` - -- To create a **opportunity** in Salesforce, we send a **POST** request with the following body: -- Use the existing connector by following the steps outlined in the previous point to populate the Base URL and Authorization section. -- **Header :** - - Key ( **Content-Type** ) : Value ( **application/json** ) - - ![image.png](image%205.png) - -- **Body :** - - **AccountId:** Retrieved account id from account name. - - **Name**: The name of an opportunity. - - **StageName:** The stage name of an opportunity. - - **CloseDate:** The closing date of an opportunity. - - **Amount :** The amount of an opportunity. - - - - ![image.png](b332f15c-21d5-4a20-8915-86e9e5292688.png) - -- **Input Variables** : - - **AccountId :** Example Value ( 0014W00003SSquvQAD ****) - - **CloseDate** : Example Value (2024-01-31) - - **Name :** Example Value (new bike deal) - - **StageName :** Example Value ( Closed Lost ****) - - **Amount :**  Example Value ( 1233.00 ****) - - ![image.png](image%206.png) - -- We have provided sample input variables for **AccountId**, **CloseDate**, **Name**, **StageName** and **Account**. Using these input variables, we tested the plugin by making a **POST** request to create a **Opportunity** in Salesforce. -- Test the Connector setup as described earlier to verify the response. If the output schema is incorrect or missing, click GENERATE FROM RESPONSE to update it. - - ![image.png](image%207.png) - -- Add the **API Name** and **API Description** as shown below, then click the `Save` button **** - - ![image.png](image%208.png) - +## API #1: Fetch Account ID from Account Name -## **Step 2: Build Compound Action** +The [**Retrieve Account ID by Account Name**](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-account-details.html) API retrieves a account id by account name. -- Head over to the **Compound Actions** tab and click **CREATE** - - ![m2.png](m2.png) - -- Give your Compound Action a **Name** and **Description** , then click Next Note: Name only letters, numbers, and underscores. We suggest using snake case or camel case formatting (e.g. Workflow_name or workflowName ) +```bash +curl --request GET \ +--location 'https:///services/data/v58.0/query?q=SELECT+Id+FROM+Account+WHERE+Name+LIKE+%27%25%25%27' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' +--header 'Accept: application/json' \ +``` - ![image.png](image%209.png) +**Query Parameters :** -- Click on the Script editor tab. Here you will be able to build your compound action using the YAML syntax. At a high-level, this syntax provides actions (HTTP Request, APIthon Scripts) and workflow logic (switch statements, for each loops, return statements, parallel, try/catch). See the [Compound Action Syntax](https://developer.moveworks.com/creator-studio/reference/compound_actions_syntax/) Reference for more info. - - ```yaml - steps: - - action: - output_key: account_id - action_name: Get_Account_Id_By_Name - progress_updates: - on_complete: Account ID retrieval completed - on_pending: Retrieving Account ID - input_args: - Account_Name: data.Account_Name - - action: - output_key: result - action_name: Create_Opportunity_for_Account - progress_updates: - on_complete: Opportunity creation completed - input_args: - StageName: data.StageName - CloseDate: data.CloseDate - Name: data.Name - AccountId: data.account_id.records[0].Id - Amount: data.Amount - - ``` - -- Click on Input fields tab and click the +Add button. Here you will define the slots that you want to collect from users through the conversation and trigger your Workflow with. After defining the input fields, click the Submit button to save your changes. - - ![image.png](image%2010.png) - +- `ACCOUNT_NAME`(string) – The name of the account to retrieve account id. -## **Step 3: Publish Workflow to Plugin** +## API #2: **Create Opportunity for Account** -- Head over to the Compound Actions tab and click on the kebab menu ( ︙ ) -- Next, click on Publish Workflow to Plugin -- First, verify your Plugin **Name** & **Short description** . This is autofilled from the name & description of your compound action. - - ![image.png](image%2011.png) - -- Next, consider whether to select the User consent required before execution? checkbox. Enabling this option prompts the user to confirm all slot values before executing the plugin, which is widely regarded as a best practice. - - ![image.png](image%2012.png) - -- Click Next and set up your positive and negative triggering examples. This ensures that the bot triggers your plugin given a relevant utterance. - - See our [guide](https://developer.moveworks.com/creator-studio/conversation-design/triggers/natural-language-triggers/#how-to-write-good-triggering-examples) on Triggering -- Lastly, click Next and set the **Launch Rules** you want your plugin to abide by. - - See our [guide](https://developer.moveworks.com/creator-studio/administration/launch-options/) on Launch Rules +The [**Create Opportunity for Account**](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm) API is used to create a new Opportunity associated with a specific Account. -## **Step 4: See it in action!** +```bash +curl --request PATCH \ +--location 'https:///services/data/v58.0/sobjects/Opportunity' \ +--header 'Authorization: Bearer ' \ +--header 'Content-Type: application/json' \ +--data '{ + "AccountId": "", + "Name": "", + "StageName": "", + "CloseDate": "", + "Amount": "" +}' -- After clicking the final Submit button, your plugin will be published to the bot and triggerable based on your **Launch Rules.** -- You should wait up to **5 minutes** after making changes before trying to test in your bot! -- If you run into an issue: - 1. Check our [troubleshooting guides](https://developer.moveworks.com/creator-studio/troubleshooting/support/) - 2. Understand your issue using Logs - 3. Reach out to Support +``` -# **Congratulations!** +**Request Body Fields:** -You've just added the **"Create Opportunity for Account"** feature inside your Salesforce account to your Copilot! Explore our other guides for more inspiration on what to build next. +- `ACCOUNT_ID` (string) – The unique identifier of the Account to which the Opportunity will be associated. +- `NAME` (string) – The name of the opportunity. +- `CLOSE_DATE` (string) – The expected close date of the opportunity +- `STAGENAME` (string) – The current sales stage of the Opportunity. +- `AMOUNT` (string) – The estimated revenue amount for the Opportunity. \ No newline at end of file diff --git a/plugins/salesforce-create-opportunity-for-account/b332f15c-21d5-4a20-8915-86e9e5292688.png b/plugins/salesforce-create-opportunity-for-account/b332f15c-21d5-4a20-8915-86e9e5292688.png deleted file mode 100644 index fb215ce6..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/b332f15c-21d5-4a20-8915-86e9e5292688.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 1.png b/plugins/salesforce-create-opportunity-for-account/image 1.png deleted file mode 100644 index 8d06301b..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 1.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 10.png b/plugins/salesforce-create-opportunity-for-account/image 10.png deleted file mode 100644 index 7e034fc5..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 10.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 11.png b/plugins/salesforce-create-opportunity-for-account/image 11.png deleted file mode 100644 index cf9900cd..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 11.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 12.png b/plugins/salesforce-create-opportunity-for-account/image 12.png deleted file mode 100644 index 267009c0..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 12.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 2.png b/plugins/salesforce-create-opportunity-for-account/image 2.png deleted file mode 100644 index e4545242..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 2.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 3.png b/plugins/salesforce-create-opportunity-for-account/image 3.png deleted file mode 100644 index 0893c70a..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 3.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 4.png b/plugins/salesforce-create-opportunity-for-account/image 4.png deleted file mode 100644 index fb96c333..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 4.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 5.png b/plugins/salesforce-create-opportunity-for-account/image 5.png deleted file mode 100644 index 70378697..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 5.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 6.png b/plugins/salesforce-create-opportunity-for-account/image 6.png deleted file mode 100644 index d3929aee..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 6.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 7.png b/plugins/salesforce-create-opportunity-for-account/image 7.png deleted file mode 100644 index 317a9857..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 7.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 8.png b/plugins/salesforce-create-opportunity-for-account/image 8.png deleted file mode 100644 index 34e0f536..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 8.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image 9.png b/plugins/salesforce-create-opportunity-for-account/image 9.png deleted file mode 100644 index abbcd7db..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image 9.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/image.png b/plugins/salesforce-create-opportunity-for-account/image.png deleted file mode 100644 index b4e76036..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/image.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/m1.png b/plugins/salesforce-create-opportunity-for-account/m1.png deleted file mode 100644 index 1b28937a..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/m1.png and /dev/null differ diff --git a/plugins/salesforce-create-opportunity-for-account/m2.png b/plugins/salesforce-create-opportunity-for-account/m2.png deleted file mode 100644 index cca7262e..00000000 Binary files a/plugins/salesforce-create-opportunity-for-account/m2.png and /dev/null differ