Questions tagged [database]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
62 views

How to apply inclusion and exclusion criteria when data extensions are linked by one to many relationships?

I have a contacts DE table like this: Contacts CustomerID CustomerName Country 1 Alfreds Futterkiste Germany 2 Ana Trujillo Emparedados y helados Mexico 3 Antonio Moreno Taquería Mexico 4 Around ...
  • 149
0 votes
1 answer
26 views

Create a global number sequence for Lead and Account

I want to create a global numeric sequence that works for both the Lead and Account object, because we will integrate Salesforce with an ERP that works with leads and accounts in the same object, ...
  • 16
0 votes
0 answers
12 views

Can I share the Leopard Shared MySQL plan among 3 free-tier heroku applications?

I have three free-tier heroku instances that I'd like to push the limits on with upgrading my database plan from the free tier to the next one up: Leopard. It says it is a shared addon - but I can't ...
0 votes
0 answers
78 views

Database.emptyRecycleBin and Empty your organization's recycle bin not deleting records

I'm trying to understand why records are not getting removed from our recycle bin. When I go to the UI and click 'Empty your organization's recycle bin' it doesn't appear to dump the data. Also ...
  • 889
2 votes
0 answers
132 views

Where is Database.query() spending (so much) CPU time?

My assumption was that only Apex Code is using CPU time. But the what I measure for code that is run by Salesforce's own Backend code speak a different language. List<SObject> result = Database....
0 votes
0 answers
42 views

App UI sometime fast and sometime slow. Are Database results cached?

I just started to performance analyze a very complex Managed Package app. I don't know a lot yet about this app besides that it has a complex data model with many fields, deep relationships very ...
0 votes
0 answers
75 views

Implementing autocomplete suggestion for record ids

The LWC app that I am currently working on has a feature that lets users fetch information for a record whose record ID is entered. I am looking forward to implementing a feature that proactively ...
-1 votes
1 answer
25 views

Trigger action values not updating in Database

I am new to salesforce and trying to play around with triggers. I have tried the trailhead exercise for triggers to set shippingPostCode from BillingPostalCode. Below is my code trigger ...
-1 votes
1 answer
52 views

SOQL: How to get the biggest value from a field and compare to a another on query?

I need to get the biggest value from field createddate and then compare this value to another date on a query/soql. I think about using "order by createddate desc limit 1" but I don't know ...
user avatar
0 votes
0 answers
268 views

how to find out total number of subscribers who were sent 1 email in last from in salesforce marketing cloud

I am trying to get a count of all subscribers (irrespective of BU) - hence I am running the query in parent BU who received ONLY 1 email in previous month. This is my query but it is not returning any ...
  • 149
0 votes
1 answer
490 views

Get record field after Error in Database.Upsert

I'm upserting some records using Database.upsert, after that, I'm supposed to get the errors and pass them to a custom logger. The problem is, the way this class works, I'd need to get a field value ...
0 votes
2 answers
346 views

Database class partial success can exceed governor limits?

I have a question about the partial success using database class. My question is, if i exceed governor limits. Will the whole transaction be rolleback or i'll have in the database the records that ...
4 votes
0 answers
192 views

how data in _open data view is recorded in SFMC

As of now, our understanding of data views is that data is mostly real-time. But is this true for all data views or only specific data views? if specific, then which ones? Recently, we noticed that we ...
  • 149
0 votes
1 answer
502 views

Difference between Upsert and Update database methods

Good morning. Database.update (fields , allOrNothing) Database.upsert (fields, externalId, allOrNothing) I need help to understand why the second parameter "externalId" is not necessary on ...
  • 39
0 votes
2 answers
57 views

What is the highest performance way to work with results in a List<SOBject> returned from Database.query()?

I have a custom object called Query_Definition__c that has two fields: SObject_Name__c (text) SOQL_Query__c (long text) Within Apex, the requirement is to take the record details from the ...
  • 167
0 votes
1 answer
531 views

Query based on variable field name

I would like to know that how can we search based on a custom field via a variable. For example, if I create a custom field Mobilephone for the standard object Account, then how can I search this ...
  • 45
1 vote
0 answers
103 views

Roll up summary field max value in database

