Questions tagged [database]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
3k views

ExactTarget | Quering users from multiple Data Extensions

I'm trying to get a query on several fields that are in 2 Data Extension Tables (the matching content is SubscriberKey). I'm familiar with SQL, but I used it primarily creating lists in Oracle's ...
0
votes
1answer
433 views

Database Class and DML in a transaction

According to the official document - https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_transaction.htm I understand that if there is any error in a transaction ...
0
votes
0answers
72 views

Problem with database.query() in APEX REST @httpput method

In APEX REST @httpput method, after DML is done on newKas, saved record having different value in Article_Title__c instead of fetched article title field value from database.query() method. @HttpPut ...
3
votes
2answers
295 views

External SalesForce Forms

Is it possible to create external SalesForce Forms that can populate fields in the same way as inside salesforce? We offer online teaching and the idea is that teachers, after every lesson, can fill ...
1
vote
1answer
172 views

Is there a tool to view an organisation's schema outside Salesforce? [duplicate]

For example, if I want to have an image with all the tables and relationships in my organisation, I would have to manually look for every object/field/relationship and build it myself in an external ...
0
votes
1answer
39 views

Is it possible to generate Leads from my database

I am using a form on my site to add new leads to a MySQL database. Is it possible to generate my leads in Salesforce from my existing database?
2
votes
2answers
1k views

How to remove deleted records from salesforce database memory?

3 days back I have created a report in my org and after some times I deleted that record ..even i deleted report from recycle bin as well Now it's been 3 days still that report present in salesforce ...
0
votes
1answer
94 views

Using created records to generate Attachments on the same call

I am creating records and using these records to create PDF Attachments (both are happening in the same call). As shown below: List<ResellerRevenue__c> resellerRevenues = new List<...
1
vote
2answers
612 views

Put value of a field other than ID from list to set

Below trick works for only ID field, but if I need a field other than ID field? List<SObject> results = Database.query(someSOQL); Set<Id> resultIds = (new Map<Id,SObject>(results))....
0
votes
3answers
662 views

Translating Data using Apex Triggers

