• Ramon Pereira
  • NEWBIE
  • 120 Points
  • Member since 2012
  • TCS TATA Brazil

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 20
    Questions
  • 42
    Replies
Anyone have a good way to query the UserServicePresence object? This object creates multiple records per agent per day. I only need to query the most recent record. 
Hi All,

I have to create a report with one 'field' that chaged to 'one text value'  in the past 7 days and same 'field' with different " text value" no specific time.
Report need to be generated on weekly basis.
Hi all,

Our client wants to buy a Live Agent Service Cloud Application, and he wants intagrate it in a mobile application. But he was not satisfied with the REST API. He wants to use the WebSocket protocol to connect client application with the technical support service. So the question is: Does anyone know anything Salesforce supports this type of communication or not? It is also one of the issues was the use of Push-notifications (GCM / APNS), so second quaestion is: does it possible to send Push notifactiobs to mobile app from Live Agent?

Best regards,
Vitalii Bezbozhnyi
Hi Friends,

I have 3 object A,B and C. A is the Parent of B and B is the parent of C object. I have one multiselectfield field on object A, Nopw whenever a C object record is created I want to copy multiselect field from Object A to C object Field, Is there anyway we can do it ?

Please suggest some idea.

Regards,
RahulHi Friends,

I have 3 object A,B and C. A is the Parent of B and B is the parent of C object. I have one multiselectfield field on object A, Nopw whenever a C object record is created I want to copy multiselect field from Object A to C object Field, Is there anyway we can do it ?

Please suggest some idea.

Regards,
Rahul
Hello Experts,

On opportunities page, there is no option in the page layout for the quote line item related lists to be sorted by a specific column. I would like to sort this related list on any column that I choose. Will I have to develop a custom Sort button for this? And if I do that, can I see the sort results right in the related list on the same opportunities page? Or it needs to be a different VF page?

Please advise
Hi All,

We are facing one wierd issue.
When the master record is locked by an approval process, it's detail records are also getting locked.
Below is the screenshot of button area of child record. As you can see lock icon appeared just before edit button.  
Child record don't even have any active approval process.
Lock

When the user tries to edit it, he is getting the below error.
"The record you are trying to edit has been locked. Please contact your administrator if access is necessary. "

Here comes the wierd part, 
Two objects are using the same object as master, but only records of one object are getting locked when master record is locke
d.

I found the below link. But even as per it, when master record is locked, child records of all the objects which are having the same master should be locked ? Isn't it ?
https://help.salesforce.com/apex/HTViewSolution?id=000005483&language=en_US

May be I am missing something. Any idea what the issue is ?
I want to use the salesforce bulk api using php.So I cant find the partnerApiEndPoint and sessionID to use that api. Please tell me how can I find those values.
Hi, 
We updated SandBox according with production instance, but after that our API integration
with SANDBOX, stop to work.

- We tried so hard looking forums, and websites to help me with this problem but I did not find a solution.

- We imported the WSDL on SOAPui and everything work fine, but when we try to connect via API, we receive that message:

Error Type Detail: SOAP-FAULT-DETAIL
Serialized SOAP fault detail: <detailxmlns:sf="urn:fault.enterprise.soap.sforce.com"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <sf:UnexpectedErrorFault
xsi:type="sf:UnexpectedErrorFault">
        <sf:exceptionCode>INVALID_SESSION_ID</sf:exceptionCode>
        <sf:exceptionMessage>Invalid Session ID found in SessionHeader:
Illegal Session</sf:exceptionMessage>
    </sf:UnexpectedErrorFault>
</detail>upSert
Hi,

There are two Custom Objects, Object1 (Parent), Object2 (Child). Both are in MD relationship.

Object1 (Parent) has a picklist field "Statuc__c" with values InProgress & Completed.
Object2 (Child) has a field of CheckBox datatype "Completed__c".

Now. When the value of checkbox Completed__c is true in all the records of an associated parent record. then only the filed Status__c in Object1 should change to the value Completed.

How can I achieve this?

