Creating an API Gateway in AWS
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
If you want to take AWS to the next level you will need to create an API Gateway. An API Gateway creates a url that allows you to post data to it and it passes it along to a connected Lambda function running Node.js. After logging into AWS click on the search console and navigate to the API Gateway service. Once you are there go ahead and click “Create API” Once on the next screen confirm you have the same options selected and click next: Now you’ll need to click the “actions” drop down list and select “Create Method” Create a “POST” method and then click on the method you just created. Now ..read more
Visit website
Using AWS with Salesforce
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
Using AWS with Salesforce is one of the best platforms you can use to help leverage Salesforce to reach its maximum potential. No problem can stand in your way when you understand the ins and outs around the technologies inside Amazon Web Services. S3: For example using S3 buckets to store files too large for Salesforce or to allow for a speedy CDN to allow users around the globe to access or download files faster than what Salesforce can provide. Lambda functions: Another powerful service to know about is Lambda functions. These functions hosted within AWS allow you to integrate with API’s so ..read more
Visit website
Converting HTML to Visualforce
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
When converting HTML files to Visualforce there is a few things you have to remember. Every tag needs to be closed. Some tags in HTML have more than one acceptable way of writing them. For instance take a look at the <br> tag. This tag creates a line break but you can also write it like this: <br/>. In Visualforce it only accepts one version of the BR tag and its <br/>. Visualforce heavily depends on tags being closed correcty so it doesn’t disrupt the visualforce markup further on in the same page. Some popular tags that do not have a end tag to match it need to be closed in ..read more
Visit website
System.QueryException: List has no rows for assignment to SObject
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
The error “System.QueryException: List has no rows for assignment to SObject” normally occurs when you’re running a SOQL query that for some reason is giving zero results. I’ve also run into this during code deployments or testing on records that dont have related records populated. If you add some defensive programming to your code you can safely handle zero results thus avoiding the problem for end users. For example you shouldn’t do this: Account a = [select id, name from Account where name = 'salesforcenick']; Instead add some defensive programming tactics to your code: List<Account ..read more
Visit website
Display Apex Variables In Lightning Components
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
When developing Lightning Components on the Salesforce platform a popular need is to simply display values from an apex controller directly on the lightning component. To help show how to do this I created this example where the lightning component is displaying field values returned form a SOQL query. Summary: We create our string and object get;set; variables and a include the @AuraEnabled annotation. The @AuraEnabled annotation enables client- and server-side access to an apex controller method and controller property. Providing this annotation makes your methods and properties a ..read more
Visit website
Easy Visualforce Lightning Components
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
On Salesforce Lightning records you can now include visualforce as a component. For situations where you need to display information or dynamic UI from a query or calculation you can save a lot of time with visualforce components. After creating this visualforce page make sure to enable it for lightning page use and drag it onto your lightning record page after clicking “edit page”. public class AccountVF_controller { public String var1 { get; set; } public String var2 { get; set; } public Account accountRecord{get; set;} public Contact contactRecord{get; set;} //Since th ..read more
Visit website
How to reference Apex in Visualforce
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
Examples showing how to reference Apex variables and queries in visualforce. Also shows how to send variables from visualforce to an apex controller. Github Repo: https://github.com/Nicholashuber/Apex-Visualforce Simply create the visualforce page and controller and click preview after saving to see the results. Apex: public class AccountVF_controller { public String var1 { get; set; } public String var2 { get; set; } public Account accountRecord{get; set;} public Contact contactRecord{get; set;} //Since this is the constructor (the same name as the controller) it is ..read more
Visit website
Using the Apex Crypto Class with Examples
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
The Apex Crypto class provides a number of cryptographic functions for creating digests, message authentication codes, and signatures, as well as functions for encrypting and decrypting information. These functions allow you to protect the confidentiality of data as well as allow external systems to verify the integrity of messages and authenticity of the sender. The methods in the Crypto class can be used for securing content in Lightning Platform, or for integrating with external services such as Google or AWS. The cryptographic capabilities of the Crypto class are normally used i ..read more
Visit website
Prevent an Apex Trigger from running twice
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
Recently I encountered an issue where I needed to stop a trigger from running twice. For instance if you are making an update in a trigger that uses the Trigger.isUpdate context. In this scenario if we make an update inside the Trigger.isUpdate context it will loop forever and error out. Here is how to solve for that: public class ContactTriggerHandler { public static Boolean isFirstTime = true; } trigger Contact_Trigger on Contact (before insert, after insert, before update, after update, before delete, after delete, after undelete) { if(Trigger.isUpdate && ..read more
Visit website
System.NullPointerException: Attempt to de-reference a null object
Salesforce Nick | Salesforce Developer Blog
by Nick Huber
4y ago
The error “System.NullPointerException: Attempt to de-reference a null object” normally occurs when you try to reference an object which has not been initialized or has null values. It can also happen when your variable is not initialized. If we dont instantiate the object that contains the field before we reference it results in an Attempt to de-reference a null object error. This error may occur in Apex classes, Visualforce pages with Apex controller, Test classes, Apex Triggers. For Example if I use like this: Account accobj; accobj.Name = 'SalesforceNick';   We should use it like th ..read more
Visit website

Follow Salesforce Nick | Salesforce Developer Blog on FeedSpot

Continue with Google
Continue with Apple
OR