I am working on a trigger on a custom object that when a field IncludeWithOrder__c is marked as true a after update trigger is fired to add that product to the Quote as a QuoteLineItem, but I am currently getting saying that the Product2 field doesn't exist on the QuoteLineItem object, I have tried Product2Id and Product2 but neither seem to work, any help would be awesome. here is the trigger that I have currently:
trigger WearableTrigger on Wearable__c (after update) {
List<QuoteLineItem> item = new List<QuoteLineItem>();
for (Wearable__c wear: Trigger.New)
if (wear.IncludeWithOrder__c == TRUE){
item.add(new QuoteLineItem(
//ProductId = wear.Product__r.Id,
QuoteId = wear.Quote__r.Id,
UnitPrice = wear.Price__c,
Quantity = wear.Quantity__c));
}
insert item;
}