15

Salesforce is split across login "domains." Each domain uses its own username index, which means it's entirely possible to create the exact same user on login.salesforce.com, test.salesforce.com, and prerellogin.pre.salesforce.com, and any other unique login domains that may exist. Note that "My Domain" does not constitute a unique login domain; it still ...


13

Good observation and desire to encapsulate here. There is no common super class or interface to these objects already supplied in Apex. However this does not prevent you from creating one, there is two options I can imagine for this. Dynamic Apex Method. You can access the fields indirectly via a feature known as Dynamic Apex, its simalar to reflection in ...


13

Alright, I spent a couple of days going through it all, and the short answer is: it's complicated. Depeneding on what you want your triggers to do, you may need to have different triggers on different objects, ContentVersion, ContentDocument and ContentDocumentLink. Below find the long answer. It turns out that the debug logs are different depending on ...


13

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 0010a0ZZZZZZZZZ. Giving you 629 possible identifiers for actual records on a pod for the same org. The three characters immediately after the keyprefix has other ...


12

It is an SObject, and you can query it normally, but it's a special type of standard (built-in) object that has a number of unique attributes. Case comments: Can't have custom fields added. Don't support workflow rules. Don't support validation rules. Cannot be part of a custom lookup or master-detail relationship. Case comments don't count against your ...


12

Opportunity Product (API name OpportunityLineItem) is a Junction Object between Opportunity and Product2 . An opportunity has to be linked to the Product for generating order or to do Quote management going ahead .The products linked to opportunity are known as opportunity line Item or opportunity product .The revenue is the sum of prices of these line ...


11

You need to use a correct child relationship name Cases Select Id, Name, (Select Id, Description From Cases) From Account Like the documentation says (Relationship Queries): For parent-to-child relationships, the parent object has a name for the child relationship that is unique to the parent, the plural of the child object name. For example, ...


11

An SObject represents a specific table in the database that you can discretely query. The API Name is what you reference as ending in __c. Standard SObjects have names like Account or Opportunity, whereas Custom SObjects and Custom Settings have names like MyObject__c or MySetting__c. Custom Settings are special objects you can get without a query. You can ...


10

You can take a look at the ERDs for standard Salesforce objects. They are broken down into smaller, functional areas to make it easier to understand. For example, here's the Products and Schedules Objects ERD which focuses in on Quotes, Opportunities, and Products: For the purposes of learning how Salesforce CRM works, please see this question.


10

I tried to relate API Name with UI label and here is what I found. Missing field in API but Available on UI Accessibility Mode NewsAllow Forecasting Color-Blind Palette on Charts End of day Force.com Flow User Force.com Quick Access Menu = Make Setup My Default Landing Page Mobile Configuration Mobile Push Registrations Receive Approval ...


10

Following Standard objects don't support trigger, I have gathered so far as of Spring' 17 release. AcceptedEventRelation AccountContactRelation AccountCleanInfo AccountContactRole AccountFeed AccountHistory AccountOwnerSharingRule AccountPartner AccountShare AccountTag AccountTeamMember AccountTerritoryAssignmentRule AccountTerritoryAssignmentRuleItem ...


9

Its a bit confusing, but I think the EventRelation is the key. The child Event will have an EventRelation record with the EventId equal to the Parent Event and the RelationId for each User. (Source)


9

The global object for User information inside Apex is actually UserInfo. Try: List<Object> = [SELECT Id,Name FROM Object WHERE User_id = :UserInfo.getUserId()];


9

One of three possibilities: You're customizing a report based on a custom report type that doesn't include this field. To resolve, go to Setup / Create / Report Types and add the field. Your profile doesn't have read access to this field. Even administrators can't view fields without permission. Go to Setup / Customize / Accounts / Fields, click on ...


9

