Skip to main content
13 votes
Accepted

What is the value of the first and final record id for an object?

Most of what you need to know is covered in What are Salesforce ID's composed of? In short, only the last 9 characters of the ID are incremented from record to record. E.g. 0010a0000000001 to ...
Daniel Ballinger's user avatar
7 votes
Accepted

Set record type when creating an object without using RecordTypeId

There's not any way (at least, not that I know of) to completely take the recordTypeId out of the equation, but there is a way to use the record type's name to get at the appropriate Id. Specifically,...
Derek F's user avatar
  • 63.3k
6 votes

Is it possible to update an existing opportunity in Salesforce using apex SOQL query?

No, SOQL (Salesforce Object Query Language) is a query language. It allows you to pull data from the database. If you want to push data to the database, you use DML (Database Manipulation Language) ...
Adrian Larson's user avatar
  • 151k
6 votes
Accepted

How to check that SObject field is present in SOQL query

There is a new method on sObject(as of Summer 16) for this: getPopulatedFieldsAsMap() https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm#...
Aidan's user avatar
  • 13.9k
6 votes
Accepted

How to make custom object record only visible to certain users based on field checkbox

Set sharing on the entire object to Private. Add the two users to a Permission Set that has View/Modify All on the object. Add a criteria based sharing rule that shares records with Private = FALSE to ...
Charles T's user avatar
  • 11.1k
6 votes
Accepted

Can an object record's id repeat?

They are created consecutively, not randomly, per salesforce instance (e.g. na3 will have its own pool of numbers). Within a single org, the ID values will never be duplicated, and even all throughout ...
sfdcfox's user avatar
  • 500k
5 votes
Accepted

Get record id in lightning component which was added to a record page

You implement the force:hasRecordId interface on your component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId"> From there, you can get the ID at any point: ...
sfdcfox's user avatar
  • 500k
5 votes

How to make custom object record only visible to certain users based on field checkbox

You can't do this with a simple permission set. You have to set the sharing model to private and use sharing rules to control the access. Modify All The Modify all permission can be applied in a ...
gNerb's user avatar
  • 9,568
5 votes
Accepted

How to update a package in test environment after I changed it in development environment?

Presuming the installed version was already a Release version, simply upload the new version as a new Release version, and install it in the test environment. The changes will be applied as an upgrade....
sfdcfox's user avatar
  • 500k
5 votes

Notes & Attachments Cant find using soql

In Spring'16 release Salesforce introduced Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments in Salesforce Files Settings: Files that you ...
hpmacugay's user avatar
5 votes

Set record type when creating an object without using RecordTypeId

You can use the name directly without a describe call: Object__c record = new Object__c(Name='Demo', RecordType=new RecordType(Name='SomeType')); Note that this technique only works if the record ...
sfdcfox's user avatar
  • 500k
5 votes
Accepted

How to get id from concatenation of string in loop

I'm pretty sure what you're looking for is: String custMet = 'BillToId__c'; String idStr = (String)invoice.getSObject('BillingAccount__r').get(custMet); getSObject returns the instance of the ...
Antonio Manente's user avatar
5 votes

Create Workflow without criteria

Select any one of created, and any time it's edited to subsequently meet criteria OR created, and every time it's edited options and in Run rule in the Select formula evaluate true then in formula ...
Dheeraj Pandey's user avatar
4 votes
Accepted

How to give Record Id in url in a lightning app like a VF page?

There is an event called force:navigateToSObject You can go to detail page of the record by providing its Id.
Junaid P Khader's user avatar
4 votes
Accepted

How to create records of a custom object?

You should create tabs to see the 'objects' in App Launcher. Go to Setup > Tabs > Custom Object Tabs > New
S..'s user avatar
  • 1,215
4 votes

Is there some event to delete record from Lightning component like e.force:deleteRecord

we can use force:recordData to delete the record in Lighting Component. To delete a record using Lightning Data Service, call deleteRecord on the force:recordData component, and pass in a callback ...
Gourishankar's user avatar
4 votes
Accepted

How to specify the Lead owner when creating with REST API?

You can specify by username, email, Id, and for queues, Id and Name. { "LastName": "Demo", "Company": "Demo", "Owner": { "attributes": { "type": "User" }, "Username": "login@domain....
sfdcfox's user avatar
  • 500k
4 votes
Accepted

How to loop trough map and get record by field value

You want to use the String value in submap to identify future_record__c records in subList, matching on name? Change subList into a Map where the name is the key - List<Future_record__c> ...
eaeaoo's user avatar
  • 928
3 votes
Accepted

Record Ids for Custom Objects?

For identifying any object with a fixed key prefix (even custom objects), compare the SObjectType from the Id via Id.valueOf, or simply by casting to Id. if(Id.valueOf(recordId).getSObjectType() == ...
sfdcfox's user avatar
  • 500k
3 votes
Accepted

Record Sharing Salesforce

Your custom sharing rows have to provide more access than the Organization-Wide Default. In this case, the default for your external users is irrelevant, because you're inserting at least some shares ...
David Reed's user avatar
  • 93.4k
3 votes
Accepted

How many records can UPSERT add or update in single request in salesforce..?

The limit will be 10000. This is same for all DML statement in single transaction. As Per Salesforce docs So you can see that upsert is also counted as DML statement and for DML statement we have ...
Tushar Sharma's user avatar
3 votes
Accepted

How to embed RecordDetail lightning component into our own custom component?

Salesforce does provide this via force:recordView A force:recordView component represents a read-only view of a record. You can display the record view using different layout types. By default, the ...
Himanshu's user avatar
  • 10.5k
3 votes
Accepted

Send an email : - Error

The issue appeared to be caused by the 'Track Activities' field not being enabled.
Marc Zaharescu's user avatar
3 votes

can salesforce handle 50 or 70 million records?

The asnwer is YES. Salesforce has come up with a new concept - BIG OBJECT As the name suggests it can hold billions of records. Although, it has some limitations. You can not work with it like a ...
Kamruzzaman's user avatar
3 votes
Accepted

How to make a picklist based on other object record values

you can easily do this Controller public String selectedVal{get;set;} public list<selectOption> getProductnames() { list<selectOption> soList = new list<selectOption>(); for(...
Tushar Sharma's user avatar
3 votes
Accepted

RecordType.Name Visibility

So looking at it I bet this is your problem: newfundIds.get(f).Lender_ID__r.Name.contains('National Funding') I'm guessing newfunds does not have a reference id for Lender_ID__r so when you do a ....
Halfwarr's user avatar
  • 619
3 votes
Accepted

Get Record Data for Custom Object

You have missed to specify the fields attribute in @wire declaration. The @wire decorator should be declared as below (note fields: STUDENT_FIELDS): @wire(getRecord, { recordId: '$recordId', fields: ...
Jayant Das's user avatar
  • 30.6k
3 votes
Accepted

Getting the recordId in lightning web component in the utility bar

The solution would use Aura Component and use LWC component inside that. Aura Component: <aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> ...
Vishnu Kumar's user avatar
3 votes
Accepted

LWC recordId showing as undefined in Spring '20

After further testing, it turns out that the optionalFields property is more restrictive in the update. If an optional field is listed when not looking at the correct record type, it will prevent the ...
tkosanke's user avatar
3 votes
Accepted

Can we bind old records to a new Record Type automatically?

If you want to bind old records to the new recordtype then extract the old recordIds and update the recordtypeId through dataloader or workbench. Otherwise, write a script in apex to update the ...
Santanu Boral's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible