Questions tagged [data-types]
The data-types tag has no usage guidance, but it has a tag wiki.
93
questions
0
votes
1
answer
44
views
Attendees Field on Event object is null in backend
In my use case I would like to grab all event where a certain user has been added as an attendee for the event.
When I do get records in the flow and I actually get null value in the Attendees field ...
0
votes
0
answers
90
views
DATETIME Field value doesn't show in Lightning-Record-Edit-Form
I have a problem with visability of Date/Time values in Lightning-record-edit-form.
This is my code:
<lightning-record-edit-form object-api-name="Event_Calendar__c" onsuccess={...
0
votes
2
answers
462
views
Strings holding exact same value still returning false when compared
I have 2 string variables. One of them holds data retrieved from custom metadata and another is explicitly declared. Both return exact same data when debugged, but still if I compare them, it returns ...
0
votes
0
answers
151
views
Unexpected token 'Boolean'
Hey guys I'm new to Apex and even pretty new to Java, It's probably a stupid mistake but I can't figure it out. I am getting "Unexpected token 'boolean'." error , tried with both Boolean and ...
1
vote
1
answer
206
views
Is this expected behavior: Integer vs Long in Apex
I ran this code snippet in anonymous apex:
Integer slaM = 60000;
Long L1 = 60000 * slaM;
Long L2 = 60000 * (long) slaM;
system.debug ('L1: ' + L1 + ' /L2: ' + L2)
Here is the debug output:
DEBUG|...
0
votes
1
answer
65
views
When display type of field can be integer or long?
I am building a managed package for our clients which include custom filter and custom sorting of records, I need to consider different cases regarding to field types and display types.
I know that ...
0
votes
1
answer
1k
views
Pass SelectedRows from LWC Datatable to Apex
I'm still very new to Salesforce/Apex development but I'm struggling to understand how I would pass the SelectedRows of a datatable through to Apex. I've managed to pass simple data types through on ...
0
votes
1
answer
406
views
How do I create a custom field which contains multiple data type?
I want to create a field with a question (e.g. How was the service of employee x) and allow the employer to pick a result (e.g. good, average, bad) as well as to add comments. However, while i believe ...
1
vote
1
answer
430
views
Data Transformation from mutli-select picklist to array of number in a flow
I have a multi-select picklist field that I need to transform to an array of number to use in a API. How can I do this in a Flow?
Context:
I need to send the result of a multi-select picklist to an ...
0
votes
1
answer
387
views
Finding fields for standard data types
I've been trying to complete a challenge on trailhead (link here)
The text says
"Create an Apex trigger that sets an account’s Shipping Postal Code to match the Billing Postal Code if the Match ...
1
vote
0
answers
2k
views
Compare DateTime Fields in a Flow
I'm helping our Events team with a new flow that we're building. Within the flow, we're attempting to compare two DateTime fields with one another in order to execute actions based on the difference ...
-3
votes
1
answer
60
views
Illegal assignment from List<String> to List<Order> (4:21)",
Im having this issue which I dont understand. Any advice?
0
votes
1
answer
909
views
Trying to update country code in phone field with Workflow rule
Trying to update country code in phone field with Workflow rule.
In which rule will check the Country(picklist type) and add the country code before mobile number(Phone type) automatically.
Tried so ...
1
vote
1
answer
225
views
Declaration of Data Types Apex
I'm a new learner in Apex and I have a question about declaration of variables(A map in this case) and its Data type.
I've been working with integrations and REST callouts and spend a long time when ...
1
vote
0
answers
730
views
Query External Object filtering by Date or DateTime dataType
first time ever writing here, hope anyone can help me:
We're working with Salesforce Files Connect, currently configured and working with SharePoint.
Users can browse files by certain filters we're ...
2
votes
1
answer
730
views
Avoiding String.ValueOf on Map<String, Object> from JSON
I'm working on a JSON response that is a REST api call making a Query to another Salesforce Org.
Important points:
I'm trying to avoid using JSON2APEX if I can. So far I have had good success, and if ...
0
votes
1
answer
270
views
Address(home, a location on google maps, etc.) data type
How can I create an address data type?
On my Salesforce there is Billing address.
When I create a new account I see the billing address field and it show something like this.
How can I create new ...
0
votes
1
answer
269
views
How to define a interface datatype? [duplicate]
I was preparing for PD1 exam and came across the below sentence on interface in the developer documentation which I’m unable to understand. Can anyone help with an example as to what the below ...
2
votes
1
answer
93
views
Why does deserializeUntyped interpret Strings starting with digits as Integers
This code
List<String> ls = new List<String>{'32', '4text', 'text5'};
Object obj;
for (String s : ls){
try{
obj = JSON.deserializeUntyped(s);
System.debug(s + ' ...
0
votes
1
answer
155
views
Correct Datatype for new field - list of timestamps
I'm just doing this using the Salesforce Lightning GUI, not doing it programmatically.
I am creating a new field for a Salesforce object. This field will hold multiple datetime stamps. When an event ...
1
vote
1
answer
2k
views
Avoid exponential while converting Double to String
I was working with integration, where i need to send my internal data
to Core system. I have came across a strange issue while converting
large number(Double) into JSON.
Sales-force automatically ...
0
votes
2
answers
296
views
APEX Callout return type not always known, unsure how to adapt to different situations
I have an APEX callout that makes a call to a REST API and returns an object, in this case I am calling /services/data/v48.0/sobjects/Case/describe. I was trying to use this same APEX class to call ...
1
vote
1
answer
3k
views
Converting a Long Area Text to Rich Field Text
I am trying to convert a Long Text Area Field to a RTF but when I do so I loose all the formatting it just removes the HTML tags and makes the area a whole chunk. So what I am trying is instead of ...
0
votes
1
answer
917
views
Dynamically convert CSV field value into salesforce data type
I am trying to create fields dynamically based on the CSV data. All CSV headers represent the field name in Salesforce and rows represent the values. As all CSV values are in string format I have to ...
2
votes
2
answers
386
views
Deduce Schema.DisplayType from a sample of JSON property values
From a REST API my Apex is receiving a list of JSON objects with previously unknown properties. To store those properties I want to dynamically enhance a Custom Object by adding suitable Custom Fields ...
2
votes
1
answer
2k
views
Blob is not a Valid UTF-8 String - Only after "–" [duplicate]
I created a CSV parser that parses CSV's from static resources.
I am returned with a Blob is not a Valid UTF-8 String error when parsing the character: "–" different from "-". The "–" is apparently ...
0
votes
0
answers
43
views
On new custom field, how to setup a data type of Formula and output type of Checkbox?
Checkbox will come back as true if these employee conditions are met: are in the US, are full time, are active and have a start date after 1/1/2018.
No syntax errors, but the checkbox on Team Member ...
0
votes
1
answer
3k
views
How to dynamically set multiple choices to a picklist of a Flow Screen using a resource of type 'Choice'
Is there any way of dynamically setting multiple choices to a picklist of a Flow Screen using a resource of type Choice? It seems a collection variable of type Choice cannot be created nor can it be ...
2
votes
1
answer
2k
views
Inequality operator not allowed for this type: Object
When trying to compare any two arbitrary Object values to determine order, I get the following error.
Inequality operator not allowed for this type: Object
Below is sample code that will not ...
0
votes
1
answer
613
views
Data Loader error- (ID: value not of required type: 425.0.)
I'm trying to import a file with Data Loader into a Standard object and I get the errors as follow:
ID: value not of required type: 425.0.
The Data Type is TEXT in salesforce.
In the CSV import ...
0
votes
1
answer
2k
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
1
answer
877
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 ...
1
vote
2
answers
2k
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}...
1
vote
1
answer
8k
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:
//...
1
vote
1
answer
7k
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
1
answer
2k
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
1
answer
3k
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
1
answer
119
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
1
answer
35
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
1
answer
624
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
0
answers
160
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-...
6
votes
2
answers
589
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
1
answer
1k
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 ...
6
votes
1
answer
500
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
1
answer
4k
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
2
answers
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
2
answers
10k
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
1
answer
101
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?
3
votes
2
answers
6k
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
1
answer
240
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, ...