• rinsler
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

I've tried using the standard workflows for this problem, but for some reason it doesnt work.

 

So I just make the basic workflow criteria(on Opportunity Products object) like: "Opportunity Product: Quantity not equal to null"  , and add field update action to update field "Status" on Opportunity Products. And then I set the formula for field value as following: "TEXT(Product2.Status__c)", because I want to take the value from field "Status" in Product and transfer its value to field "Status" on Opportunity Products. That doesnt work for some reason, i cant find out why. Any help on that?

 

  • September 15, 2013
  • Like
  • 0

I've created a trigger to copy field value "Status" (which is picklist) from "Opportunity Products" to "Opportunities". Here is what i came up to:

 

trigger UpdateStatus on OpportunityLineItem (after insert, after update) {

    List<Opportunity> oppp = new List<Opportunity>();

    for (OpportunityLineItem oppLnItem : trigger.new)
    {  
        
        
                
        oppp.add (new Opportunity (Id=oppLnItem.Opportunity_Id__c, Status__c=oppLnItem.Status__c));

        update oppp;
         
        
    } 
    }

 

Not sure if it works, but what I DO know is that i have absolutely no idea how to create a test class for this trigger :(((. Can you help? All the things I've googled about test classes seem so complicated, and i just cant find my way around.

  • September 14, 2013
  • Like
  • 0

I've created a trigger to copy field value "Status" (which is picklist) from "Opportunity Products" to "Opportunities". Here is what i came up to:

 

trigger UpdateStatus on OpportunityLineItem (after insert, after update) {

    List<Opportunity> oppp = new List<Opportunity>();

    for (OpportunityLineItem oppLnItem : trigger.new)
    {  
        
        
                
        oppp.add (new Opportunity (Id=oppLnItem.Opportunity_Id__c, Status__c=oppLnItem.Status__c));

        update oppp;
         
        
    } 
    }

 

Not sure if it works, but what I DO know is that i have absolutely no idea how to create a test class for this trigger :(((. Can you help? All the things I've googled about test classes seem so complicated, and i just cant find my way around.

  • September 14, 2013
  • Like
  • 0