2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-02-10 12:55:28 -08:00
2021-12-03 00:44:16 -08:00
export const opportunityOperations : INodeProperties [ ] = [
2020-02-10 12:55:28 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-02-10 12:55:28 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
options : [
2020-02-12 22:35:56 -08:00
{
name : 'Add Note' ,
value : 'addNote' ,
description : 'Add note to an opportunity' ,
2022-07-10 13:50:51 -07:00
action : 'Add a note to an opportunity' ,
2020-02-12 22:35:56 -08:00
} ,
2020-02-10 12:55:28 -08:00
{
name : 'Create' ,
value : 'create' ,
description : 'Create an opportunity' ,
2022-07-10 13:50:51 -07:00
action : 'Create an opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
2021-06-09 20:25:20 -07:00
{
name : 'Create or Update' ,
value : 'upsert' ,
2022-08-17 08:50:24 -07:00
description :
'Create a new opportunity, or update the current one if it already exists (upsert)' ,
2022-07-10 13:50:51 -07:00
action : 'Create or update an opportunity' ,
2021-06-09 20:25:20 -07:00
} ,
2020-02-10 12:55:28 -08:00
{
2020-02-12 22:35:56 -08:00
name : 'Delete' ,
value : 'delete' ,
description : 'Delete an opportunity' ,
2022-07-10 13:50:51 -07:00
action : 'Delete an opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get an opportunity' ,
2022-07-10 13:50:51 -07:00
action : 'Get an opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-02-10 12:55:28 -08:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many opportunities' ,
2022-09-08 08:10:13 -07:00
action : 'Get many opportunities' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
name : 'Get Summary' ,
value : 'getSummary' ,
2022-08-17 08:50:24 -07:00
description : "Returns an overview of opportunity's metadata" ,
2022-07-10 13:50:51 -07:00
action : 'Get an opportunity summary' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
name : 'Update' ,
value : 'update' ,
description : 'Update an opportunity' ,
2022-07-10 13:50:51 -07:00
action : 'Update an opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-02-10 12:55:28 -08:00
2021-12-03 00:44:16 -08:00
export const opportunityFields : INodeProperties [ ] = [
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:create */
/* -------------------------------------------------------------------------- */
2021-06-09 20:25:20 -07:00
{
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
2021-06-09 20:25:20 -07:00
displayName : 'Match Against' ,
name : 'externalId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getExternalIdFields' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'resource' ] ,
2021-06-09 20:25:20 -07:00
} ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'upsert' ] ,
2021-06-09 20:25:20 -07:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The field to check to see if the opportunity already exists. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-06-09 20:25:20 -07:00
} ,
{
displayName : 'Value to Match' ,
name : 'externalIdValue' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'upsert' ] ,
2021-06-09 20:25:20 -07:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
"If this value exists in the 'match against' field, update the opportunity. Otherwise create a new one." ,
2021-06-09 20:25:20 -07:00
} ,
2020-02-10 12:55:28 -08:00
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'create' , 'upsert' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
description : 'Required. Last name of the opportunity. Limited to 80 characters.' ,
} ,
{
displayName : 'Close Date' ,
name : 'closeDate' ,
type : 'dateTime' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'create' , 'upsert' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
description : 'Required. Date when the opportunity is expected to close.' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Stage Name or ID' ,
2020-02-10 12:55:28 -08:00
name : 'stageName' ,
type : 'options' ,
typeOptions : {
2020-10-22 06:46:03 -07:00
loadOptionsMethod : 'getStages' ,
2020-02-10 12:55:28 -08:00
} ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'create' , 'upsert' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Required. Date when the opportunity is expected to close. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'create' , 'upsert' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Account Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'accountId' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
default : '' ,
2020-02-12 22:35:56 -08:00
typeOptions : {
loadOptionsMethod : 'getAccounts' ,
} ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the account associated with this opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Amount' ,
name : 'amount' ,
type : 'number' ,
typeOptions : {
numberPrecision : 2 ,
} ,
default : '' ,
description : 'Estimated total sale amount' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'campaignId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getCampaigns' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the campaign that needs to be fetched. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-12 22:35:56 -08:00
} ,
2020-10-16 01:27:09 -07:00
{
displayName : 'Custom Fields' ,
name : 'customFieldsUi' ,
placeholder : 'Add Custom Field' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Filter by custom fields' ,
2020-10-16 01:27:09 -07:00
default : { } ,
options : [
{
name : 'customFieldsValues' ,
displayName : 'Custom Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2020-10-16 01:27:09 -07:00
name : 'fieldId' ,
type : 'options' ,
typeOptions : {
2021-04-17 01:11:18 -07:00
loadOptionsMethod : 'getCustomFields' ,
2020-10-16 01:27:09 -07:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the field to add custom field to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-10-16 01:27:09 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The value to set on custom field' ,
2020-10-16 01:27:09 -07:00
} ,
] ,
} ,
] ,
} ,
2020-02-12 22:35:56 -08:00
{
displayName : 'Description' ,
name : 'description' ,
2020-02-10 12:55:28 -08:00
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'A description of the opportunity. Label is Contact Description. Limit: 32 KB.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Forecast Category Name' ,
name : 'forecastCategoryName' ,
type : 'string' ,
default : '' ,
description : 'It is implied, but not directly controlled, by the StageName field' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lead Source Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'leadSource' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
typeOptions : {
2020-02-12 22:35:56 -08:00
loadOptionsMethod : 'getLeadSources' ,
2020-02-10 12:55:28 -08:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Source from which the lead was obtained. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Next Step' ,
name : 'nextStep' ,
type : 'string' ,
default : '' ,
description : 'Description of next task in closing opportunity. Limit: 255 characters.' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'owner' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
typeOptions : {
2020-02-12 22:35:56 -08:00
loadOptionsMethod : 'getUsers' ,
2020-02-10 12:55:28 -08:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The owner of the opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Phone' ,
name : 'phone' ,
type : 'string' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Phone number for the opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
{
2021-01-13 01:45:41 -08:00
displayName : 'Pricebook2 ID' ,
2020-02-12 22:35:56 -08:00
name : 'pricebook2Id' ,
2020-02-10 12:55:28 -08:00
type : 'string' ,
default : '' ,
2020-02-12 22:35:56 -08:00
description : 'ID of a related Pricebook2 object' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Probability' ,
name : 'probability' ,
type : 'number' ,
typeOptions : {
numberPrecision : 1 ,
} ,
default : '' ,
description : 'Percentage of estimated confidence in closing the opportunity' ,
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2020-02-12 22:35:56 -08:00
options : [
{
name : 'Business' ,
2021-11-30 06:30:39 -08:00
value : 'Business' ,
2020-02-12 22:35:56 -08:00
} ,
{
name : 'New Business' ,
2021-11-30 06:30:39 -08:00
value : 'New Business' ,
2020-02-12 22:35:56 -08:00
} ,
] ,
2022-08-17 08:50:24 -07:00
description :
'Type of opportunity. For example, Existing Business or New Business. Label is Opportunity Type.' ,
2020-02-10 12:55:28 -08:00
} ,
] ,
} ,
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:update */
/* -------------------------------------------------------------------------- */
2020-02-10 12:55:28 -08:00
{
displayName : 'Opportunity ID' ,
name : 'opportunityId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'update' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of opportunity that needs to be fetched' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'update' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Account Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'accountId' ,
type : 'options' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2020-02-12 22:35:56 -08:00
typeOptions : {
loadOptionsMethod : 'getAccounts' ,
} ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the account associated with this opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Amount' ,
name : 'amount' ,
type : 'number' ,
typeOptions : {
numberPrecision : 2 ,
} ,
2020-02-10 12:55:28 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Estimated total sale amount' ,
2020-02-10 12:55:28 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Campaign Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'campaignId' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
typeOptions : {
2020-02-12 22:35:56 -08:00
loadOptionsMethod : 'getCampaigns' ,
2020-02-10 12:55:28 -08:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the campaign that needs to be fetched. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Close Date' ,
name : 'closeDate' ,
type : 'dateTime' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2020-02-12 22:35:56 -08:00
description : 'Required. Date when the opportunity is expected to close.' ,
2020-02-10 12:55:28 -08:00
} ,
2020-10-16 01:27:09 -07:00
{
displayName : 'Custom Fields' ,
name : 'customFieldsUi' ,
placeholder : 'Add Custom Field' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Filter by custom fields' ,
2020-10-16 01:27:09 -07:00
default : { } ,
options : [
{
name : 'customFieldsValues' ,
displayName : 'Custom Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2020-10-16 01:27:09 -07:00
name : 'fieldId' ,
type : 'options' ,
typeOptions : {
2021-04-17 01:11:18 -07:00
loadOptionsMethod : 'getCustomFields' ,
2020-10-16 01:27:09 -07:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the field to add custom field to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-10-16 01:27:09 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The value to set on custom field' ,
2020-10-16 01:27:09 -07:00
} ,
] ,
} ,
] ,
} ,
2020-02-10 12:55:28 -08:00
{
2020-02-12 22:35:56 -08:00
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'A description of the opportunity. Label is Contact Description. Limit: 32 KB.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Forecast Category Name' ,
name : 'forecastCategoryName' ,
2020-02-10 12:55:28 -08:00
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'It is implied, but not directly controlled, by the StageName field' ,
2020-02-10 12:55:28 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Lead Source Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'leadSource' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
typeOptions : {
2020-02-12 22:35:56 -08:00
loadOptionsMethod : 'getLeadSources' ,
2020-02-10 12:55:28 -08:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Source from which the lead was obtained. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Name' ,
name : 'name' ,
2020-02-10 12:55:28 -08:00
type : 'string' ,
default : '' ,
2020-02-12 22:35:56 -08:00
description : 'Required. Last name of the opportunity. Limited to 80 characters.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Next Step' ,
name : 'nextStep' ,
type : 'string' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2020-02-12 22:35:56 -08:00
description : 'Description of next task in closing opportunity. Limit: 255 characters.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'owner' ,
2020-02-10 12:55:28 -08:00
type : 'options' ,
typeOptions : {
2020-02-12 22:35:56 -08:00
loadOptionsMethod : 'getUsers' ,
2020-02-10 12:55:28 -08:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The owner of the opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Phone' ,
name : 'phone' ,
type : 'string' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Phone number for the opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
{
2021-01-13 01:45:41 -08:00
displayName : 'Pricebook2 ID' ,
2020-02-12 22:35:56 -08:00
name : 'pricebook2Id' ,
2020-02-10 12:55:28 -08:00
type : 'string' ,
default : '' ,
2020-02-12 22:35:56 -08:00
description : 'ID of a related Pricebook2 object' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Probability' ,
name : 'probability' ,
type : 'number' ,
typeOptions : {
numberPrecision : 1 ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Percentage of estimated confidence in closing the opportunity' ,
2020-02-10 12:55:28 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Stage Name or ID' ,
2020-02-12 22:35:56 -08:00
name : 'stageName' ,
type : 'options' ,
typeOptions : {
2020-10-22 06:46:03 -07:00
loadOptionsMethod : 'getStages' ,
2020-02-12 22:35:56 -08:00
} ,
2020-02-10 12:55:28 -08:00
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'Required. Date when the opportunity is expected to close. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
{
2020-02-12 22:35:56 -08:00
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
2020-02-10 12:55:28 -08:00
default : '' ,
2020-02-12 22:35:56 -08:00
options : [
{
name : 'Business' ,
2021-11-30 15:19:54 -08:00
value : 'Business' ,
2020-02-12 22:35:56 -08:00
} ,
{
name : 'New Business' ,
2021-11-30 15:19:54 -08:00
value : 'New Business' ,
2020-02-12 22:35:56 -08:00
} ,
] ,
2022-08-17 08:50:24 -07:00
description :
'Type of opportunity. For example, Existing Business or New Business. Label is Opportunity Type.' ,
2020-02-10 12:55:28 -08:00
} ,
] ,
} ,
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:get */
/* -------------------------------------------------------------------------- */
2020-02-10 12:55:28 -08:00
{
displayName : 'Opportunity ID' ,
name : 'opportunityId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'get' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of opportunity that needs to be fetched' ,
2020-02-10 12:55:28 -08:00
} ,
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:delete */
/* -------------------------------------------------------------------------- */
2020-02-10 12:55:28 -08:00
{
displayName : 'Opportunity ID' ,
name : 'opportunityId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'delete' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of opportunity that needs to be fetched' ,
2020-02-10 12:55:28 -08:00
} ,
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:getAll */
/* -------------------------------------------------------------------------- */
2020-02-10 12:55:28 -08:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'getAll' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'getAll' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
options : [
2021-01-13 01:45:41 -08:00
{
displayName : 'Conditions' ,
name : 'conditionsUi' ,
placeholder : 'Add Condition' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The condition to set' ,
2021-01-13 01:45:41 -08:00
default : { } ,
options : [
{
name : 'conditionValues' ,
displayName : 'Condition' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2021-01-13 01:45:41 -08:00
name : 'field' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getOpportunityFields' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'For date, number, or boolean, please use expressions. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2021-01-13 01:45:41 -08:00
} ,
2022-05-20 14:47:24 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-operation-without-no-data-expression
2021-01-13 01:45:41 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
options : [
2022-06-03 10:23:49 -07:00
{
name : '<' ,
value : '<' ,
} ,
{
name : '<=' ,
value : '<=' ,
} ,
2021-01-13 01:45:41 -08:00
{
name : '=' ,
value : 'equal' ,
} ,
{
name : '>' ,
value : '>' ,
} ,
{
name : '>=' ,
value : '>=' ,
} ,
] ,
default : 'equal' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
2020-02-10 12:55:28 -08:00
{
displayName : 'Fields' ,
name : 'fields' ,
type : 'string' ,
default : '' ,
description : 'Fields to include separated by ,' ,
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-10 12:55:28 -08:00
} ,
2021-01-13 01:45:41 -08:00
/* -------------------------------------------------------------------------- */
/* opportunity:addNote */
/* -------------------------------------------------------------------------- */
2020-02-10 12:55:28 -08:00
{
displayName : 'Opportunity ID' ,
name : 'opportunityId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'addNote' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'ID of opportunity that needs to be fetched' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'addNote' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Title of the note' ,
2020-02-10 12:55:28 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'opportunity' ] ,
operation : [ 'addNote' ] ,
2020-02-10 12:55:28 -08:00
} ,
} ,
options : [
{
displayName : 'Body' ,
name : 'body' ,
type : 'string' ,
default : '' ,
description : 'Body of the note. Limited to 32 KB.' ,
} ,
2020-02-12 22:35:56 -08:00
{
displayName : 'Is Private' ,
name : 'isPrivate' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description :
'Whether true, only the note owner or a user with the “Modify All Data” permission can view the note or query it via the API' ,
2020-02-12 22:35:56 -08:00
} ,
2020-02-10 12:55:28 -08:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2020-02-10 12:55:28 -08:00
name : 'owner' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'ID of the user who owns the note. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-02-10 12:55:28 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-10 12:55:28 -08:00
} ,
2021-12-03 00:44:16 -08:00
] ;