I want to export Roll up summary fields to external system. What should be database column length. Should i use int, bigint or any other data type. I was just doing testing in my org and roll up ...
  • 3,345
1 vote
1 answer
518 views

Django Heroku: remaining connection slots are reserved for non-replication superuser connections

I recently deployed an app to Heroku using Postgres free tier as database. I am using Django 3.2 Everything was working fine until I started getting a mail with the following error: Internal Server ...
  • 111
0 votes
1 answer
176 views

Database.executebatch call in for loop causing Codescan warnings

I have a piece of code that is causing some codescan warnings and it is not liking the database.executebatch in the for loop. The thing is I am not sure to go around it My code: public with sharing ...
  • 275
-2 votes
1 answer
59 views

How can I consume a SQL database to create / update records in salesforce using apex? [closed]

I would like to consult you for something, do you know if it is possible that a sql database can be consumed from salesforce? What happens is that account records are loaded into the SQL database and ...
0 votes
1 answer
25 views

Is there a database method other than oData?

I wonder if there is a database and method other than oData. I wonder if there is a way to connect in real time like oData rather than importing a csv file.
1 vote
1 answer
850 views

How to compare the Database.Error getStatusCode() value against a string (In a clean way)

I have the following code which uses string concatenation to check the err.getStatusCode() if (err.getStatusCode()+'' != 'ENTITY_IS_DELETED'). My question is, if there's a cleaner/better way to do ...
  • 724
0 votes
1 answer
576 views

" Error: Could not establish connection. Receiving end does not exist." when trying to create object record

I am trying to insert record in Salesforce after a button click but I receive this error when clicking on the button. Below are provided my JS and apex class for the handling of this operation. No ...
0 votes
2 answers
201 views

Using Apex class in salesforce community site

I'm working on a very simple project that uses google books API and I have a problem. I want to save all search history in an object in database and all works fine when I'm logged in my account and ...
  • 47
0 votes
0 answers
73 views

Get Campaign name from _Sent dataview [duplicate]

I downloaded the _Sent dataview to my server. Now I need to join the _Sent data with the campaign names to filter. How can I get from the _Sent dataview to the campaign name?
0 votes
1 answer
34 views

StandardSetController Pagination problem when use WHERE

