The tag has no wiki summary.

learn more… | top users | synonyms

7
votes
4answers
79 views

How to get the Runtime-Type of an Object dynamically (for Primitive Data Types and SObjects)

Is it possible to get the Type of an Object (it's not an SObject)? String s = 'test'; doSomething(s); public static void doSomething(o Object) { // need to find out if o is a string or an ...
2
votes
1answer
35 views

Equivalent data type in standard or custom object to persists blob data?

I have built a webservice in salesforce so that it is being consumed from SAP. So, when a sales order is created in SAP, it would call the salesforce webservice and post the sales order details and ...
2
votes
1answer
36 views

Dynamic Type Casting of Inputs

I am using apex:input on a VisualForce page to take in a variety of input types. I store values separately for Dates, DateTimes and Strings, as they have their own input 'types.' However, for numeric ...
2
votes
1answer
54 views

Why is 'Data Type' not defined on my custom field?

Why is datatype not defined on my custom field (circled below)? And how can I define it?
2
votes
2answers
218 views

What datatype for time only? (without date)

What is the correct datatype for a field that represents a time of day for a recurring event? I'm building a class enrollment system (for a hypothetical university, as a school project), and I need ...
2
votes
1answer
313 views

How to get DataType in Apex

I am using utility class methods which are called in test class to populate all fields of say XYZ object.But i have a field in XYZ object which is formula field. As it is read only i would not want to ...
3
votes
1answer
53 views

What is the max number of characters are allowed in a Phone field?

What is the maximum number of characters allowed in a field set with the Phone type? The online documentation that I found only says: Phone fields contain phone numbers, which can include ...
7
votes
2answers
611 views

Some boolean values are 0/1 and some are true/false

What are the standard values for boolean datatype? I have two columns like below in different tables. One table has values like 0 and 1 and the other table has true and false. I need this to set a ...
6
votes
1answer
94 views

Why was OwnerId deleted when custom object was refactored with Master-Detail(Account)?

Simple question, but conceptually I do not understand why Salesforce should want to enforces this policy. We created a custom object, loaded some data to it and selected a user as owner for the ...
7
votes
1answer
545 views

Importing string typed data into an sobject

I have a relatively large Map<String, String> which is basically a key/value map of sobject field names and their values. Obviously, all the values are strings, but fields are not (there are ...
5
votes
5answers
6k views

How does Static variable and Static method works

I read in salesforce documentation - Static variables are only static within the scope of the request. They’re not static across the server, or across the entire organization. Can any one ...
1
vote
1answer
697 views

How to set the value of a currency field from a formatted string

In apex, how would you set the value of a currency field with a formatted string? See the sample code: String price = '$1,000.00'; MyObj__c obj = new MyObj__c(); // this line won't compile, so ...
1
vote
2answers
662 views

Pass parameters to constructor when using System.Type.newInstance()

I have created an Apex InterfaceFactory that the user can use to get an instance of a specified implementation of an interface. For this I use the System.Type class. The actual name of the class can ...
7
votes
1answer
2k views

Can you convert a Master-Detail relationship to a Lookup if it's referenced in code?

I've got a Master-Detail relationship on a custom object where the parent is the Account object. There are no roll-up summary fields on the Account object, and there are no formula fields on the ...