Here is code that will give list of all objects excluding Share, history , Tag & feed. You can add extra condition to filter out other unnecessary sObjects. List<string> SObjectList = new List<string>(); for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){ String name = objTyp.getDescribe().getName(); // Exclude all ...


9

SOQL/SOSL won't help you here. You can, however, write a query using the Tooling API like this: SELECT Id,TableEnumOrId FROM CustomField WHERE DeveloperName = 'Owner' The easiest way to do this is to open the Developer Console, click the Query Editor tab, check the "Use Tooling API" checkbox, and type in the query. Note that you do not include the __c when ...


9

Both points are correct, see here ERD: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_products.htm


8

Instead of marking the sync at the quote level you'll need to mark it at the opportunity level via the Opportunity.SyncedQuoteId field. After doing this the Quote.IsSyncing field will be true.


8

The answer to this question is in the question. Without record types, you have no way to change the page layout on the fly. Any editable field that is on the layout will be presented to the user, and there's no way to specify that a user doesn't have "create" access to a field but does have "update" access to the same field. Any other solution would involve ...


8

002 is a Note, 004 has apparently not been used. Source: System.debug(Id.valueOf('002000000000000').getSObjectType()); // Note System.debug(Id.valueOf('004000000000000').getSObjectType()); // Cannot locate Apex Type for ...


7

Visualforce uses the MVC pattern, pages have code behind them as well as data. You make 'bindings' in your page e.g. {!filterId} or {!list} to access data or methods (behaviour) on the code behind the page. The code behind a page is known as the controller. In your example you have specified the 'standardController' attribute. This tells the Force.com ...


7

I think I found my answer --- according to the docs on Salesforce Primitive Data Types: AnyType is used within the Force.com platform database exclusively for sObject fields in field history tracking tables.


7

You need to use the ISNULL() function instead of checking the Value(Object2)=null. Change to this ISNULL(VALUE(object2)) EDIT As @Sdry points out, you could also use ISBLANK(VALUE(object2)) ISBLANK() is a newer function, it has the same functionality as ISNULL, but also supports text fields. So as Sdry points out, it is highly preferred over ISNULL(). ...


7

You can try querying the Case object and using dot notation to get to the Account info: SELECT Account.Id, Account.Name, Id, Description from Case


7

The API names are, in a matter of speaking, the unique Id's for your metadata. If you change the API name in sandbox 1, sandbox 2 has no idea that you did that. So when you move the metadata to sandbox 2 it thinks it is a new field. So to answer your question. No you can not rename API names with change sets. If you need to do something like that I would ...


6

The feature that allows restrictring API access from managed packages (known as package access control, or PAC) has been deprecated and is no longer available for new packages. Existing packages that have it enabled can disable it in the subscriber org via the same method as the old answer. If you need to disable this as a package publisher you'll need to ...


6

You can query the UserRecordAccess table (documentation is here) to find out what permissions a particular user has on a particular record of an object. This table allows you to construct the following query: SELECT RecordId, HasEditAccess FROM UserRecordAccess WHERE UserId = :UserInfo.getUserId() AND RecordId = <<record Id>>


6

In your VF page, you just need to add a bit of javascript in the oncomplete of your commandbutton Your button <apex:commandButton value="saveSalary" action="{!yourSaveMethod}" oncomplete="myClose();"/> JS method function myClose(){ window.opener.location.href="/{!$CurrentPage.parameters.yourAccountIdParamName}"; window.top.close(); //...


6

So yes, typically Owner relates to the User obj, BUT it can also relate to the Group obj. There are a number of standard objects that have multiple Objects off Owner (kinda of like the WhatId or WhoId on task) for instance a Case can belong to a queue (Group) and so Owner.Email would be invalid. Task can also belong to a Queue (Group). If you look in the ...


6

You can code the controller as without sharing and copy the values into and out of an intermediate object. The documentation for with sharing states: The with sharing keyword allows you to specify that the sharing rules for the current user be taken into account for a class. You have to explicitly set this keyword for the class because Apex code runs in ...


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