• Shanmu P 6
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
In my app, I want to have a trigger after user creation. That trigger has to be based on custom checkbox in "New User" creation page. How to create this cutom checkbox in "New user" creation page using apex ?
I want to set a trigger on "user" object and that be optional. So that I need to add a custom checkbox to "Users" object creation page. Is it possible? If so please provide any samples. Thanks in Advance!
In my app, I want to have a trigger after user creation. That trigger has to be based on custom checkbox in "New User" creation page. How to create this cutom checkbox in "New user" creation page using apex ?
I want to set a trigger on "user" object and that be optional. So that I need to add a custom checkbox to "Users" object creation page. Is it possible? If so please provide any samples. Thanks in Advance!
Hi

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?
  • October 28, 2015
  • Like
  • 0
We've successfully added a number of Custom Fields using the Metadata API.  Our site is an Asp.net and we're using VB for coding (thought about posting to .NET Development, but our question is more API focused).  First we build a Custom Field: 
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 = False
Then 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?

  • May 23, 2014
  • Like
  • 0

Hi,

 

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.

 

 

Thanks