Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [data-types]

The tag has no usage guidance, but it has a tag wiki.

0
votes
1answer
17 views

Changing field type from Checkbox to Formula(Checkbox)

I have read that change in field type would result in data loss. I have a custom field which is of type checkbox and has around 200 records. Now, I need to change this field data type to formula (...
0
votes
1answer
42 views

Ampscript function to remove the comma from a number greater than 1000

I have an API call that is passing over what should be a number as a text field. If the number is over 1000, the value is being sent with a comma (e.g. 3,000 instead of 3000). Salesforce will not ...
0
votes
1answer
26 views

Why does number field comes as Decimal type even if Decimal places is 0 in field definition

A very basic question. We define a number type of custom field and try to fetch it in apex. After this suppose I write following code : Set<Integer> validCounts= new Set<Integer>{1,3,6,9}...
0
votes
1answer
83 views

Salesforce doesn't save percentage fields as a decimal between 0 - 1?

Question about percentage fields in Salesforce. I know salesforce is saving these values as double precision. However, it seems the value saved is a whole number > 1 instead of 0 For example: //...
0
votes
1answer
234 views

String ('yyyy-MM-dd') to date using date.parse returns ('yyyy-MM-dd hh:MM:ss')

I am trying to output a date type with the format yyyy-MM-dd, but. not as a string type. I can create the string just fine. // First I output 2018-12-01 00:00:00 as a date currentDate = Date.today()....
1
vote
1answer
133 views

Lightning Component integer attribute not matching javascript integer

I have an attribute of type integer. <aura:attribute name="selectedRowNum" type="integer" /> I also have an iteration component in which I get the index of the current object that is being ...
1
vote
1answer
103 views

Custom field datetype with month and year only

I'm trying to credit a custom field which only need month and year (like credit card exp date) I choose datetype date, when creating the field, but it also needs a date as well. How can I create a ...
0
votes
1answer
25 views

Change Data Type

I have a field in production number_of_requests__c type Number (18, 0), the entered data is copied (on save) to another field number_of_case__c type Number (6, 0) of another related object. In the ...
0
votes
1answer
20 views

How to put a specific account as default value on Lookup(Account) data type?

I don't know why this kind of option is not available on lookup field in Salesforce . What I need is to retrieve some information details from a specific account . Is there another way to proceed ?...
1
vote
1answer
67 views

Help understanding data types, and how data space is consumed [duplicate]

Note I have updated the question with more info to explain why it is not a duplicate. Changes are in italics below. I'm pretty new to Salesforce but come from a .NET/Sql Server background. So I am ...
1
vote
0answers
95 views

What deep magic exists in Apex and can we replicate it? [closed]

When reading Apex code, there are at least two instances where SFDC is doing something more than the is immediately apparent given the syntax of the code, both of which somehow relate to SOQL: SOQL-...
4
votes
2answers
174 views

What are the risks or drawbacks of creating Parameterized Interfaces using of the Apex API version 25?

Unfortunately, as of API version 26, SFDC removed parameterized interfaces. However, it is relatively easy to create new interfaces and set the version as 25. So, to take the example from ...
1
vote
1answer
41 views

Why does a variable of blob type, when printed gives out it's size?

String str = 'myString'; Blob b = Blob.valueOf(str); System.debug(b); System.debug(b.size()); System.debug(str); Here if I print str then the value of str(I believe it is usingvalueOf()method ...
5
votes
1answer
153 views

Apex differentiate between Lookup field to master detail field

Is there a way to differ between regular Lookup field to a MasterDetail field? When calling to getDescribe() on a field both of them holds the type of REFERENCE. EDIT: After further investigation, ...
5
votes
1answer
839 views

Apex differentiate between RichTextArea, LongTextArea and TextArea

When calling getDescribe() on a custom field I get the field data. Although, I need to know when the field is Text Area (Long), Text Area (Rich) or just TextArea. When seeing the result from ...
10
votes
2answers
1k views

Unfamiliar Syntax

I came across the following code online: @future(callout=true) public static void runWarehouseEquipmentSync(){ Http http = new Http(); HttpRequest request = new HttpRequest(); request....
0
votes
2answers
2k views

How to convert number into currency field?

I am trying to update currency field with number field in a Process builder. However i get an error data type mismatch. Is it possible to do type conversion here. Please let me know.
1
vote
1answer
29 views

Is SoapType.Decimal a valid value?

Documentation for SoapType enum does not list Decimal as a member. But it's possible to compile a class which uses SoapType.Decimal. Could this be a problem if we use such code in a managed package?
2
votes
2answers
1k views

Increase length of custom text field when the field has data

I have a custom field on a custom object having text length 50. This object already has about 10K records. My requirement here is to increase the text length to length 255. But I am not sure if I do ...
0
votes
1answer
78 views

How do I find a the max length of a Combobox?

I'm creating an application that pulls down some records into a SQL table. The application recreates the table if it detects any changes to the Salesforce schema. For string-like datatypes (picklist, ...
0
votes
0answers
634 views

Can't deploy a field after changing it's type from Text to Picklist

I'm facing a problem on changing data type of a field from TEXT to Picklist. To avoid any loss of data I took an export of data of the related records on the target org and have updated the field with ...
1
vote
1answer
1k views

What type of data for the field Phone in apex

In a visualforce page I have an input for the user to enter his phone number : <apex:input value="{!newPhone}" type="tel" StyleClass="small" html-placeholder="Téléphone *" required="true"/> (...
0
votes
0answers
160 views

JSON or Mutli Dimensional Array (Map<String, Object>) To URL Parameters

What's the simplest way to take an object of variable structure and convert it into a URL? I'm looking for the Apex equivalent of jQuery.param(array) in JavaScript or http_build_query() in PHP. Here'...
12
votes
2answers
3k views

What is the difference between (Id)str and Id.valueOf(str)?

Say I have one string String strId = 001xa000003DIlo and I want to typecast it to an Id. So I have two options to do so: Id idVal = (Id)strId; Id idVal = Id.valueOf(strId); Which is the best way to ...
0
votes
1answer
771 views

Text Wrap:Splitting of String at new line(\n)

I have following Data type Order_Description__c (Long Text Area(32768) ).We are trying to wrap this data type at new line characer. Input Data: Long text area as a Order_Description__c field is: ...
2
votes
3answers
454 views

In “Getting Started with Apex Triggers,” “Adding Related Records” are the types wrong?

Looking at their code, it seems to be the type should be Map<Id, List<Id>> or Map<Id, List<Opportunity>> but they have Map<Id, Account>. When I tried to run the code in ...
0
votes
3answers
236 views

Effects on Deployment of Changing the Data Type of Custom Field when Reference by Apex

I have text area field which is limited to 255 char only but the new requirement asks that this field's limit be increased. So I commented out all apex that references to this field, tried changing ...
2
votes
2answers
609 views

Insert or update records dynamically through SOAP API's Partner jar

I am working on inserting CSV records to Salesforce. I usually do using Bulk API where the types are auto detected and mapped. However, I got into a scenario where I have to upload Documents or ...
1
vote
2answers
296 views

Time Data Type and not Time Date

I'm trying to allow time only for data entry. I want to avoid as much apex and visualforce as possible for this project. I can certainly do it but I'm trying to keep this full configure for this ...
6
votes
2answers
374 views

Why do primitive variables behave differently than object variables when being passed through void methods?

I’ve noticed that the contents of an object variable can be altered when the variable is passed through a void method, while the value of a primitive variable cannot be. For example, the following ...
0
votes
1answer
558 views

Need to find whether my time stamp is between the business hours

I am trying to implement SLA for Lead management. So handling all the SLA functionalities on a trigger and Apex class. I need help in getting the current time and comparing it to the defined ...
10
votes
1answer
926 views

What is the correct JSON/Apex Strategy?

Summary I'm having a lot of trouble deserializing a JSON file into apex. The problem is not in how to deserialize a JSON string, but rather what type of apex objects I should be using. I don't come ...
1
vote
1answer
3k views

Change datatype from Text to Text Area(Long)

I have a requirement where a text field char size(255) is not sufficient and I have used that text field in various codes. If I change datatype from Text to Text Area (Long) will my other ...
-1
votes
1answer
526 views

Can I change the datatype of a field Caller Street from text to picklist will the value in that field be lost?

Can I change the datatype of a field Caller Street from text to picklist. Will the previous data be lost Please suggest
2
votes
2answers
554 views

How To Increment Datetime by Decimal?

I have a packaged application installed in my salesforce which sends the Service Duration (Number Data Type) = 3,600.00 and another field Scheduled Date Time 12/21/2015 2:00 PM (DateTime Field Type). ...
2
votes
1answer
798 views

How to parse the ENUM value

How could we pass an get a value from an enum inside a method. According to the below code snippet, how could I pass the value of the parameter to severity__c in Note__c instance?? enum severity {...
4
votes
1answer
439 views

@InvocableVariable of List datatype

I'm building an Apex action for Process Builder and would ideally like to pass in a list of strings as an @InvocableVariable. Per the SFDC documentation, "The data type of the invocable variable must ...
2
votes
1answer
186 views

Visual Flow screen with data type conflict between text and picklist

I created a flow where I reference a picklist field in a screen. The field in the screen "Tipo_de_Contrato2" is Choice Type "Dropdown list" and Value Data Type "Text". I associated a choice, "Tipo", ...
6
votes
1answer
1k views

Return different data type using only one method

Is it possible to make an apex method wherein you can return different kind of data type (e.g. Integer, String, Double, etc.)?
3
votes
1answer
84 views

Change sObject field type and deploy using API

In this thread, there is a discussion about modifying a custom sObject's type. When I try to change the field's type in the Salesforce UI, I can see an error message with some references to the code. ...
2
votes
3answers
2k views

Concatenating address field in formula

I don't know if the subject resume my problem . I would like to display in my HTML page the name of Supplier with adress . on HTML something like that : <span> Supplier Name <br/> ...
8
votes
1answer
2k views

Boolean.valueOf(x) vs (Boolean)x

Is there any reason to use one over the other? Efficiency? "gotcha's"? I am working on a major code cleanup, and my org is littered with both types, so as I'm going through, I'd like to standardize,...
1
vote
1answer
148 views

Get Type of Apex Components

I need to dynamically create Apex Components. I know that there is method Type.newInstance that can do it, but one problem seems like I can't get Type variable from Apex component. For example: Type ...
0
votes
1answer
2k views

Address Field in Salesforce

I want to have an address field on Opportunity.I know there is no Address data type.How to achieve something like a Standard Address field like Account's Billing Address. https://success.salesforce....
1
vote
1answer
323 views

How to change the Event object Description Field type to Rich Text?

As the question says, I would like to change the data type of the Description field on Event Object? Currently it is Text Area but we would like to change it as Rich Text Are as we have some html ...
1
vote
1answer
434 views

Convert an array of ids to a csv string with quotes

I have a webservice method that takes the $_REQUEST from the URL parameter of my app and I believe handles it like an array, for example: inputs.param1 = "some_value" inputs.param2 = "1209845, ...
1
vote
1answer
827 views

Convert Custom field type from text to lookup/master-detail in salesforce

I have created custom field with Text data type..For some reason I need to change the field type to a look-up/master-detail relationship. But when i click on "Change Field Type" button for that ...
7
votes
3answers
8k 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
3answers
6k views

Reading Long Text Area field with line breaks

I have long text area field, which has data on each line. I am populating a line then hitting "Enter" and then populating the next line and hitting "enter" again and so on. When reading this field ...
5
votes
3answers
2k views

Getting a type of the generic object

How to get a type of the generic object? I have a method that gets as parameter some object. It can be realy everything. In my example it is a list of strings. But it can be a map or set or some other ...