• Benny Stevens 1
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Salesforce Administrator EMEA
  • Gates Corporation


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 13
    Replies
Hi,

I think I have this simple trigger on an Opportunity Product with a Status of Approved, to create a record in a custom object FPS, but when it meets the criteria, it creates 2 records.

Strange thing is that after that, when the Opportunity Product is updated again and it still meets the criteria, that it then creates only 1 record. Also when I have removed the first 2 records that have been created ... It is only the first time the trigger fires for that Opportunity Product, that it will create 2 records.

Thanks,
Benny

trigger CreateFPS on OpportunityLineItem (after update) {

    for (OpportunityLineItem u : Trigger.new) {
        if (u.Status__c == 'Approved') {
            FPS__c x = new FPS__c();
            x.Opportunity__c = u.OpportunityId;
            x.Sales_Price__c = u.UnitPrice;
            x.Phase__c = 'Nomination';
            
        insert x;
        
        }
    }
}
Hi,

An integration partners is trying to get the Isconverted & ConvertedContactId from the Lead record in the Sandbox. It works with the Developer Console, but not via SOAP. What is he doing wrong or are we missing something why we are not getting the information via SOAP? Thanks, Benny

Screenshot 1 - Developer Console

Developer Console

Screenshot 2 - SOAP

SOAP
Hi,

I have configured WFR Email Alerts on Opportunity Line Items (Opportunity Products) that sends email notifications when certain criteria are met.
The WFR works fine, but the criteria also includes conditions for the Opportunity, so, the WFR on Opportunity Product doesn't work when the parent Opportunity is being updated.

That's why I would like to add a trigger on the Opportunity that updates all related Opportunity Products (OLI's). It is only necessary for one specific record type (called "EU Opportunity") and it should not update any specific information on the OLI, I only want the "last modified date" to update and then WFR Email Alerts will work if the conditions are met.

1) Would this be a good solution for my situation?
2) I have tried to right a trigger and test class, but was not able to do it. Could someone please help me?

Please let me know if you'd require further information.

Many thanks in advance,
Benny
Hi,

I think I have this simple trigger on an Opportunity Product with a Status of Approved, to create a record in a custom object FPS, but when it meets the criteria, it creates 2 records.

Strange thing is that after that, when the Opportunity Product is updated again and it still meets the criteria, that it then creates only 1 record. Also when I have removed the first 2 records that have been created ... It is only the first time the trigger fires for that Opportunity Product, that it will create 2 records.

Thanks,
Benny

trigger CreateFPS on OpportunityLineItem (after update) {

    for (OpportunityLineItem u : Trigger.new) {
        if (u.Status__c == 'Approved') {
            FPS__c x = new FPS__c();
            x.Opportunity__c = u.OpportunityId;
            x.Sales_Price__c = u.UnitPrice;
            x.Phase__c = 'Nomination';
            
        insert x;
        
        }
    }
}
Hi,

An integration partners is trying to get the Isconverted & ConvertedContactId from the Lead record in the Sandbox. It works with the Developer Console, but not via SOAP. What is he doing wrong or are we missing something why we are not getting the information via SOAP? Thanks, Benny

Screenshot 1 - Developer Console

Developer Console

Screenshot 2 - SOAP

SOAP
Hi,

I have configured WFR Email Alerts on Opportunity Line Items (Opportunity Products) that sends email notifications when certain criteria are met.
The WFR works fine, but the criteria also includes conditions for the Opportunity, so, the WFR on Opportunity Product doesn't work when the parent Opportunity is being updated.

That's why I would like to add a trigger on the Opportunity that updates all related Opportunity Products (OLI's). It is only necessary for one specific record type (called "EU Opportunity") and it should not update any specific information on the OLI, I only want the "last modified date" to update and then WFR Email Alerts will work if the conditions are met.

1) Would this be a good solution for my situation?
2) I have tried to right a trigger and test class, but was not able to do it. Could someone please help me?

Please let me know if you'd require further information.

Many thanks in advance,
Benny