Opportunity
Opportunities represent negotiations with prospects. You must first enable opportunities in your NetSuite account before you can access this record type. To enable opportunities, go to Setup > Company > Enable Features. On the CRM tab, under Sales, check the Opportunities box.
The opportunity record is defined in the tranSales (sales) XSD.
Supported Operations
The following operations can be used with the opportunity record.
add | addList | attach / detach | delete | deleteList | get | getDeleted | getList | getSavedSearch | getSelectValue | search | update | updateList | upsert | upsertList
You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.
Field Definitions
The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s opportunity reference page.
For information about using the SOAP Schema Browser, see SOAP Schema Browser.
The balance field is only returned when using advanced search. It is not returned when using the <Record>SearchBasic search object. In advanced search, you must set the bodyFieldsOnly preference to false. The balance field is not returned if the bodyFieldsOnly preference is set to true. For more information, see bodyFieldsOnly.
Usage Notes
For details about working with opportunities in NetSuite, see Opportunity Records.
Associating Transactions with Opportunities
You can associate estimates, cash sales, sales orders, and invoices with opportunities. After a transaction other than an estimate is associated with an opportunity, the opportunity's status is automatically set to Closed Won. After an opportunity's status is set to Closed Won, it is no longer available to be selected on other cash sale, sales order, or invoice records.
Projected Total, Range High and Range Low Fields
When working with opportunity records in the UI, the range low, range high and projected total values must comply with the following rules:
-
The rangeLow value must be lower than or equal to the projectedTotal value. This value represents the Worst Case projected total.
-
The rangeHigh value must be greater than or equal to the projectedTotal value. This amount represents the Upside projected total.
In the UI, these values are calculated but can be overridden by the user. The calculated values are determined by relationships between the summation of amounts of entries in the itemList, projectedTotal values, and range low / range high values. When any of the values are overridden by the user, client side validation ensures that the fields are set correctly according to the above rules and automatically recalculates where appropriate.
To maintain proper rangeHigh, rangeLow and projectedTotal relationships when using SOAP web services, the behavior is as follows:
If Advanced Forecasting is Off
On Add
-
projectedTotal is required unless there is an item in the item list.
-
If projectedTotal is provided and there are items, then projectedTotal is calculated (with the sum of the item amounts).
-
If projectedTotal is provided then it is set unless it is equal to the sum of all items, where in that case it is calculated.
On update
-
If projectedTotal is not provided and there are no items in the update, then projectedTotal is not changed.
-
If projectedTotal is not provided and there are items in the update request, then projectedTotal is set to the sum of all items.
-
If projectedTotal is not provided and there are items in the original but no items in the update request, then projectedTotal is not changed except where projectedTotal is equal to the sum of all item amounts. In that case it is calculated.
-
If projectedTotal is provided and there are items in the original, then projectedTotal is set.
-
If projectedTotal is provided are there are items in the update request, then projectedTotal is set except where projectedTotal is equal to the sum of all items in the update request. In the case it is calculated.
If Advanced Forecasting is On
On Add
-
If no item list is sent in the request and projectedTotal is not provided an error will be thrown.
-
If no item list is sent and one or both of rangeLow or rangeHigh are missing then both are set to projectedTotal
-
If a value is NOT provided for projectedTotal, rangeLow or rangeHigh fields, then each field is calculated.
-
If a value is submitted for any one field then that field is NOT calculated except when a projectedTotal value is equal to the sum of the amounts for entries in the itemList at any point during item summation. In this case the projectedTotal value is calculated (set to the sum of all item amounts) even though a value was submitted.
On Update
-
If any of the three fields has the same value as previously set, whether calculated or not, all three fields are calculated.
-
If all three fields have different values they are not calculated except when a projectedTotal value is equal to the sum of the amounts for entries in the itemList at any point during item summation. In this case the projectedTotal value is calculated (set to the sum of all item amounts) even though a value was submitted.
-
If any of the three fields is empty, then all three fields are populated with calculated values except when there is no change to the itemList.
Working with Opportunity Sublists
The SOAP Schema Browser includes all sublists associated with the opportunity record. See the following information for usage notes regarding specific Opportunity sublists. Usage notes are not provided for every sublist type.
OpportunityItemList
In an opportunity, a list of items can be added, modified or deleted in the items sublist. However, each item listed in the item sublist is not a keyed entry — the list is an array of items. Therefore, to modify the contents of the items sublist for a particular opportunity record, follow these guidelines:
-
To update the list of items, resubmit the entire list (array) of items associated with the opportunity record.
-
To delete a subset of items on the list, submit a partial list of what was retrieved with the get operation.
-
To delete the entire list, submit an empty list.
If you are using a customForm that has location, department and class customized at the item level, you can NOT set these fields at the body level.
OpportunitySalesTeam
This list is only available when the Team Selling feature is enabled.