How to access MetadataService.cls and use it? I want to modify the picklist values and reading couple of post I could understand that using MetadataService.cls i can achieve it but i dont know where to get this MetadataService.cls and how to access it ....an tips please?
metaCustomField = New sfMetadata.CustomField metaCustomField.fullName = "Account.TestField__c" metaCustomField.description = "Test Field for Account" metaCustomField.inlineHelpText = "Test Field for Account" metaCustomField.label = "Field Label" metaCustomField.length = 20 metaCustomField.lengthSpecified = True metaCustomField.unique = FalseThen we add the Custom Field to an Array of Custom Fields (metaCustomFields). There are roughly 40 fields, so we limit the array to 10 and submit each batch of 10 fields using:
metaCustomFieldsResult = myMetaService.create(metaCustomFields)This all works well, and the fields are created as desired. The first time we created the fields, it worked perfectly and we were then able to use the Soap API to populate the Account object with data (including the custom fields).
However, for some reason, if we delete a Custom Field and then add it again, or if we test using other Salesforce logins, the fields are getting generated properly, but the permissions on the fields are no longer being set (none of the "Field-Level Security" is set to visible). We're not sure what we changed, but we've begun looking into how to apply Permission Sets to the Custom Fields for the Account object. There appears to be a couple concepts to consider. First, we've seen some code for building a package.xml file listing our field permissions and then submitting the zipfile:
<fieldPermissions> <editable>true</editable> <readable>true</readable> <field>Account.TestField__c</field> </fieldPermissions>In addition, we noticed that there are some additional Metadata API functions that look like they might help, but we can't find any details or code samples on how to apply them:
' Will adding either of these lines to the ' Custom field definition help: metaCustomField.visibleLines = 1 metaCustomField.writeRequiresMasterRead = True ' Or, define a Permission Set metaFieldPermission = New sfMetadata.PermissionSet ' Not sure what to do with it from here...
Can anyone tell us if we are heading in the right direction, or if there is a preferred method for setting the "Visible" Field-Level Security permissions for the custom fields we have created?
I am accessing the salesforce account as Admin.Now i want to crete a User who should have a field "customer_key" along with the fields mentioned in Salesforce.com to create a User.
Inorder to make the custom field available in Salesforce.com create user page, the custom field need to be added to the existing User object.Is my guess correct?
Also anyone please suggest me on how to add a "Custom Field" to the existing Object in Salesforce.com.