The product accessories object contains information held against product accessory records.
Accessories are a way of saying that a particular product is rented or sold with other products. The classic example that we use because it's easily understandable is a MacBook Pro that's sold with a mouse and some headphones.
In this example:
The MacBook Pro is the parent product.
The mouse and headphones are accessory products.
Accessories are products in Current RMS. They may be rented or sold on their own, depending on how they're set up.
When you set up a product as an accessory against another product, it creates a product accessory record. The product accessory object lets you access information about this record, such as when the product is included.
Terminology
Some of the terminology can be a little confusing at first, so it's worth creating or editing an accessory in the web interface to understand.
In the example above, we can see:
When you rent an Apple MacBook Pro, this [Apple Wireless Mouse] will be rented as a default accessory.
Thinking in terms of objects, we can break this down like this:
When you (parent transaction type) the (parent product), the (product) will be (item transaction type) as a (inclusion type) (mode).
Object
Example
Parent transaction type
rent
Parent product
Apple MacBook Pro
Accessory product
Apple Wireless Mouse
Item transaction type
rented
Inclusion type
default
Mode
accessory
Objects that return product accessories
product_accessories is an object of the product object, so you may access it anywhere you may access the product object.
It's generally only useful for documents and discussion templates created against the product module.
For example, while you may access product accessories on an opportunity document using opportunity items, there's little reason to do this. Consider:
This will return items in a list, with product accessories as a sub-list. However, it will return product accessories as they are against a product in Resources > Products. It won't return an opportunity item's accessories, which may be different. It also won't tell you anything about the quantities or prices of those opportunity item accessories.
In this case, you'd be better using the is_accessory? object against opportunity items to determine whether or not they're accessories. You may also access an opportunity item's mode, inclusion type, and other information.