Your suggestion will be appreciated.
Hello Guys,
                   I need a search list button on vf page.  when we type for any keyword to search it should display all the items related to that word. How to achieve this?
i have list ..after inserting that list i want get that all id's of that list records..is it possible ..please give some suggesstions...

thanks in advance

Regard's

Vamsi Krishna..

Hello,

i am using below code for login into salesforce from php and perform insert,update, delete using that connection object. 

$mySforceConnection = new SforcePartnerClient();
$mySforceConnection->createConnection(SALESDIRECTORY . "partner.wsdl.xml");
$mySforceConnection->login(USERNAME, PASSWORD . SECURITY_TOKEN);


now if the USERNAME changes password in salesforce than above code will not login user using old PASSWORD.

how to overcome this issue ? 

is there any other method for login and getting connection object? 

 

Hello everyone, I am new to salesforce and barely know half of it's cool features!

I am having this strange problem with my company's sandbox org.

I ran through the basic REST-API example code in JAVA, simple OAuth and everything, just to see if I am able to connect to the sandbox using the REST API.

It appears to be that the login failed and showed me the error code 400. 

However, on my personal org, that I can set up after signgin up with an developer-account, the same code appears to work JUST fine. I get no error messages at all, I can even run some basic queries on that.

NOTE: I have configured the JAVA-Code for the REST-API example to the sandbox environment, it's basically like this:
* Login credentials have been replaced with ' * '.
 
public class sbRest {

    private static final String USERNAME     = "*****************";
    private static final String PASSWORD     = "*****************";
    private static final String LOGINURL     = "https://test.salesforce.com";
    private static final String GRANTSERVICE = "/services/oauth2/token?grant_type=password";
    private static final String CLIENTID     = "********************";
    private static final String CLIENTSECRET = "*******************";
    
    
    public static void main(String[]args) throws UnsupportedEncodingException {

        HttpClient httpclient = HttpClientBuilder.create().build();
 
        // Assemble the login request URL
        String loginURL = LOGINURL +
                          GRANTSERVICE +
                          "&client_id=" + CLIENTID +
                          "&client_secret=" + CLIENTSECRET +
                          "&username=" + USERNAME +
                          "&password=" + PASSWORD;
 
        // Login requests must be POSTs
        HttpPost httpPost = new HttpPost(loginURL);
        HttpResponse response = null;
 
        try {
            // Execute the login POST request
            response = httpclient.execute(httpPost);
        } catch (ClientProtocolException cpException) {
            cpException.printStackTrace();
        } catch (IOException ioException) {
            ioException.printStackTrace();
        }
 
        // verify response is HTTP OK
        final int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode != HttpStatus.SC_OK) {
            System.out.println("Error authenticating to Force.com: "+statusCode);
            // Error is in EntityUtils.toString(response.getEntity())
            return;
        }
 
        String getResult = null;
        try {
            getResult = EntityUtils.toString(response.getEntity());
        } catch (IOException ioException) {
            ioException.printStackTrace();
        }
        JSONObject jsonObject = null;
        String loginAccessToken = null;
        String loginInstanceUrl = null;
        try {
            jsonObject = (JSONObject) new JSONTokener(getResult).nextValue();
            loginAccessToken = jsonObject.getString("access_token");
            loginInstanceUrl = jsonObject.getString("instance_url");
        } catch (JSONException jsonException) {
            jsonException.printStackTrace();
        }
        System.out.println(response.getStatusLine());
        System.out.println("Successful login");
        System.out.println("  instance URL: "+loginInstanceUrl);
        System.out.println("  access token/session ID: "+loginAccessToken);
 
        // release connection
        httpPost.releaseConnection();    
    } 
}



Is there any additional configuration I need to make, or any changes on the "network access" on the sandbox platform? I really don't know what could be causing this issue, as for my own personal org, it works just fine, using the exact same code.

I would appreciate any help!

Thank you.
Hi All,
currently i am in a evaluation process of connecting Voice/ACD with the new SFDC Omni-Channel feature. 