I try to make pagination for my table. When selectList change i take Id and want it in my Database Query, but if i add Where to soql the table isn`t displayed. My variable carId is null into if(setCon ...
0 votes
2 answers
280 views

Unable to Merge two account and giving the "Database.MergeResult = Invalid field IsCustomerPortal for merge;MERGE_FAILED;"

private static void DuplicateAccountMerge(List<Account> triggerNew) { try{ // Merges a new Account with an existing Account based on matching email addresses. // Old ...
4 votes
3 answers
2k views

how to make sure update contact step in journey builder honors primary key?

I am trying to create one Data Extension that can be used to log all contacts going into multiple journeys and then use update contact event within journey to update row when a contact exist journey. ...
  • 149
0 votes
1 answer
228 views

Access Contact fields from Opportunity object

I'm showing up with another problem: I'm building a VF PDF page based on Opportunity object and I want to add a paragraph that shows all contacts related to this Opportunity. My approach was as ...
1 vote
0 answers
217 views

Database.merge - error "Invalid field IsCustomerPortal for merge"

I'm trying to merge accounts in apex using database.merge - Getting error "Invalid field IsCustomerPortal for merge". This field is available in Account object. The org do not have customer ...
0 votes
0 answers
34 views

Api Integration Issue

I have created an api integration in salesforce. From client's website a request will send to Salesforce in form of JSON. This will create record in Salesforce. Sometimes multiple requests are sent ...
  • 1
3 votes
2 answers
471 views

How to rollback DML after catching exception in unit test

I have a custom business logic that will block certain profiles from editing/creating/deleting an account. Because of other requirements, mainly around Record Types, I can't use profiles and ...
  • 175
1 vote
0 answers
28 views

Heroku & Salesforce - Database question for multiple environments [closed]

Along with our production org, we have 3 full sync sandboxes, Mule APIs and Heroku. We are in the process of setting up an app, which is really just going to hold a postgreSQL database that is written ...
  • 123
0 votes
1 answer
187 views

Setting up MC with dedicated db

We have a new MC account we would like to start setting up. We have purchased a dedicated db sku for this account. Are there any implactions or things we should know while setting up this new MC ...
  • 173
2 votes
1 answer
159 views

What would be an ideal use case where you would use sObject.addError() over savepoints and rollbacks?

I came across two methods of preventing errors while inserting, updating or deleting the records in salesforce. Let's say I am performing any one DML operation, and I want the transaction to stop if ...
0 votes
2 answers
109 views

Can two email messages be inserted at the same time with email to case?

I am setting up a trigger for when email messages are after inserted and we use email-to-case. Is there any way that the email-to-case inbound or normal sf outbound message system could result in two ...
  • 1,941
1 vote
0 answers
193 views

Database.saveResult showing only one error at a time

I am trying to write an apexrest service that takes in fields for the Opportunity Object. There are certain restrict picklists on the Opportunity object that I've created. Additionally there are other ...
  • 313
0 votes
1 answer
125 views

Multiple contacts for a single person? [closed]

I'm integrating Salesforce with a system that will act as the source of employee records. In the source system, each employee human can be represented by multiple employee records - one per ...
  • 2,092
3 votes
0 answers
469 views

Reliable Salesforce JDBC to be used with DataGrip

Do you recommend any particular JDBC for Salesforce (can be paid) which is reliable enough to be used for commercial purposes along with DataGrip (or similar) software? I've been checking similar ...
0 votes
1 answer
1k views

How to use insertAsync with processSave

I am trying to understand how insertAsync(sobjects, callback) works with processSave(saveResult) I went through the following two documentations, but couldn't find an example anywhere https://...
  • 1,165
2 votes
1 answer
1k views

Salesforce DB query cache (how long?)

How long does Salesforce keep results of a query in its internal database. We know that the first execution of a query takes the longest. Subsequent queries are much faster due to the caching ...
  • 29
1 vote
1 answer
225 views

How can I find problematic records in a dml action?

Let's assume I have a list of 100 new records that I want to insert, 10 of these records are missing information which will result in DML exception. Is there a way for me to create a list and include ...
  • 1,497
1 vote
1 answer
2k views

Throw a DML exceptions in Apex Batch Class for testing

Below is my batch apex class that updates Account object for example: global class abc implements Database.Batchable<sObject>{ global Database.QueryLocator start(Database.BatchableContext ...
  • 4,631
3 votes
2 answers
536 views

Deleting Big Object Workaround Without Using Database.deleteImmediate

Known Issue for not being able to deletg Big Objects with database.deleteImmediate still open. This is the only method mentioned in docs to do this. Workaround to delete 1 X 1 is a joke. Any other ...
  • 1,474
2 votes
1 answer
414 views

Salesforce Relational Database ACID

I was reading about relational databases and found that Salesforce is built on Oracle's Relational Database. Based on my understanding, Relational Databases "promise" the following ACID principle: ...
  • 43
0 votes
1 answer
156 views

Database Apex class benefits [closed]

The pros and cons of using Database apex class oposite to SOQL direct queries or DML - in which cases we should use database class?
  • 737
0 votes
1 answer
390 views

Accessing data of Sandbox from Scratch Org

I want to be able to query, insert and update records of a Sandbox from a Scratch org, only during the development phase. I know that scratch orgs are meant to be populated with just a little amount ...
  • 143
2 votes
2 answers
59 views

SOQL - Best practise : what method choosing while retrieving datas?

There are multiple ways of let's say instanciate a list of contacts using SOQL ; My question is : is there a difference between each other, and is there a best practise ? Examples String name = '%a%'...
0 votes
2 answers
2k views

Does Database.Update(records, false) roll back the failed records?

If I call Database.update(records, false); will only the failed records be rolled back or will there be no rollback whatsoever? Imagine this scenario, record is updated, kicks of an insert (inside ...
  • 170
2 votes
2 answers
4k views

Database.Query does not return fields with null value

Hi i'm executing this query using Database.Query(query) Where query is SELECT field1__c, field2__c, field3__c FROM Object1__c On the current record, field3__c is NULL but when i query on the ...
  • 39

1
2 3 4 5