You need to sign in to do that
Don't have an account?

How to access values in map
Hello, I am working on after trigger using old map and new map.
SToring maps values in a list like this
SToring maps values in a list like this
List<Opportunity> oppNewMap = newMap.values();
List<Opportunity> oppOldMap = oldMap.values();
Now I'd of opp in case of both oldmap and newmap will be same.
But value are different.
In opp there is a lookup field . And opp has a child object product and same lookup field is also present in product obj.
Now when I update the lookup field in opp it should update the lookup field in related product. And it can have more than product.
I want to write a after trigger can anybody please help me with this.
Where I am main stuck writing soql queries on based on old values
List<Opportunity> oppOldMap = oldMap.values();
Now I'd of opp in case of both oldmap and newmap will be same.
But value are different.
In opp there is a lookup field . And opp has a child object product and same lookup field is also present in product obj.
Now when I update the lookup field in opp it should update the lookup field in related product. And it can have more than product.
I want to write a after trigger can anybody please help me with this.
Where I am main stuck writing soql queries on based on old values
Hi niki,
As Opportunity has not lookup of product so you mean to say that there is custom look field between product and opportunity.
or you are talking about OpportunityLineItem which has lookup of Opportunity and product??
Thank You!