Probably dumb question, but I'm in cognitive dissonance. I want to create ContractLineItem from Account's Assets. I go to setup=>Contract line items and check fields. There's a lookup on Product2.
I've tried to assign ContractLineItem.Product2 but on compile it says that "Incorrect Product2 field for sObject...". I went to workbench and, to my surprise, didn't find the product2Field here.
I've tried to create a ContractLineItem record without Product2 reference and it requires PriceBookEntry from me. First question is - how is it possible that I have a product2 field in setup, but I don't see it in workbench? Second - how to get correct priceBookEntry? The only way I see is to parse priceBookEntries for the Product and then compare prices from priceBookEntry with AssetPrice. If equals - assign this priceBookEntry to ContractLineItem.
Thank you in advance!