3

I am able to create a Custom Field on standard object (like Account or Contact) via API. I see this field was created in Salesforce UI as a custom field.

But, whenever I describe sobject via API - I don't see this field in list of fields. And of course if I try creating a new sobject via API, I get an error that this field doesn't exist.

Now, if I go to "Customize fields on Accounts page" and add this custom field to be visible here, it automatically becomes also visible via describe sobject API call.

Is there a way to perform something like that via API, or even better to make this field visible/editable via API but without adding it to Account page?

P.s. I am 'System Administrator'

3

It doesn't look like you'll be able to update this data without the field appearing on the layout, but with the Metadata API, you should be able to automate this.

I don't have a Professional Edition (PE) Org I can play around with, but based on previous knowledge, and what I can find in the docs, by default, PE Orgs don't have profiles, and as such, don't have Field Level Security (FLS). Profiles appear to be a paid Add-On for PE.

Salesforce Edition Comparison Chart

Furthermore, field visibility appears to be tied to the Page Layout. Any field that is not on the layout, is not visible.

Security Access in GE/PE http://wiki.developerforce.com/page/Designing_an_Application_for_Group_and_Professional_Edition

Both GE and PE do not support custom profiles. As a result, when a customer installs your app, they will not be able to define which profiles have access to what. Therefore, you should be sure to design your app to work for the Standard User profile at a minimum. Furthermore, these standard profiles are not editable, and field-level security is handled on the page layout. In other words, any fields you want to access to must be on the page layout or they will not be visible by the API or Visualforce.

For instance, if you've create a custom Visualforce page that displays a field, this field must be on the default page layout for it to appear in the Visualforce page. The same is true with API integration. You cannot read/write to a field that is not on the page layout in GE and PE.

Since you have API access and were able to create the field using the API, you should be able to retrieve, update, and deploy the Page Layout for that specific object. If you create the field & include that field in the layout, you should be to view/edit this fields data via the API.

Take a look at the Layout Section of the Metadata API Developer's Guide.

2

When you create it via the UI, you are forced to choose which Profiles is the Object/Field visible to. Hence why you are able to see it via the API.

I would try checking visibility of the Object/ Field created via the API, i.e. via the UI, login and check that it is visible to the System Admin Profile (Manage Users > Profiles > Custom Object Permissions and check at least Read is checked)

For a field, you could check the Field Level Security is set appropriately

  • Hmm... I don't see 'Profiles' link under 'Manage Users'. I see it in my developer account, but I don't see in actual Salesforce account. – antonlitvinenko Nov 22 '12 at 2:45
  • If you're System Admin, you should be able to see Profiles login.salesforce.com/help/doc/en/users_profiles_view.htm (unless its an Edition limitation) – techtrekker Nov 22 '12 at 2:53
  • Does your profile have the manage profiles permission? – Mike Chale Nov 22 '12 at 13:29
  • @MikeChale How can i check that? – antonlitvinenko Nov 22 '12 at 16:50
  • If you can, have a sys admin check. If not, click My Name\Setup\Personal Information. Your profile should be a link; click that add go to System Permissions. It should be in there. – Mike Chale Nov 22 '12 at 18:35
2

In Professional Edition, we have two add-on features:

  1. API

  2. Custom Profiles with Multiple Layouts and Field Level Security (FLS)

In other words, with the second add-on feature, you actually get three features instead of just one. If you think Custom Profiles (and Layouts/FLS) should be automatically available in Professional Edition without paying an add-on fee, please vote up the following idea: http://success.salesforce.com/ideaView?id=08730000000BpxBAAS

Without the ability to create/edit custom profiles or manage field level security, field access is determined exclusively by adding it or removing it from the single page layout that exists with each object. As a result, until you add the field to the layout, your users won't be able to access it in the user interface or through the API.

Without knowing what add-ons you have, it sounds like you have API access but not Custom Profiles. As a result, until you add the newly created field to the layout, you won't be able to describe the object in the API and see the field - even if you're the System Administrator (remember, Modify All Data on the System Administrator profile does not count towards field level security or field access)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.