Salesforce:如何使用java为Goelocation数据类型字段插入值?

Salesforce:如何使用java为Goelocation数据类型字段插入值?,salesforce,force.com,Salesforce,Force.com,我正在使用RESTAPI将对象插入salesforce。我有一个字段的地理位置数据类型。 如何使用java将值插入此字段?下面是我的示例代码 parishud.put(“gps_u_______________________________ 有两个字段要插入(gps(纬度)gps(经度)),但在API中我只找到了一个名为gps_uc的字段 HttpClient client = new httpclient.HttpClient(); JSONObject parishud = new

我正在使用RESTAPI将对象插入salesforce。我有一个字段的地理位置数据类型。 如何使用java将值插入此字段?下面是我的示例代码

parishud.put(“gps_u_______________________________

有两个字段要插入(gps(纬度)gps(经度)),但在API中我只找到了一个名为gps_uc的字段

  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);

地理定位字段实际上由3个字段组成,其中2个可供我们访问

如果字段名为
gps
,则可以将数据存储在
gps\uuuuu纬度\uuuu s
gps\uuu经度\uu s
(注意开头的双下划线,就像它是一个托管包,结尾是“s”,而不是“c”)

确保您已经为Java集成用户设置了概要文件级别的安全性,以便能够访问此字段


如果您需要代码示例,您可以查看我的答案,或者例如,地理位置字段实际上由3个字段组成,其中2个可供我们访问

如果字段名为
gps
,则可以将数据存储在
gps\uuuuu纬度\uuuu s
gps\uuu经度\uu s
(注意开头的双下划线,就像它是一个托管包,结尾是“s”,而不是“c”)

确保您已经为Java集成用户设置了概要文件级别的安全性,以便能够访问此字段


如果您需要代码示例-您可以检查我的答案,或者例如

我可以插入不带gps\uuu c字段的对象。我可以插入不带gps\uu c字段的对象。