I am trying to import a database that have numbers in the picklist value. (1,2,3,4,5..etc) However, in the user-end, they should see different set of values, for example ( 1.-> Partner 2.->LLC ...
2
votes
2answers
7k views

Salesforce database structure for sales cloud and service cloud

Do any one here have any doc related to database model of salesforce. Model of sales cloud and service cloud. I go through doc which salesforce have https://www.salesforce.com/us/developer/docs/api/...
0
votes
1answer
111 views

Data backup in salesforce

Data backup in salesforce I need to develop an Apex script to backup all the database data every day. Is there an optimal way to do that? What could be needed to be done if pictures or pdf files are ...
1
vote
1answer
729 views

Is there a way to create a master-detail to the Campaign Member object

TLDR; Is there a way to build a joint object between the campaign member and account objects? If not, what are some other methods to design the SFDC database to capture the specific individuals that ...
0
votes
1answer
115 views

Java - like Apex for SOBJECTS

Sorry, I don't know if this is a proper context to make this question, but I don't know where to make this question. I write here because I immagine that a lot for today apex programmers has been ...
2
votes
1answer
277 views

What is 'external data' in Database.deleteAsync(sobject) salesforce documentation

While going through the Database Class documents I couldn't understand few definition. deleteAsync(sobject) Initiates a request to delete the external data that corresponds to the specified ...
2
votes
1answer
102 views

Capturing record events without triggers

Is there any way other than Apex Trigger/Process Builder/Workflow to capture record events programmatically? Does Salesforce have any sort of CRUD event publisher that can be somehow subscribed to? ...
0
votes
1answer
579 views

Accessing field dependency values in the back end

On our UI we have two picklist fields where we provided field dependancy. On the front end we can see these dependancies. Now at the backend there will be a table to store these values. I would like ...
4
votes
3answers
2k views

What are the options for Data Storage size in salesforce instance is reached or near limit?

Hi All please share your experience related to Data Storage size in salesforce instance is reached ? Did you increase data size from salesforce (quite expensive option) or any other option like delete/...
1
vote
1answer
620 views

How to call QueryLocator.iterator() twice

I am using a QueryLocator in my code. In one part of the code I call the .iterator() method to verify that it is not empty. Now I am going through writing a unit test and finding that I am unable to ...
0
votes
1answer
29 views

Test class running through an if statement

I have the following code in one of my batches: if (exclusionsize == 1){ exclusion1 = exclusioncut[0]; System.debug('Preforming the Query: ' + 'select ' + TrackingNumberString + ',...
1
vote
0answers
321 views

Get complete list of Forecast Categories & Labels

I'd like to programatically (in Apex or SOQL) get the full list of ForecastCategories and their corresponding ForecastCategoryNames for an org i.e. the list that you can access in the UI by navigating ...
2
votes
0answers
71 views

What is the salesforce equivalent of Microsoft's Northwind database

This sounds like an obvious question but I have not been able to find the answer anywhere. Does Salesforce have an equivalent of Microsoft's Northwind database? My problem is that I have gone ...
0
votes
1answer
37 views

Work order data need to be stored in SalesForce databse

I need to save custom data(Work order related data) into sales force database. I need to have a service for this the same will be called in my SOA application. What database API i have to use to store ...
2
votes
1answer
46 views

Checking Database state before updating a record

Is there anyway to check the current database state (version or whatever applicable term) of a record, before performing DML on that? Scenario : user 1 retrieves record A user 2 retrieves record A ...
2
votes
2answers
159 views

I'm building a database in unlimited version but I think i'm doing this wrong

I think I did this wrong? Can someone advice me? I basically paid a $250 month unlimited service to build a database but I would like to sell it on appexchange. So as I build, I realized that I ...
0
votes
1answer
428 views

Setting database.savepoint in one method and rolling back in another method

I have three objects ObjectA, ObjectB, ObjectC. ObjectA is the grand parent, ObjectB is child of A & Object C is child of B. I'm providing a button on ObjectA page layout to create/edit records ...
2
votes
2answers
2k views

execute apex batch only if not running

I have below trigger where I am executing a batch apex. I need to see whether the batch job is currently not running. Can someone help me here? Apex trigger: trigger BatchTrigger on ...
2
votes
1answer
4k views

How to get data type of any object's field in SOQL

how to i get datatype of any filed in SOQL?
2
votes
1answer
43 views

Do we have a Salesforces global database for all clients that installed my package?

Please help me with this question and please correct me if I misunderstand anything. I am developing a package, in this package, I created some custom objects. I also have my external Web Service and ...
1
vote
1answer
53 views

Accessing Data Externally - Any tools?

Bit of a back story... We have a business requirement where out of a team of 50 people only 20 need actual SF licenses. The other 30 only need access to a very small portion of data and only need ...
19
votes
1answer
2k views

How to best use the “Test Data Builder” pattern in a database context?

I need to setup test data in proprietary cloud platform (Salesforce.com) where I have no access to advanced testing frameworks. Besides that you can read my code example like it would be Java. ...
3
votes
1answer
566 views

How to know which Database.SaveResult instance corresponds to my SObject

I am currently trying to Update and Insert to collections of SObjects. I perform the actions(update&insert) separately, obtaining a Database.SaveResult Array as feedback. The problem is that I ...
2
votes
1answer
69 views

How create new database for testing

/** * Get template folder */ public List<SelectOption> getFolderList() { // Initialize a selectoption list List<SelectOption> options = new List<SelectOption>(); // ...
2
votes
2answers
419 views

Salesforce Mirrored To mySQL - Reporting Tool Suggestions?

We are setting up mirroring our Salesforce to mySQL using CopyStorm. One object in particular will be mirrored with no deletion (all data ever will accumulate in mySQL while in Salesforce it will ...
3
votes
0answers
113 views

How can we keep our tasks accessible to view and report on while not having them count against the data storage limit?

The org I am working with right now is using 210% of its allotted data storage. Most of the storage space is taken up by tasks (over 31M records). Is there a way to decrease the data usage while ...
1
vote
3answers
152 views

Custom Save on New/Edit page - Is this valid code?

In my controller extension I have a custom save method that works for New and Edit scenarios also saves modified child records The below code works in all unit tests but starts to show strange ...
2
votes
1answer
411 views

Is upsert the right thing to save new or existing records?

In many of my Controller extensions I have save action methods that work for NEW and EDIT scenarios. I simply use upsert record instead of update / insert record in such cases. But now I am running ...
1
vote
1answer
65 views

'<<<' characters are lost in a field after saving to the database?

I have a field on a custom object before saving to the database as below: <span>>>> just some text <a class="Link" href="/55555555555AAA" >John Travolta</a> <<<<...
4
votes
1answer
920 views

Database class commit

Why does Database class not provide commit method so that we can commit explicitly as well while in a transaction as we can do a rollback.
2
votes
1answer
960 views

Storing json as a String field is giving wrong value

I have been developing an Apex Trigger where I build a json string from an incomming Event. What I do is serialize the event into the json at first, then deserialize it as a Map and add to it some ...
2
votes
1answer
353 views

Database.rollback() risks and alternative

I've inherited some complex logic that does several different DML actions within the same (fairly long) method and if there are failures I need to revert everything that's been previously done. The ...
4
votes
1answer
1k views

Can Salesforce function as a “data warehouse?”

I am attempting to integrate on-premises software with our Salesforce Org. Our timekeeping system uses a PostgreSQL database to store time entries committed by staff. Salesforce's role is relegated to ...
0
votes
1answer
109 views

Inserted records have lifespan only within current Visualforce page

I have a VF page which dynamically inserts records into a custom object. To debug the problem and ensure the records have been successfully, I reloaded the inserted records after the insertion. The ...
7
votes
1answer
349 views

Database.DMLOptions - How to prevent Chatter Group Auto-Follow trigger from generating email

Currently I have a trigger which auto-follows specific groups in our organization when a new user is brought onboard. The auto-follow trigger feature works great! However, we have quite a few groups ...
3
votes
2answers
16k views

Problem with Database.update()

I have some accounts to update but some validation rules can failed. So to avoid this I use the Database.update() function to update accounts even if some DML exception occur. try { List<...
2
votes
1answer
1k views

Database.DeleteResult.getErrors() question

I am trying to connect specific records that fail to delete in my batch job to their error messages. I thought my solution was working, but I checked the size of .getErrors() and it's size 1. My test ...
15
votes
1answer
944 views

How can adding a Subselect make a SOQL query non-selective?

I have a SOQL Query with subquery that fails to execute because it is non-selective. I don't understand why and cannot interpret the results. All I know is that tearing parent und sub query apart ...
2
votes
3answers
439 views

Backing up sf data in external DB [closed]

Hi I need to back up my sf org data into my local database. I am looking out for tools or any best practices to this at specific time intervals or regular time intervals. Can any one suggest what ...
1
vote
2answers
352 views

Tally the number of items in a related lists on a related object

Hi guys I am a complete n00b with SalesForce.com, so please forgive me if my question is too basic, but I have been trying for about 2 days now and I feel like I am getting nowhere I have a database ...
0
votes
1answer
1k views

Database Save Results, Map.values() and maintaining order

Maybe because it is Friday afternoon, but I feel like I am missing something obvious here. I am trying to work out how I can refer back the errors from a database.insert to the key in my map. So I ...