The ACD provider will be integrated using OpenCTI. Indeed OpenCTI exists in the CallCenter console component of the ServiceConsole. Usually the ACD provider takes care of the call routing and the only interaction with SFDC is done in context of the OpentCTI HTML/JavaScript code (inbound and outbound calls, call logging etc.). This HTML/JavaScript code is always running in context of the browser of a particular agent. The session between the agent and the ACD server is handled by the CallCenter console component (pure Cloud solution) or some kind of local desktop app as a middleware between the CallCenter console component and the ACD server.

I have an ongoing discussion with SFDC about there recommendation to integrate OpenCTI with Omni-Channel to make sure the Omni-Mechanism will manage the Agent-Blending completely on SFDC side.

SFDC suggest to let the ACD system create a Case … which will be handled by a Omni-Service channel. A Omni routing configuration assigned to a queue will route that case to an agent. As soon as an agent picks that case from the Omni console component the ACD is notified via SFDC streaming API to connect the pending call with the agent who accepted the case. In fact the ACD server is the only subscriber of the StreamingAPI PushTopic.

I have a fundamental problem to understand that approach:
1. from my understanding OpenCTI only runs in context of a client browser … to create a case outside that context, OpenCTI needs to connect to SFDC in a different way. That was the old CTI way … OpenCTI tries to get rid of that!

2. StreamingAPI cannot connect to server side processed outside of SFDC (like a server run by a ACD provider), again: the only way is to notify the OpenCTI console component via Javascript events fired by service console integration toolkit. 

Does anyone ever did such an implementation or found any kind of best practice documents coming from SFDC?

Before you ask: we have a running ServiceCloud implementation (1000+ agents) using OpenCTI in the „classic way“ for a couple of years now. Moreover we have a new PoC using Omni-Channel for Email,Web and LiveAgent in place. The missing piece is to connect OpenCTI and Omni and let Omni do the call routing instead of the ACD provider.

Thanks for any kind of inspiration 

Best,
Andreas
I generated enterpise WSDL via Setup > Develop > API.  I am getting error while generating java classes and domain objects via the wsimport tool included in the JAX-WS toolkit. It seems to be generating duplicate names in the schema. Can anyone help me fix my environment so it generates a clean wsdl. Is there anyway to select only objects I want to generate because it is a very long WSDL containing all objects which I may not need. 

The command I used is:
./wsimport.sh -verbose ../../salesforce.wsdl.xml

The Errors are:

[WARNING] src-resolve: Cannot resolve the name 'tns:ID' to a(n) 'type definition' component.
  line 44 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml#types?schema1
[WARNING] Simple type "StatusCode" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 274, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.
  line 15439 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeGlobalTheme" is already in use. Use a class customization to resolve this conflict.
  line 16052 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Relevant to above error) another "DescribeGlobalTheme" is generated from here.
  line 17487 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeLayout" is already in use. Use a class customization to resolve this conflict.
  line 17615 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
  line 16653 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeApprovalLayout" is already in use. Use a class customization to resolve this conflict.
  line 17684 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Relevant to above error) another "DescribeApprovalLayout" is generated from here.
  line 16635 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 16052 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Related to above error) This is the other declaration.   
  line 17487 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 17615 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Related to above error) This is the other declaration.   
  line 16653 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 17684 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Related to above error) This is the other declaration.   
  line 16635 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 15025 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] (Related to above error) This is the other declaration.   
  line 15028 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 15029 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
(ERROR] (Related to above error) This is the other declaration.   
  line 15026 of file:/Users/sargawal/Downloads/salesforce.wsdl.xml
Exception in thread "main" com.sun.tools.ws.wscompile.AbortException
    at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:144)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2298)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:198)
    at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:141)
    at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:444)
    at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:205)
    at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:183)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.sun.tools.ws.Invoker.invoke(Invoker.java:174)
    at com.sun.tools.ws.WsImport.main(WsImport.java:57) 

 
I am trying to find the best approach to find out if an Opportunity Line Item is a 'duplicate' based on the Product Name on the line item as well as a few fields on the Opportunity record itself, maybe Client Name, Business Unit and Sales Stage.

