Questions tagged [custom-field]

A custom field can be added to standard objects that support custom fields and custom objects to extend the capabilities of Salesforce to suit the specific needs of an organization. Custom fields can be accessed in code by referring to them by their API Name which is their specified Field Name value suffixed with an __c.

Filter by
Sorted by
Tagged with
5
votes
3answers
3k views

How to get the entity ID for a custom field in Apex?

I am looking for a way to get the 15 character entity ID for a custom field on my Lead object in an Apex controller. I have tried this: private String getEntityIdFor(String fieldName) { Map&...
3
votes
2answers
2k views

Uncheck checkboxes by changing particular checkbox state

I have custom fields in contacts form named checkbox1__c, checkbox11__c, checkbox12__c, checkbox13__c. When I check checkbox1__c then I want checkbox11__c, checkbox12__c, checkbox13__c to be ...
44
votes
5answers
31k views

How do I generate a random string?

How does one generate a random string sequence with Apex? I need to generate a code when a particular object is created in our Salesforce environment. I'd like the code to contain numbers from 0-9 ...
8
votes
1answer
12k views

Custom link to download/export report in single click

I have a custom link titled Download on my Contacts page layout that when clicked currently takes me to the Export Report page with standard buttons Export and Done. I used the URL content source /...
8
votes
1answer
8k views

Custom fields not useable in Approve/Reject Approval Request

I'm trying to get through my first SalesForce mod and it's definitely been a rocky path. I have one task I'm trying to do, but this section is holding me back. I have two custom fields. One a pick ...
7
votes
1answer
6k views

How to change a field type and deploy when field is referenced in code

I have a custom field on the user object that I need to change from Field Type Text to Field Type Multi-Picklist. The field is referenced more than 500 times in 25 Classes, Triggers and VisualForce ...
4
votes
3answers
12k views

Date Formula to Calculate date excluding weekends

I have a formula that is calculating the date from another date field + number of days and returning a date. test census dates field = Confirmed_Enrolled_Date__c + 16 I want to exclude weekends ...
5
votes
2answers
2k views

are custom fields deletable from a managed package?

I see this has been asked before but this doc seems to indicate that custom fields are developer deletable (pg 29), am I missing something? I don't see any way to delete them. https://na15.salesforce....
8
votes
2answers
7k views

Set Field Level security for profile using meta-data api

I am using meta-data api to create custom fields in java class. Now I want to set field level security for different profiles. First is it possible to set this with meta-dat api, If yes than how can I ...
9
votes
3answers
13k views

Change field Data Type without removing all references to said field in Controllers and Classes

Is it possible to change a field's Data Type without removing all references to it in controllers and classes? I'm considering changing a Rich Text Area to a Long Text Area. I'm receiving the ...
6
votes
2answers
3k views

Junction object fields

I have created a many to many relationship between two objects, A and B, using a junction object. That works fine, and the related lists show up on A and B with standard layout pages. Is it possible ...
15
votes
3answers
14k views

Finding if a custom field is editable using Apex code

I am reading the custom fields of a custom object Custom__c and then for each field I am inserting a new value: Public Custom__c custom1 {get;set;} Map<String, Schema.SObjectField> map = ...
7
votes
2answers
2k views

How to remove a custom field from a managed package referenced in a custom report type?

Question Is there anyway to get rid of custom field in a managed package that has been referenced in a custom report type for that managed package? Background I've built a managed package and for ...
5
votes
1answer
5k views

How to update Account object when related AccountPartner is updated/inserted/deleted/undeleted?

I am working on an org with Person Accounts enabled, but I think that my problem applies to regular non-person Accounts as well. I am tasked with writing a trigger to cross-populate spouse ...
6
votes
4answers
12k views

How can I add a new value to a picklist using APEX?

I have queries pulling all of the information correctly but what I can't seem to find was a way to add new options to a picklist using APEX. I currently have Package__c.Products__c.add(new Schema....
4
votes
1answer
3k views

Custom Field Limits For Managed Packages

The documentation on global limits says this: The custom objects contained in a managed package publicly posted on the AppExchange don't count against the limits for your Salesforce Edition. ...
3
votes
2answers
5k views

GROUP BY custom field

I'm doing this query: SELECT ID, Name, Email_Domain__c FROM Contact GROUP BY Email_Domain__c And I'm getting this error MALFORMED_QUERY: GROUP BY Email_Domain__c ^ ERROR ...
1
vote
2answers
3k views

Formula Error: Syntax error. Extra ','

I am trying to write a formula for opportunities but I keep getting the following error Error: Syntax error. Extra ',' Here is my formula IF (TODAY() > CloseDate && TEXT(...
0
votes
1answer
3k views

How to get the ID of Custom Object

Can anyone please tell me that how to get the ID of Custom Object like, I am loading all the Custom Object by describeglobal() and than setting the name, label and plural label as the datasource for a ...
0
votes
1answer
1k views

How to create Custom Fields on Standard Objects in the package.xml

I want to add custom fields to the Contact Object in SFDC. When I look into the package.xml I do not see any of these changes or fields. I am missing something?
0
votes
3answers
2k views

convert text field to lookup field in salesforce

I need to convert a text field to Lookup field on Object 'A' As we cannot convert directly so there is one approach is to create a one object 'B'and create a lookup field on object A.My Question is if ...
-4
votes
1answer
110 views

My Save Button is not working

I have one custom object called (FeedbackFrom__c) in that I having 10 fields, each fields having different VF Pages at page no 11, I am having one save button if I click that automatically 10 fields ...
11
votes
3answers
7k views

Metadata API Custom Field Permissions (how to automate this process)

We are using the Metadata API to add Custom Fields to the Account object in Salesforce. We are able to create the custom fields, but then the Salesforce user has to manually login to their account ...
32
votes
1answer
24k views

Populating Custom Settings field using Apex

I'm trying to populate/set/put/initialize a custom setting's field with a calculated value within my apex code. The field type is number. Is there a way to do this?
13
votes
2answers
747 views

What is the logic for the automatic creation and update of “standard” report types for custom objects?

Question What is the detailed logic for when a "standard" report type is created/updated for custom objects or custom relationships? Background When custom objects and custom master detail ...
12
votes
3answers
9k views

How to access and not hardcode the field ID for a custom object? Using Apex, to construct URLs

Lets say you wanna create a new instance of a custom object, lets call this Custom Object Relationship_Detail__c. You are trying to create a link where it takes you to the proper RecordTypeId and it ...
10
votes
1answer
745 views

<deprecated>false</deprecated> randomly appears in object metadata in managed package. Why?

Sometimes when I commit the latests changes in my managed package to my version control I see those changes in the XML metadata of my custom objects. I heard that Salesforce.com is working on some ...
9
votes
1answer
3k views

How to upload videos into custom object record

How to upload videos into custom object record like as photo upload in rich text field. no need to display a link i want to display a video
4
votes
2answers
4k views

Find fields that are not in use

Scenario In my grown org (200 objects, thousands of fields) some fields are not in use. We define as not in use by the following criteria: (A) No records for the whole object or (B) not populated ...
2
votes
1answer
3k views

calculate duration spent in custom field status

We are trying to track the duration (time spent in days/hours) in each Status change (Custom Field) on the Opportunities Object. Right now we have enabled field history on this custom field (picklist) ...
2
votes
1answer
2k views

Custom New Button that creates record of specific type and parent record in Visualforce Controller (No URLFOR!)

Sorry for the lengthy title. But I want to make sure that I was not able to solve my problem with the standard answers to questions like this. I have a CustomObject_c that has many record types and a ...
10
votes
1answer
2k views

Use-Case for Encrypted Custom Fields and why are they rendered as input type=“text” and not as type=“password” on standard UI?

Can't understand why Encrypted Custom Fields are not rendered as type="password" on the standard UI. The first time you input or later if you change the content, it's just plain text. If you come back ...
6
votes
1answer
91 views

Is it possible for an AppExchange package to create a custom list of custom fields?

We have an AppExchange package that would ideally create a different set of custom fields for each customer, depending on configurations that either the customer sets at package installation time or ...
4
votes
2answers
10k views

What is the object that stores “files”

Which object stores the files (not attachments)? I'm looking to access this via a trigger. Is it possible to add a field to this document/file objects?
2
votes
2answers
194 views

Import custom fields from WSDL

Is there a way to bulk create custom objects and fields from a WSDL file so I can match the same fields in a dev account?
2
votes
2answers
1k views

Master-Detail Relationship on Custom Object from Managed Package

Is it possible to add Master-Detail Relationship on Managed Custom Object? currently I am getting below error
2
votes
2answers
787 views

Contact record update trigger

I am writing apex trigger. I need help with a salesforce automation. Sets a field "My Field" to Yes. This triggers the code. Code finds all contacts with the same email address. Code updates the ...
2
votes
2answers
3k views

Can a formula field be indexed?

I have a formula field called ContactID18__c on the Account object. The formula is CASESAFEID(PersonContact.Id). Can this field be indexed or no because it is a custom field and a formula? Or is ...
2
votes
2answers
1k views

Updating Previous Owner field on Case object

I have a custom field called Previous_Owner__c on the standard Case object. Every time the Owner is changed, I need to update this field with the previous owner's value. I have written a before update ...
2
votes
2answers
1k views

Add a custom field to multiple objects

I am working on an assignment to populate the data in a developer sandbox with production data. This activity involves me in populating data for over 50 objects. I am planning to create an external Id ...
2
votes
1answer
2k views

Cannot update a field to a Summary from something else

I've got a problem in which I'm trying to deploy something whereby a field of type Number is being changed to a summary field. What's happened is we created an object, Opportunity__c with two fields: ...
1
vote
1answer
132 views

Co-owner field in Account

I have a field called Co-ownere in "Account" Object where I need to query from the field. In the field I have 2 owner value seperated with ';'. So I want to know What I need to do So that I can ...
1
vote
1answer
348 views

Do all developer orgs come with a bunch of custom fields?

I previously installed an app from AppEchange to my developer org, and after a while, uninstalled it. I now have no installed packages. I recently noticed that the standard Account Edit page is using ...
1
vote
1answer
3k views

How to copy data from Rich Text area field to Text Area field

I want to copy data from RichText Area field to Text Area field,When I copied in Text area field,The data is displaying with HTMl tags. How can I convert this? edited to add code from comment ...
0
votes
1answer
287 views

URL Hack question

I have a custom object called Milestone, which is attached as a junction object to a custom object called Invoice and Opportunities. I'm trying to build a button on Opportunity page layout with a URL ...
0
votes
1answer
220 views

Populating Opportunity custom field with MULTIPLE ProductOpp field values

Using the solution on SF StackExchange here I have created a Workflow Rule and Field Update to show the value of a custom field present on the OppProduct Level in Opportunity Level (as that field ...
0
votes
1answer
347 views

Trigger to Auto Assign Field value to Object Record

How do I create a trigger and trigger handler to auto assign a name for custom field on a custom object when a new record is created? The auto-assigned name should be randomly selected from a list of ...
0
votes
2answers
2k views

How to translate custom tabs and labels through export/import of translation files a la translation workbench

I am interested if there are ways to export/import translation files for the custom and standard tabs and labels, just like how it's done in the translation workbench for custom fields, etc. I ...