Anda di halaman 1dari 10

BrewApex Guidelines

Last updated: August 19, 2019

1
SFDC Custom Lookup Component .............................................................................................. 3
Features and Benefits ................................................................................................................................... 3
Component Reference .................................................................................................................................. 3
How to Use..................................................................................................................................................... 4
Version History .............................................................................................................................................. 4
Trigger Framework Component................................................................................................. 5
Features and Benefits ................................................................................................................................... 5
How to Use..................................................................................................................................................... 5
Version History .............................................................................................................................................. 5
Error-pro Component ............................................................................................................. 6
Features and Benefits ................................................................................................................................... 6
How to Use..................................................................................................................................................... 6
Version History .............................................................................................................................................. 8
App Search Component ........................................................................................................... 9
Features and Benefits ................................................................................................................................... 9
How to Use..................................................................................................................................................... 9
Version History .............................................................................................................................................. 9
Dynamic Table Component ..................................................................................................... 10
Features and Benefits ................................................................................................................................. 10
How to Use................................................................................................................................................... 10
Version History ............................................................................................................................................ 10

2
SFDC Custom Lookup Component
SFDC Custom Lookup Component

Create re-usable custom lookup in Salesforce lightning component. Lightning comes with many pre-built
components that are easy to use but still many components are missing by date. One of them is the lookup
component. We will create this within a single component without using any child components or events.

Features and Benefits

• Single component
• Create multiple object lookup
• Ability to set sObject Icon (standard / Custom)
• Ability to set placeholder & label

Component Reference

Paramet Data Type Required Default Alternate Values Description


er Name Value
selected sObject Yes Blank N/A SelectedRecord
Record Attribute helps to
SELECT sObject
Record to display
lookup with list of
records
label String Yes Blank It can be any string Label attribute will
value display the label for
the custom lookup
field.
objectA String Yes Blank Any salesforce Enter the Object
PIName Standard / Custom name which you
object name want to create
lookup
IconNa String No Blank Icon name that are Enter Icon Name
me available in SLDS which are available
library in lightning library
https://lightningdesig
nsystem.com/icons/
queryCo String No Blank Add Where Clause with Query condition
ndition filter condition one or attribute helps to
more in Query eg: add filter condition in
CaseStatus=Open OR the dynamic query
CaseStatus=Inprogres based upon the filter
s record will be
display in look up
field
isRequir Boolean No True True / False, if entered isRequired attribute
ed value is “True” the field helps to Set Lookup
mark as mandatory filed is mandatory
with asterisk (*) field on the UI
symbol, else it’s not set
as mandatory field
showSe Boolean No True True / False, if entered showSearch
arch value is “True” search attribute helps to
Icon will display on UI. dynamically set
Else hide search icon search Icon on UI

3
How to Use

Add below code in top of the lighting component


<aura:attribute name="selectedLookUpRecord" type="sObject" default="{}"/>
Place below code where you want to create custom lookup

<c:ABI_CustomLookupCmp objectAPIName="yourObject" IconName="standard:contact"


selectedRecord="{!v.selectedLookUpRecord}" label="Contact Name" eventName="New"
isRequired="false"/>

Version History

Version No Version Name Release date Change Log


1.0 Ver 1.0 08/13/2019 • Log 1 description
• Log 2 description
• Log 3 description

4
Trigger
TriggerFramework Component
Framework Component

Apex trigger plays an important role in salesforce application implementation. For a strong architectural
foundation and successful implementation, a proper design of trigger is very essential. Considering the best
practices of apex trigger and coding standard we have built an app called ABI Trigger Framework. Just using few
clicks the trigger will be created and ready to use.

Features and Benefits

• Followed trigger best practices


• Automatically create trigger and handler class
• Makes developers only focus on logic
• Easy to create just in few clicks
• Saves development time

How to Use

Let’s navigate to brewApex App and follow the below steps

• click on ABI TRIGGER FRAMEWORK menu on the right side of the page.
• One popup will be displayed with all the trigger supported objects of your salesforce org as dropdown
options.
• Select the object you want to create the trigger and click Create
• If the selected object has existing trigger it will display the trigger name and Create button will be
disabled for the selected object.

Version History

Version No Version Name Release date Change Log


1.0 Ver 1.0 08/13/2019 • Log 1 description
• Log 2 description
• Log 3 description

5
Error-pro
Error-pro Component
Component

Error pro is an Exception handling framework which can be plugged into any salesforce application within your
org. It allows you to pro-actively track the Errors within your application. Now you need not wait for the user to
raise a ticket or wait for your application to crash before you find the bug in your application. Whenever an error
occurs while using your application it allows you send a mail to your development team, notifying regarding the
error.
In addition, it creates debug logs capturing the details regarding the error. It stores all the relevant details like
Exception details, the org name, date and time. These details are also enclosed within the mail send to the
developer team. Using these you can do in-depth analysis on Errors within your application using these logs.

Features and Benefits

• Keep track of the Exceptions/errors from Apex.


• Logs the integration failure root cause with request and response.
• Feasibility to debug bugs in Production org.
• Automatically send Email to the corresponding owners accommodated with the exception.

How to Use

Method Name EHF_ABIErrorLogs (Exception exceptionObject, String methodName, String


className, String applicationName, String emailRecipients)

Description Use this method in try catch block to log the errors that occurred at run time.

Parameter Description
exceptionObject Pass the exception object reference
methodName Name of the apex method
className Name of the apex class
applicationName Name of the Application
emailRecipients Email id of the salesforce user (optional)

