• Nerijus
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 14
    Replies
Hi all,

I have a visualforce page which is being innitiated from the button on the record page.
<apex:page standardController="Contact" extensions="MyApexClass" action="{!create}">
<apex:form >
<apex:inputHidden value="{!contact.id}"/>
</apex:form>
</apex:page>
I have an apex class which looks like this:
public class MyApexClass
{
    String contactId;
    
    public MyApexClass(ApexPages.StandardController controller)
    {
        this.contactId = controller.getId();
    }
    public PageReference create()
    {
        DO STUFF.....

        Pagereference pg = new Pagereference('/' + contact.Id);
        pg.setRedirect(true);
        return pg;
    }
When I'm being returned to contact page I want to show the message to the user like this one:
User-added image
 

Hi all,

I use the Salesforce for Gmail integration to log the emails in Salesforce.
When EmailMessage object is created I query an EmailMessageRelation object to find all the contacts that are related with this email.
On the UI I can see the contact is related as "Other Related People" and has a type of contact.
But when I query EmailMessageRelation it doesn't provide me RelationId nor RelationObjectType, all I get is Id, EmailMessageId, RelationAddress and RelationType. Non of them indicating who the contact is.

Any ideas why can't I get the contact id?

I have another old EmailMessage which has multiple contacts related with it, and EmailMessageRelation returns RelationId (contactId) and RelationObjectType (contact), but I can't seem to replicate that.

Thank you for your responses!

Nerijus
 

Hi all,

do anyone have any experience on Salesforce app exchange regarding intellectual property or copyright laws?

If I create a product which has similar functionality as Salesforce or other companies product on app exchange, can I get in legal trouble for that?

I don't mean to copy the product, but some products will have to have similar functionality as some other already developed tools on sale.

Is there any specific line that you can't cross in regards of this?

Just want to hear your opitions, and maybe you can share some resources?

Appreciate all of your thoughts!

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!

Hi all,

do anyone have any experience on Salesforce app exchange regarding intellectual property or copyright laws?

If I create a product which has similar functionality as Salesforce or other companies product on app exchange, can I get in legal trouble for that?

I don't mean to copy the product, but some products will have to have similar functionality as some other already developed tools on sale.

Is there any specific line that you can't cross in regards of this?

Just want to hear your opitions, and maybe you can share some resources?

Appreciate all of your thoughts!

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!