• GABRIEL SILVA
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Developer and Administrator


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 9
    Replies
I'm new in Community Cloud and i have a public Napili community with a Topic Catalog page and a record list. I want to show all products that i have in my Sales Cloud without customer login. Anyone can help me? 

I put the record list with the product objetc and my page was defined public. After, I actived the External Sharing Model in OWD.
I already can view my page without login, but i can't view the product records.
Hello,

I'm trying to call my Apex web service method from java. The jar file was generated with enterprise.wsdl and wsc-39.0.4.jar. I created a simple java application and imported both jar files.

This is my simple web service on Apex:
 
global class webServiceBiel{
    
    WebService static integer soma(integer a, integer b){
        return a+b;
    }
}

I created a class in java to connect with my org. Here it is:
 
import com.sforce.soap.enterprise.Connector;
import com.sforce.soap.enterprise.EnterpriseConnection;
import com.sforce.soap.enterprise.QueryResult;
import com.sforce.soap.enterprise.sobject.Account;
import com.sforce.soap.enterprise.sobject.SObject;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.ConnectorConfig;
import java.util.List;
import java.util.Arrays;

public class Main {

    static final String USERNAME = "gabriel.silva.dph@delphos.com.br.desenv";
    static final String PASSWORD = "Apex7410Z6iLE5wLGxxYbZsUY62U7lPC";
    static EnterpriseConnection connection;

    public static void main(String[] args) {

        ConnectorConfig config = new ConnectorConfig();
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        try {
            connection = Connector.newConnection(config);

            System.out.println("Auth EndPoint: " + config.getAuthEndpoint());
            System.out.println("Service EndPoint: " + config.getServiceEndpoint());
            System.out.println("Username: " + config.getUsername());
            System.out.println("SessionId: " + config.getSessionId());
            
            Biel_getContas();
            
        } catch (ConnectionException e1) {
            e1.printStackTrace();
        }
    }
    