Example:
Class sampleclass{
Public void samplemethod(){
Try {
//sample code…
} catch (Exception ex) {
EHF_ABIExceptionHandler_CC.EHF_ABIInformationLogs obj = new
EHF_ABIExceptionHandler_CC.EHF_ABIInformationLogs (ex, ‘samplemethod', ‘sampleclass’,
‘AppName’,’sfdcuser@sample.com’);
EHF_ABIExceptionHandler_CC.storingExceptions(obj);
}
}
}

6
Method Name EHF_ABIErrorLogs (String methodName, String className, String
applicationName, String requestBody, String requestResponse, String
emailRecipients)
Description Use this method in try catch block to log the errors that occurred while making
connection to external system in apex at run time. Also, we are storing the request
and response of the connection.
Parameter Description
methodName Name of the apex method
className Name of the apex class
applicationName Name of the Application
requestBody Request sent from salesforce
requestResponse Response of the external system
emailRecipients Email id of the salesforce user (optional)

Example:
Class sampleclassName{
Public static void sampleAPICallout(){
String sfdcURL = URL.getSalesforceBaseUrl().toExternalForm();
String restAPIURL = sfdcURL + '/services/data/v29.0/sobjects/';
HttpRequest httpRequest = new HttpRequest();
httpRequest.setMethod('GET');
httpRequest.setHeader('Authorization', 'OAuth ' + UserInfo.getSessionId());
httpRequest.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
httpRequest.setEndpoint(restAPIURL);
String response = '';
try {
Http http = new Http ();
HttpResponse httpResponse = http.send (httpRequest);
response = JSON.serializePretty (JSON.deserializeUntyped(httpResponse.getBody()));
//sample code…
} catch (System.Exception e) {
EHF_ABIExceptionHandler_CC.EHF_ABIErrorLogs obj = new
EHF_ABIExceptionHandler_CC.EHF_ABIErrorLogs (‘sampleAPICallout’, ‘sampleclassName’,
‘AppName’, httpRequest, response, ‘sfdcuse@sample.com’);
EHF_ABIExceptionHandler_CC.storingExceptions (obj);
}
}
}

Method Name EHF_ABIInformationLogs (String methodName, String className, String


applicationName, String requestBody, String requestResponse, String
emailRecipients)
Description Use this method to capture the information about the connection request and
response value at run time. This information will help for RCA if needed.

Parameter Description
methodName Name of the apex method
className Name of the apex class
applicationName Name of the Application
requestBody Request sent from salesforce
requestResponse Response of the external system
emailRecipients Email id of the salesforce user (optional)

Example:

7
Class sampleclassName {
Public static void sampleAPICallout(){
String sfdcURL = URL.getSalesforceBaseUrl().toExternalForm();
String restAPIURL = sfdcURL + '/services/data/v29.0/sobjects/';
HttpRequest httpRequest = new HttpRequest();
httpRequest.setMethod('GET');
httpRequest.setHeader('Authorization', 'OAuth ' + UserInfo.getSessionId());
httpRequest.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
httpRequest.setEndpoint(restAPIURL);
String response = '';
try {
Http http = new Http ();
HttpResponse httpResponse = http.send (httpRequest);
response = JSON.serializePretty (JSON.deserializeUntyped(httpResponse.getBody()));
//sample code…
EHF_ABIExceptionHandler_CC.EHF_ABIInformationLogs obj = new
HF_ABIExceptionHandler_CC.EHF_ABIInformationLogs (‘sampleAPICallout’, ‘sampleclassName’,
‘AppName’, httpRequest, response, ‘sfdcuse@sample.com’);
EHF_ABIExceptionHandler_CC.storingExceptions (obj);

} catch (System.Exception e) {
EHF_ABIExceptionHandler_CC.EHF_ABIErrorLogs obj = new
HF_ABIExceptionHandler_CC.EHF_ABIErrorLogs (‘sampleAPICallout’, ‘sampleclassName’,
‘AppName’, httpRequest, response, ‘sfdcuse@sample.com’);
EHF_ABIExceptionHandler_CC.storingExceptions (obj);
}
}
}

Version History

Version No Version Name Release date Change Log


1.0 Ver 1.0 08/13/2019 • Log 1 description
• Log 2 description
• Log 3 description

8
AppApp
Search Component
Search Component

Application search is a global search component which will make your searching experience smooth. The
‘application’ name signifies that the search will be only on those object records specific to an application you are
currently in. The objects and fields are configurable that you want to show per application. This makes your
search experience more relevant. You can view, edit and delete the records direct from the search table. We
have implemented the bulk update feature, select multiple records and update any field on one record will update
the selected record field with the same value. You can export the search results to excel format.

Features and Benefits

• Search only the object records with in the application you are on.
• Configurable search objects and fields
• Bulk update the search records.
• Export to excel the search data.

How to Use

Go to the application home page, on the search bar component text box put any keyword and click search. You
will see the objects and records per object matches with the search keyword.

Version History

Version No Version Name Release date Change Log


1.0 Ver 1.0 08/13/2019 • Log 1 description
• Log 2 description
• Log 3 description

9
Dynamic
Dynamic Table Component
Table Component

Dynamic table component tool helps the users to create the object tables dynamically based on the object and
fields given by the users. You need pass the object name, fields and can set the conditions to filter out the table
data and display on the table. You can export the dynamic data to excel format. We have given some more
functionalities like view, edit and delete the records and perform bulk operations on multiple records. You can sort
the columns ascending and descending order. To make the search and view more relevant the table will be
displayed with pagination where you can navigate to fast, last, next and previous page.

Features and Benefits

• Dynamically create the table with the user inputs.


• Bulk update on the table data.
• Export to excel the table data.
• Column sorting
• Automated pagination

How to Use

Version History

Version No Version Name Release date Change Log


1.0 Ver 1.0 08/13/2019 • Log 1 description
• Log 2 description
• Log 3 description

10

Anda mungkin juga menyukai