19

Alright, I spent a couple of days going through it all, and the short answer is: it's complicated. Depending 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 ...


16

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

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 ...


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 ...


12

Here is updated 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(); // ...


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

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


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

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 ...


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

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 ...


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

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 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 ...


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

I encountered same issue. And the solution which worked for me was that while creating the permission set I was not selecting any User License in the picklist. I created a new permission set with User License as 'Salesforce' and then option for Tab settings in opportunity object became enabled. May be this could help.


7

The error message is not very user friendly but what it hints is to provide at least one filter while querying FieldDefinition. For example you can filter the query by using EntityDefinition Example select id,DataType,NamespacePrefix,DeveloperName from FieldDefinition where EntityDefinition.QualifiedApiName = 'Account' When we remove the where clause ...


7

First to start with: The only benefit of Solution over Knowledge Base is: Solution is free!! Now how knowledge beat solution big time or can say why salesforce is making more money by introducing this: Unlike Solutions, using the knowledge base requires Knowledge feature licenses, which come at an additional cost. Unlike Solutions, Knowledge comes with ...


7

So @Monith's answer is correct in that you should use an outputLink tag, but I disagree with the link construction methodology enough to post a separate answer. When you are constructing links for standard actions, you should use the $Action global variable: {!URLFOR($Action.Opportunity.View, opportunity.Id)} If you look through the Valid Values for the $...


7

Boolean multiCurrencyEnabled = Schema.getGlobalDescribe().containsKey('CurrencyType'); If this check is true, it's safe to use CurrencyIsoCode fields and the CurrencyType object. I'd recommend using a static variable so it can be initialized just once per transaction.


7

You have the 'new' Notes functionality configured. See: What’s the Difference Between Notes and the Old Note-Taking Tool? With new Notes, you have to use the ContentNote object, then create a ContentDocumentLink to attach it to the Account. One gotcha is that ContentNote's Content field must be base64 encoded. I just created a ContentNote from Workbench ...


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

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 ...


6

I took a look and couldn't see it either. I did a bit of research in the Spring '14 release notes and nothing there referenced why a field like that wouldn't be available. TotalPrice appears to be a formula itself, combining Quantity x UnitPrice. Interestingly enough, there appears to be two sets of documentation available for OrderItem as well (http://www....


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