1

RESTAPIを使用してSalesforceにオブジェクトを挿入しています。Geolocationデータ型のフィールドが1つあります。Javaを使用してこのフィールドに値を挿入するにはどうすればよいですか?私のサンプルコードは以下のとおりです。

parishud.put( "gps__c"、?????);

挿入するフィールドは2つあります(gps(Latitude)gps(Longitude))が、APIではgps__cという名前のフィールドが1つしか見つかりませんでした

  HttpClient client = new httpclient.HttpClient();
  JSONObject parishud = new JSONObject();
  try {
      parishud.put("Name","ParishudhTest4");
      parishud.put("entitled__c","Yes");

      parishud.put("Comments__c","Comments");
      parishud.put("fallill_count_after__c","5");
      parishud.put("fallill_count_before__c","7");
      parishud.put("influencedcount__c","8");
      parishud.put("toiletusaseperday__c","3");
      parishud.put("parishudhid__c","002");
      parishud.put("Received_NBA_Incentive__c","Yes");
      parishud.put("Received_NREGA_Incentive__c","Yes");

      //parishud.put("gps__c",?????);


    PostMethod postaccount = new PostMethod("https://ap1.salesforce.com/services/data/v20.0/sobjects/Parishudh__c/");
    postaccount.setRequestHeader("Authorization", "OAuth " + accessToken);
    postaccount.setRequestEntity(new StringRequestEntity(parishud.toString(),"application/json", null));
    client.executeMethod(postaccount);
4

1 に答える 1