You need to sign in to do that
Don't have an account?
SFDC L
Displaying direct link to a OpportunityLineItem Product
I am building a Custom object called Product_Interactions__C that logs changes made on Opportunity Products. This is done with a trigger that creates a record on Product_Interactions__c.
My trigger code:
The id displayed in the Product Name column IS the correct one I am just unable to figure out how to display this as a hyperlink on my Visualforce page with the product name as text. I would really appreciate any help on how best to approach this, or if there is an easier way that I am overlooking.
Thanks
L
My trigger code:
trigger ProductInteractionChange on OpportunityLineItem (after update) { for (OpportunityLineItem I : Trigger.new){ List<Product_Interactions__c> InteractionChangeAdmin = new List<Product_Interactions__c>(); Product_Interactions__c SaveChangeAdmin = new Product_Interactions__c(); SaveChangeAdmin.Opportunity__c = I.OpportunityId; SaveChangeAdmin.Product_Name_Link__c = I.Product_Link__c; SaveChangeAdmin.Interaction__c = I.Message__c; SaveChangeAdmin.Department__c = 'Admin'; InteractionChangeAdmin.add (SaveChangeAdmin); insert InteractionChangeAdmin; } }On OpportunityLineItem there is also a formula called Product_Link__c:
HYPERLINK("/"&Id,PricebookEntry.Product2.Name)As a better way to keep track of the records in this object I have also created a Visualforce Page, on this page I have been able to get a direct link to the Opportunity without problem but I am unable to display a hyperlink to the product that was edited. This is what my Visualforce Page looks at the moment:
The id displayed in the Product Name column IS the correct one I am just unable to figure out how to display this as a hyperlink on my Visualforce page with the product name as text. I would really appreciate any help on how best to approach this, or if there is an easier way that I am overlooking.
Thanks
L
Best Answer chosen by SFDC L
SFDC L
I seem to have gotten myself confused and overcomplicated it in my head, I just needed to use I.Id to get the direct id of the product, my apologies.