greenstork
  • Member for 9 years, 5 months
  • Last seen more than 2 years ago
How do I generate a random string?
Accepted answer
52 votes

Here is a static method that accepts a desired string length as an argument. It takes a full string of ASCII numbers and letters and loops through the index of your desired string length, randomly ...

View answer
How can I tell which release my org is running?
Accepted answer
51 votes

On the Home tab, on the top right of the screen is a link to Discover Winter '14. This indicates your release.

View answer
Howto wildcard SELECT * to query all fields of objects in APEX?
Accepted answer
40 votes

Update: Spring '21 Release (API v51+) adds new SOQL FIELDS function can select all fields of an object. Refer to documentation Knowing that new FIELDS function must have a LIMIT of at most 200, when ...

View answer
How to use GIT on multi dev environment
Accepted answer
28 votes

There are a couple issues with how you're using git, let me talk about each. The problem First, you're treating your Salesforce server as the truth, instead of git. By doing a Refresh from Server ...

View answer
What is Salesforce1 and why/when would I use it?
Accepted answer
27 votes

Salesforce1 is a new platform, complete with a host of new APIs and mobile UI tools. To oversimplify it, it's taking the Chatter mobile app, which up until this point has just been an app running on ...

View answer
Bind variable with dotted name not working in dynamic SOQL
Accepted answer
19 votes

You found the answer, dynamic SOQL is looking for your variable declaration within the scope of your method. I don't know why it doesn't respect public properties of the class, but that is the case ...

View answer
FIELD_INTEGRITY_EXCEPTION: field integrity exception: unknown (invalid user or group: 005XXXXXXXXXXXX)
14 votes

Customer Communities users do not have access to the full sharing model and therefore can't be added on a __Share record. The only way to share a record with a Customer Communities user is through ...

View answer
Partner Community How to stop users seeing ALL other portal users
Accepted answer
14 votes

See the Winter '14 release notes about the new User Sharing feature. You will need to make users private and create sharing rules for internal users: https://help.salesforce.com/help/pdfs/en/...

View answer
Will I break a TOS by letting contacts login to a visualforce page I create
Accepted answer
13 votes

It's my understanding that custom authentication schemes invalidate the confidentiality clause of the Salesforce.com Master Subscription Agreement and thus would violate your TOS. If you are building ...

View answer
visualforce IF syntax
Accepted answer
12 votes

"{!IF(AND(relation.First_Contact__c != null, relation.First_Contact__c != contact.Id), true, false)}"

View answer
Can a trigger be attached to a Custom Setting?
Accepted answer
12 votes

Currently, triggers are not allowed on custom settings. If you're talking about custom settings in a managed package and wanting better validation, control, and the ability to add logic on the ...

View answer
Trigger execution context and Limits
Accepted answer
10 votes

There is no such thing as passing to a trigger; a trigger fires on a DML event. However, DML operations operate on a transaction chunk of 200 records at a time. So, let's say for example, you have a ...

View answer
MavensMate/Sublime Text - how to investigate schema
10 votes

On the Mac, my favorite tool is SoqlXplorer: http://www.pocketsoap.com/osx/soqlx/

View answer
Is it possible to add an attachment to an existing Task or Event?
Accepted answer
10 votes

You just need to Edit the task itself to see the Add Attachment button. It's only available in the task edit view.

View answer
How do I find the full schema for the History tables?
9 votes

If you're on a Mac, I'm a huge fan of soqlXplorer: http://www.pocketsoap.com/osx/soqlx/ An OS-independent cloud-based option would be Workbench: https://workbench.developerforce.com/login.php In ...

View answer
Unable to @mention Partner user on chatter feed by Salesforce Internal User
Accepted answer
9 votes

Two things must happen in order to @mention a community user on a record feed. The record must be viewed and the Chatter post initiated by the internal user in the communities context. In other words, ...

View answer
Does Javascript Remoting Count Towards API Limits?
Accepted answer
8 votes

No, JavaScrpit remoting does not constitute an API call.

View answer
Create Chatter Post and @mention User in Trigger
8 votes

The only way to @mention someone in apex is using the ConnectApi (AKA Chatter in apex) and not by just creating a FeedItem in apex. You'll need to refactor most everything in your code around the ...

View answer
Master Detail Relationship
8 votes

Your only option is changing the Master-Detail relationship to a lookup. In a Master-Detail relationships, according to the documentation: The detail record inherits the sharing and security ...

View answer
Why use workflows?
8 votes

In addition to Jesse's great answer, the one item that I would add to his list is technical debt. Every line of code costs you as an organization, to maintain and update. The advantage of workflow is ...

View answer
Can I throw an exception in apex and still log the caught exception?
8 votes

As a follow up to this thread and to answer this question should anyone happen up this, here is what I discovered: The Auth.RegistrationHandler interface at the heart of this question has two main ...

View answer
Communities Sharing Rules with Partner level access
8 votes

Each Partner Community user associated with the same account gets a unique Role. When a Partner Community user registers from say, Acme Widgets, that user gets the role Acme Widgets User or something ...

View answer
Trigger on ApexClass Object
Accepted answer
8 votes

Triggers are not allowed on Apex classes. I think the solution here is a behavioral and process one and not a trigger. In my opinion, all code should be kept in some version control system. Changes ...

View answer
Return specific fields for sObject List
Accepted answer
8 votes

Schema.DescribeFieldResult has two instance methods that would accomplish what you're asking-- getName() or getLabel() -- which return the field's API name and label, respectively. for(String key:...

View answer
Mismatching Versions
Accepted answer
8 votes

It sounds as if you have uploaded your package from a developer org that is already upgraded to the Winter'14 release. The problem is that we are right now in the middle of the Winter '14 release. ...

View answer
Unknown Property Error When Invoking object properties with in Apex:repeat
Accepted answer
8 votes

I'm fairly certain that you need a getter on each of the properties of your sub-class. global class AttachmentModel { public ID Id { get; private set; } public DateTime CreatedDate { get; ...

View answer
How do you customize the address bar icon in a visualforce page?
8 votes

Add this to the top of your Visualforce page, with the appropriate static resource link of course: <link rel="icon" type="image/png" href="{!$Resource.Favicon}" />

View answer
Can you change the related Contact of a Customer Portal User?
Accepted answer
8 votes

No, you can't change the contact associated with a customer portal user. You can disable the customer portal user on their contact record and create/enable a new user with that disabled username, ...

View answer
Help on reducing deployment time
8 votes

You should check out these two articles by my colleague about setting up Jenkins for continuous deployment and dynamically creating a package.xml for selective scripted deploys with ANT: http://...

View answer
How do we change Community Users' reputation points with Apex?
7 votes

In addition to Bri's answer (which I recommend), there is an alternative to using the ConnectApi, which is to update the NetworkMember record for a user directly in apex. ReputationPoints is a field ...

View answer
1
2 3 4 5
11