    private static void Biel_getContas() {
        Account conta;
        System.out.println("Buscando as contas existentes...");
        
        try {    
            QueryResult queryResults = connection.query("SELECT Id, Name FROM Account");

            if (queryResults.getSize() > 0) {
                List<SObject> contas = Arrays.asList(queryResults.getRecords());
                for (SObject obj : contas) {
                    conta = (Account) obj;
                    System.out.println("ID = "+conta.getId());
                    System.out.println("Name = "+conta.getName());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

After running the application, I noticed that I have all the permissions on org, but I just want to connect with my web service and not have full access. How can i call WS method and block access to other things?
Good afternoon,

I need to know how works the endDate field in contract. If i the startDate = "01/12/2016", the endDate will be "31/12/2016". If i the startDate = "30/11/2016", the endDate will be "29/12/2016".  Why "29/12/2016"?
Hi good morning,

This is my first time using data loader and I want to import users to my org, but i'm having troubles with csv structure. When I'm trying to import, I get this error "Required fields are missing: [Username, LastName, Email, Alias, CommunityNickname, TimeZoneSidKey, LocaleSidKey, EmailEncodingKey, ProfileId, LanguageLocaleKey]".  I dont know what i'm doing wrong. May anyone help me?

My CSV:

1° row --> USERNAME - LASTNAME - FIRSTNAME - EMAIL - ALIAS...
2° row --> abcd@xxxx.com.br - Silva - Gabriel - xxx.xxx@xxxx.com.br - GS

1° row --> ...COMMUNITYNICKNAME - ISACTIVE - TIMEZONESIDKEY...
2° row -->        gabriel.silva - true - America/Sao_Paulo

1° row --> ...LOCALESIDKEY - EMAILENCODINGKEY - PROFILEID - LANGUAGELOCALEKEY
2° row -->        pt_BR - ISO-8859-1 - 00e410000019X9H - pt_BR
Hi good evening,

I have a developer team and i want each developer work in one sandbox. After, i will need to do the merge of these sandboxes. How can i do this?
Hi good afternoon,

Is there any way to get metadata (custom fields, custom objects and others things, created in the sandbox) in Force.com IDE (Eclipse)? If yes, can i do a deploy with these metadata  to my production org?

I tried get but only came apex code. (Nothing declaratively)

How can i do that?
Hi good afternoon,

I would want to save externally my structure after deploy my customizations to production. Is there any way to download this settings? 
I'm new in Community Cloud and i have a public Napili community with a Topic Catalog page and a record list. I want to show all products that i have in my Sales Cloud without customer login. Anyone can help me? 

I put the record list with the product objetc and my page was defined public. After, I actived the External Sharing Model in OWD.
I already can view my page without login, but i can't view the product records.
Hello,

I'm trying to call my Apex web service method from java. The jar file was generated with enterprise.wsdl and wsc-39.0.4.jar. I created a simple java application and imported both jar files.

This is my simple web service on Apex:
 
global class webServiceBiel{
    
    WebService static integer soma(integer a, integer b){
        return a+b;
    }
}

I created a class in java to connect with my org. Here it is:
 
import com.sforce.soap.enterprise.Connector;
import com.sforce.soap.enterprise.EnterpriseConnection;
import com.sforce.soap.enterprise.QueryResult;
import com.sforce.soap.enterprise.sobject.Account;
import com.sforce.soap.enterprise.sobject.SObject;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.ConnectorConfig;
import java.util.List;
import java.util.Arrays;

public class Main {

    static final String USERNAME = "gabriel.silva.dph@delphos.com.br.desenv";
    static final String PASSWORD = "Apex7410Z6iLE5wLGxxYbZsUY62U7lPC";
    static EnterpriseConnection connection;

    public static void main(String[] args) {

        ConnectorConfig config = new ConnectorConfig();
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        try {
            connection = Connector.newConnection(config);

            System.out.println("Auth EndPoint: " + config.getAuthEndpoint());
            System.out.println("Service EndPoint: " + config.getServiceEndpoint());
            System.out.println("Username: " + config.getUsername());
            System.out.println("SessionId: " + config.getSessionId());
            
            Biel_getContas();
            
        } catch (ConnectionException e1) {
            e1.printStackTrace();
        }
    }
    
    private static void Biel_getContas() {
        Account conta;
        System.out.println("Buscando as contas existentes...");
        
        try {    
            QueryResult queryResults = connection.query("SELECT Id, Name FROM Account");

            if (queryResults.getSize() > 0) {
                List<SObject> contas = Arrays.asList(queryResults.getRecords());
                for (SObject obj : contas) {
                    conta = (Account) obj;
                    System.out.println("ID = "+conta.getId());
                    System.out.println("Name = "+conta.getName());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

After running the application, I noticed that I have all the permissions on org, but I just want to connect with my web service and not have full access. How can i call WS method and block access to other things?
Good afternoon,

I need to know how works the endDate field in contract. If i the startDate = "01/12/2016", the endDate will be "31/12/2016". If i the startDate = "30/11/2016", the endDate will be "29/12/2016".  Why "29/12/2016"?
Hi good afternoon,

Is there any way to get metadata (custom fields, custom objects and others things, created in the sandbox) in Force.com IDE (Eclipse)? If yes, can i do a deploy with these metadata  to my production org?

I tried get but only came apex code. (Nothing declaratively)

How can i do that?

    

Hi,

I know there are multiple posts related to this exception and I've gone through them, but I can't seem to find a solution.

I am trying to call a custom web service provided to us by a customer. We used a Partner WSDL previously for making other 'describeObject' type calls to the API. But now, we need to call the web service method exposed by the customer's WSDL. I added the custom WSDL as a web reference on my project.

I'm able to get the session id and server url by calling the sForceService.login(username, password) method. But the subsequent call to the customer's web service method fails with an 'Invalid SessionId' exception. Customer's account is a Sandbox account.

Here is the code:

//_sforceService: Salesforce Partner WSDL reference.

_sForceService = new SforceService();
_sForceService.Url = "https://test.salesforce.com/services/Soap/u/28.0";  //Is this correct? if I don't assign this, the login fails
_loginResult = _sForceService.login("username", "Password+security token");

//ucGuideBook.GIA_ServiceService is Customer's webservice.
ucGuideBook.GIA_ServiceService ucGIAService = new GIA_ServiceService();
ucGIAService.SessionHeaderValue = new ucGuideBook.SessionHeader();
ucGIAService.SessionHeaderValue.sessionId = _loginResult.sessionId;

//This call fails:
string ucGuideBook = ucGIAService.getGuidebookXml("AccountId");

Exception:

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key:

It seems like it's going to a different Sandbox than the one that has the active session. It might have something to do with the WSDL endpoint, I'm not sure. The WSDL end point is: https://cs2.salesforce.com/services/Soap/class/ClassName.

The serverUrl that is returned from the .login() method: "https://mysandbox.cs13.my.salesforce.com/services/Soap/u/28.0/OrgId" . I tried changing the wsdl end point to be cs13, but that didn't help.

I looked at existing forum answers, and ensured this setting was off - "Lock sessions to the IP addresses from which they originated" (doesn't make a difference whether it is ON or OFF), and could not find anything else relevant.

Any help would be greatly appreciated.

 

Friends,
 
I have created a simple APEX class with a function named HELLO() which accepts a string, searched in accounts for name starting with that string and returns a count in string format. I have generated it as a Web Method so that I can use this in .Net. I further generated a WSDL file from it and tried to use it ASP.NET.
 
After creating an instance of my web service, i get the Hello method accessible, but how do I set the login credentials for my APEX call. It says invalid session Id. Snippet from ASP.Net code.
 

protected void Page_Load(object sender, EventArgs e)

{

Test.HelloWorld2Service obj = new CellsMerge.Test.HelloWorld2Service();

string a = obj.Hello("s");

}

 

Any suggestions as how can we achieve this functionality.

Siddharth