Force.comに関するブログ文章やメモです。
To fix “portal account owner must have a role” Error in Salesforce Community Unit Test
- Aug
- 29
- Posted by Lin
- Posted in APEX, Salesforce, Unit Tests

In Salesforce, if you’re trying to run Unit Test with a Non-Role user, which includes part of creating Portal / Community User test data, the following error will be occured, that is because the portal account’s owner does not have a role to be assigned. System.DmlException: Insert failed. First exception on row 0; first error: […]
read moreTo fix MIXED_DML_OPERATION error(setup and non-setup objects) in Salesforce
- Jul
- 21
- Posted by Lin
- Posted in APEX, Salesforce
The following error will be occured if you’re trying to perform DML operation on both setup and non-setup objects in the same transation.` MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): CustomObject__c, original object: User: [] ` Here is the sample code that can […]
read moreUsing HTML tag(e.g. line break) in Custom Label
- Jul
- 12
- Posted by Lin
- Posted in Custom Label, Salesforce, Visualforce

Custom Label is a really useful feature in Salesforce, not only can be edited after deployed, but also can be used for making an app multilingual with Translation Workbench. If you want to use HTML tag with it on Visualforce Page, e.g. <br /> tag, the only thing you need to do is using an […]
read moreCatching and customizing Apexpages Messages in Apex
- Jul
- 08
- Posted by Lin
- Posted in APEX, Visualforce
As we know, apex:pageMessages tag can be used to display all messages that were generated for all components on the current page, presented using the Salesforce styling, as the following source code we use:Controller Class(CommunitiesSelfRegController) Visualforce Page(CommunitiesSelfReg) But how do we customizing the styling of messages, if those were generated from Salesforce Standard components, such […]
read moreUsing Custom Metadata Types and Custom Settings in Salesforce
- Jul
- 07
- Posted by Lin
- Posted in Custom Metadata, Custom Setting, Salesforce

Custom Metadata is one of the new features that released at Summer’15 of Salesforce, which is customizable, deployable, packageable, and upgradeable application metadata, and it supports the following custom field types. • Checkbox • Date • Date and Time • Email • Number • Percent • Phone • Picklist (Can’t use Global Picklist Value Set) […]
read moreTo Fix Error “Require TLS 1.1 for HTTPS connections” of MavensMate v6.0
- Jun
- 16
- Posted by Lin
- Posted in Other, Salesforce

Well, you may have found that MavensMate shows an error “Server raised fault: ‘UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https.” as below, if you are using MavensMate v6.0 in Sublime Text 3,which is because Salesforce disabled TLS 1.0 encryption recently, for […]
read moreBulk Approval Processing from List View in Salesforce
- May
- 13
- Posted by Lin
- Posted in APEX, Salesforce

I have shared “Approval Processing with Apex in Salesforce” in previous post, and in this post, I’ll continue to share the way of bulk approval processing from Salesforce list view. The outline we need to do is as below : ・Add a custom button for list view ・Set List View Layout ・Add a Apex Class […]
read moreApproval Processing with Apex in Salesforce
- May
- 13
- Posted by Lin
- Posted in APEX, Salesforce

An approval process is an automated process your organization can use to approve records in Salesforce. Usually we can request/approve an approval process through the standard approval process feature, but we can also do those things with Apex in some cases such as : request/approve from VF Page or from Custom Button. Here is Approval […]
read moreSet Name field to be unique with Validation Rule
- Apr
- 25
- Posted by Lin
- Posted in Salesforce, Validation Rule
As we know, we can’t make Name field to be unique in Salesforce, and the Validation Rule is one of the solutions, as the blow code :
read moreDisplay Address type field on Visualforce Page
- Apr
- 06
- Posted by Lin
- Posted in APEX, Salesforce, Visualforce

Address is an especial type of fields in Salesforce, which is a structured compound data type, that we can’t use it directly on Visualforce page. And there will occure a compile error like “Unsupported type: common.api.soap.wsdl.Address used in expression: record.BillingAddress”, if we did that. As the code sample below, we need to use fields BillingStreet, […]
read moreRecent Posts
- Salesforce DevTools Release Notes (version 3.10.0) – mass edit custom fields on lightning
- Salesforce DevTools Release Notes (version 3.9.0) – Object Fields, SOQL Query Editor
- Salesforce DevTools Release Notes (version 3.8.0)
- Salesforce DevTools JUST HIT 10,000 USERS! THANK YOU!
- Using Promise for Apex Server-Side request in Lightning Component
Top Posts
- Salesforce DevTools – Powerful Salesforce developer tools, loved by over 50K developers - 195K views
- Date format and DateTime format - 176.8K views
- Salesforce Mass Editor (Chrome Extension) – Mass create, mass update, mass clone, mass delete on any list view. Support for both Classic and Lightning! - 141.4K views
- Setup an awesome Salesforce developer environment with Sublime Text 3 - 118.2K views
- Writing a Schedulable Batch Apex in Salesforce - 97.3K views
Categories
- APEX
- Apps
- Custom Label
- Custom Metadata
- Custom Setting
- Design & UI
- Event
- Heroku
- iOS & Object-c
- Lightnint Component
- Linux & Mac OS
- Metadata API
- Node.js
- Open Source
- Other
- PHP Framework
- Release Notes
- REST API
- Salesforce
- Salesforce DevTools
- Salesforce DX
- SOQL
- Tooling API
- Unit Tests
- Validation Rule
- Visualforce
- WordPress
You must be logged in to post a comment.