My thoughts are to use an after insert trigger to determine which fields need to be grabbed to 'lookup' exsiting opportunities and opportunity line items that might be duplicates, but I am stuck on how to do the code and then bulkify the code.  What type of collections(s) should the key fields be placed in so that we can query the database to look for potential duplicates?  If this is not the correct approach, please let me know.

Any suggestions?

 
Hello friends
what is quotation in salesforce.
Please let me know with practical example, where it is used and why.

any interview questions on quotation will be appreciated.

krishna​​​​
trigger OnboardingPackage on Task (after insert) {
    
    Set<String> whatIDs = new Set<String>();
    
    for (Task t : Trigger.new) {
        whatIDs.add(t.whatID);
    }
    
    List<Opportunity> opps = [SELECT Id, Product__c, Accounting_Platform__c,Plan__c,Billing_Cycle__c FROM Opportunity WHERE Id =: whatIDs];
    
    List<Contact> conList = new List<Contact>([select Email from Contact where Id In (select ContactId from OpportunityContactRole where OpportunityId = :whatIDs)]); 
    
    EmailTemplate et1 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Desktop included']; // Stephanie
    EmailTemplate et2 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Desktop not included']; //Andrew
    EmailTemplate et3 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Cloud']; // Andrew
    EmailTemplate et4 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Shiplark'];
    EmailTemplate et5 = [SELECT id FROM EmailTemplate WHERE Name = 'Accounting Consult']; 
    EmailTemplate et6 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Desktop included for POS']; // Aaron
    EmailTemplate et7 = [SELECT id FROM EmailTemplate WHERE Name = 'Onboarding Package Desktop included for PPI']; //Andrew
    
 
    for(Task t:Trigger.New){
        
        for(Opportunity o :opps){
            
            for(Contact c: conList){
            
               if((t.subject=='Implementation service : Install') && (o.Plan__c=='EnterpriseHosting' || o.Plan__c=='pro/premierHosting' ||  o.Accounting_Platform__c== 'QuickBooks Enterprise (US)' || o.Accounting_Platform__c=='NetSuite')){
                      sendNotification(et1.id, c.id, o.id);
                        
                }else if((t.subject=='Implementation service : Install') && (o.Accounting_Platform__c=='QuickBooks POS (US)')){
                    sendNotification(et6.id, c.id, o.id); 
                       
                }else if((t.subject=='Implementation service : Install') && (o.Accounting_Platform__c=='QuickBooks Pro/Premier (US)' ||  o.Accounting_Platform__c== 'QuickBooks CA/UK/ZA/AU') && o.Billing_Cycle__c=='Yearly'){
                    sendNotification(et7.id, c.id, o.id); 
                       
                }else if((t.subject=='Implementation service : Install') && (o.Accounting_Platform__c=='QuickBooks Pro/Premier (US)' ||  o.Accounting_Platform__c== 'QuickBooks CA/UK/ZA/AU') && o.Billing_Cycle__c=='Monthly' ){
                    sendNotification(et2.id, c.id, o.id); 
                       
                }else if((t.subject=='Implementation service : Install') && (o.Accounting_Platform__c=='QuickBooks Online (US)' || o.Accounting_Platform__c== 'Xero (US)')){
                    sendNotification(et3.id, c.id, o.id);  
                  
                }else if((t.subject=='Implementation service : Install') && (o.Accounting_Platform__c=='Shiplark')){
                    sendNotification(et4.id, c.id, o.id);  
                      
                }else if(t.subject=='Implementation service : Pro Advisor'){
                    sendNotification(et5.id, c.id, o.id);  
                  
                }
                
            }
        }            
    }
    
  public void sendNotification(string eTempID,string tgtObjID,string  whatID){

        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        // CONFIGURE MAIL
          mail.setTemplateId(eTempID); 
          mail.setTargetObjectId(tgtObjID);
          mail.setWhatId(whatID);
          mail.setReplyTo('customersuccess@webgility.com');

        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

}