|Data provider||Write||Finbourne||Provided with LUSID|
Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and create portfolios in LUSID. This should automatically be the case if you are the domain owner.
You must construct a valid table of data to write, one portfolio per record.
Lusid.Portfolio.Writer lists the fields (columns) available to populate with values for each record, and has a set of parameters to help you construct a valid table.
Your query can use the
WriteAction field to perform one of the following operations:
- Upsert a portfolio; that is, create a portfolio if it does not exist, and update it if it does. This is the default operation if you omit
- Insert (create) a portfolio. This operation fails if the portfolio already exists.
- Update a portfolio. Note it is only possible to change the
Descriptionfields, or add or change properties. This operation fails if the portfolio does not already exist.
- Delete a portfolio.
See also: Lusid.Portfolio
Lusid.Portfolio.Writer has parameters that help you construct a valid table of data to write.
Note: The toWrite parameter is mandatory and used to actually write the table of data into LUSID.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
Lusid.Portfolio.Writer lists the fields you can populate in your table of data to write.
Depending on the operation you want to perform and the type of portfolio, the following fields are mandatory to include in the table of data:
|Operation||Mandatory fields in table of data to write for all portfolios||Mandatory fields for transaction portfolios||Mandatory fields for derived transaction portfolios||Mandatory fields for reference portfolios|
To list all available fields, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
We recommend examining the results of every write query using one or more of the WriteError, WriteErrorCode and WriteErrorDetail fields.
For each record in the table of data to write,
Lusid.Portfolio.Writer returns an error code. If the operation is successful, the error code is 0. If unsuccessful, a positive error code and explanation help you discover why LUSID considers the operation invalid.
For example, the query:
...fails because a
PortfolioType is not specified.
Note: For more example Luminesce SQL queries, visit our Github repo.
Example 1: Create a transaction portfolio
If you omit the
WriteAction field, an upsert operation is performed.
Example 2: Create a derived transaction portfolio with a sub-holding key
Example 3: Create a reference portfolio with particular instrument scopes
Example 4: Update the name, description and a property on a transaction portfolio
Note that to update properties for portfolios,
Lusid.Portfolio.Writer must have been configured to 'inline' the chosen properties (in this case
PortfolioManager) into the standard set of portfolio fields.