1

How can I get the SObject from a url? Sample url:

https://customcomp--dev.lightning.force.com/one/one.app#/sObject/a044B000001koVmQAI/view?a:t=1490977419216

1

If you want to know the SObjectType of a given Id, you can just use a short Execute Anonymous script:

system.debug(Id.valueOf('<id_here>').getSObjectType());
0

In Lightning, the standard approach is to use the force:hasRecordId, as outlined in this article. Basically, if you use this, your component will automatically have an attribute called recordId that you can use in your controller:

var recordId = component.get("v.recordId");

Even better, implementing this interface allows you to "hint" places where the component can be used in the Lightning App Builder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.