• Nerijus
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
Hi everyone,

I have this weird behaviour which I can't figure out.
There is a trigger on SBQQ__QuoteLine__c (Salesforce CPQ) object which fires twice. I'm trying to print some logs as I was not able to access values I wanted and I notices that trigger printing these values:
User-added imageLine 14, 15 is before and 33, 34 is after update. On the first iteration new and old values are the same and on the second I get values I actually supposed to access.
There's only one other trigger on this object and it is from Salesforce CPQ package itself so I can't see what's going on there.
I'm getting this error, but when I try to open a record it's not there.
Hi there,

I have a trigger on OpportunityLineItem and I need to compare formula field old and new values. That formula field gets value from another related object which is CPQ Quote Line and I need that trigger to fire on OpportunityLineItem when value changes on Quote Line.
When value changes on Quote Line and fires the trigger on OpportunityLineItem I get the same new value on Trigger.new and Trigger.old list
Anyone knows how to get old variable?
 
trigger OpportunityLineItemTrigger on OpportunityLineItem (after insert, before update, after update)
{
    
    if (Trigger.isBefore && Trigger.isUpdate)
    {
        System.debug('BEFORE');
        for (OpportunityLineItem oli : Trigger.new)
        {
            System.debug(oli.Quantity_Formula__c);
        }
        for (OpportunityLineItem oli : Trigger.old)
        {
            System.debug(oli.Quantity_Formula__c);
        }
    }
    
    if (Trigger.isAfter && Trigger.isUpdate)
    {
        System.debug('AFTER');
        for (OpportunityLineItem oli : Trigger.new)
        {
            System.debug(oli.Quantity_Formula__c);
        }
        for (OpportunityLineItem oli : Trigger.old)
        {
            System.debug(oli.Quantity_Formula__c);
        }
    }
}

 
HI there,

I'm trying to query opportunity owner email address but getting back owner id.
Opportunity oppo = [SELECT Owner.Email FROM Opportunity WHERE Id = '0060C000002q4e2QAA'];
How do I get actual email address?
I'm trying to call Google AdManager from Salesforce over SOAP and when I do a callout to one of the methods I get this "System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element id".
Was trying to "google" the error but I can't seem to find a solution for this, maybe someone can help me out here?

Calling this getCurrentUser() method:
public class UserServiceInterfacePort {
        public String endpoint_x = 'callout:AdManager/v201911/UserService';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public UserService.SoapRequestHeader RequestHeader;
        public UserService.SoapResponseHeader ResponseHeader;
        private String RequestHeader_hns = 'RequestHeader=https://www.google.com/apis/ads/publisher/v201911';
        private String ResponseHeader_hns = 'ResponseHeader=https://www.google.com/apis/ads/publisher/v201911';
        private String[] ns_map_type_info = new String[]{'https://www.google.com/apis/ads/publisher/v201911', 'UserService'};
        public UserService.User_x getCurrentUser() {
            UserService.getCurrentUser_element request_x = new UserService.getCurrentUser_element();
            UserService.getCurrentUserResponse_element response_x;
            Map<String, UserService.getCurrentUserResponse_element> response_map_x = new Map<String, UserService.getCurrentUserResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'https://www.google.com/apis/ads/publisher/v201911',
              'getCurrentUser',
              'https://www.google.com/apis/ads/publisher/v201911',
              'getCurrentUserResponse',
              'UserService.getCurrentUserResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.rval;
        }
Expecting back this class:
public class User_x {
        public Boolean isActive;
        public Boolean isEmailNotificationAllowed;
        public String externalId;
        public Boolean isServiceAccount;
        public String ordersUiLocalTimeZoneId;
        private String[] isActive_type_info = new String[]{'isActive','https://www.google.com/apis/ads/publisher/v201911',null,'0','1','false'};
        private String[] isEmailNotificationAllowed_type_info = new String[]{'isEmailNotificationAllowed','https://www.google.com/apis/ads/publisher/v201911',null,'0','1','false'};
        private String[] externalId_type_info = new String[]{'externalId','https://www.google.com/apis/ads/publisher/v201911',null,'0','1','false'};
        private String[] isServiceAccount_type_info = new String[]{'isServiceAccount','https://www.google.com/apis/ads/publisher/v201911',null,'0','1','false'};
        private String[] ordersUiLocalTimeZoneId_type_info = new String[]{'ordersUiLocalTimeZoneId','https://www.google.com/apis/ads/publisher/v201911',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://www.google.com/apis/ads/publisher/v201911','true','false'};
        private String[] field_order_type_info = new String[]{'isActive','isEmailNotificationAllowed','externalId','isServiceAccount','ordersUiLocalTimeZoneId'};
    }
Response I'm getting from debug log:
CALLOUT_RESPONSE|[458]|<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://www.google.com/apis/ads/publisher/v201911"><requestId>e0f13da33a0db674b118a930cf0kij54</requestId><responseTime>685</responseTime></ResponseHeader></soap:Header><soap:Body><getCurrentUserResponse xmlns="https://www.google.com/apis/ads/publisher/v201911"><rval><id>245547652</id><name>Nerijus Urbietis</name><email>nerijus.urbietis@:).ie</email><roleId>-1</roleId><roleName>Administrator</roleName><isActive>true</isActive><isEmailNotificationAllowed>false</isEmailNotificationAllowed><isServiceAccount>false</isServiceAccount></rval></getCurrentUserResponse></soap:Body></soap:Envelope>


 
Hey everyone,

I'm trying to create a trigger which will execute after custom button from maanged package is clicked. I want to do a callout, check some data and based on response prevent or continue exetution of that button.
Can someone point me to the right direction please? Any article or maybe anyone did something similar?

Much appreciated!
I'm getting this error, but when I try to open a record it's not there.
Hi there,

I have a trigger on OpportunityLineItem and I need to compare formula field old and new values. That formula field gets value from another related object which is CPQ Quote Line and I need that trigger to fire on OpportunityLineItem when value changes on Quote Line.
When value changes on Quote Line and fires the trigger on OpportunityLineItem I get the same new value on Trigger.new and Trigger.old list
Anyone knows how to get old variable?
 
trigger OpportunityLineItemTrigger on OpportunityLineItem (after insert, before update, after update)
{
    
    if (Trigger.isBefore && Trigger.isUpdate)
    {
        System.debug('BEFORE');
        for (OpportunityLineItem oli : Trigger.new)
        {
            System.debug(oli.Quantity_Formula__c);
        }
        for (OpportunityLineItem oli : Trigger.old)
        {
            System.debug(oli.Quantity_Formula__c);
        }
    }
    
    if (Trigger.isAfter && Trigger.isUpdate)
    {
        System.debug('AFTER');
        for (OpportunityLineItem oli : Trigger.new)
        {
            System.debug(oli.Quantity_Formula__c);
        }
        for (OpportunityLineItem oli : Trigger.old)
        {
            System.debug(oli.Quantity_Formula__c);
        }
    }
}

 
HI there,

I'm trying to query opportunity owner email address but getting back owner id.
Opportunity oppo = [SELECT Owner.Email FROM Opportunity WHERE Id = '0060C000002q4e2QAA'];
How do I get actual email address?
Hey everyone,

I'm trying to create a trigger which will execute after custom button from maanged package is clicked. I want to do a callout, check some data and based on response prevent or continue exetution of that button.
Can someone point me to the right direction please? Any article or maybe anyone did something similar?

Much appreciated!