I am using com.sforce.soap.metadata.FieldType and com.sforce.soap.metadata.CustomField classes to create custom fields using java code. Now I want to create a field which is type of geolocation in salesforce but there is no such constant FieldType.geolocation, So my question is that how can i create geolocation field using these api.

  • My first suggestion would be to examine how a Geolocation field created via the UI appears in the metadata api. Doesn't it split into separate fields? Like myField__Latitude__s and myField__Longitude__s? Apr 12 '14 at 9:21
  • The Spring 14 release notes mention a beta that exposes a read only Geolocation compound field in the SOAP and REST APIs. So now you have one geolocation field that gets tree separate fields in the API> Apr 12 '14 at 9:26
  • @DanielBallinger Thanks for reply. Today I checked my metadata api version and it is 29.0 . Is it the reason i am not getting geolocation type not even Latitude/Longitude. Apr 14 '14 at 5:53
  • I can get geolocation field via myField__Latitude__s and myField__Longitude__s, but how can i create this type of field in my java program because there is no such type of FieldType.location or FieldType.geolocation ? Apr 14 '14 at 6:03
  • The beta read only Geolocation would be in API v30.0 for Spring 14. It would be a bit surprising if it really wasn't possible to create a Geolocation field in the Metadata API. Otherwise how would people migrate or package such a field? Apr 14 '14 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.