All Projects → pozil → server-action-service

pozil / server-action-service

Licence: Apache-2.0 License
Generic and reusable Lightning service component that calls server-side actions

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
Apex
172 projects
CSS
56736 projects

Projects that are alternatives of or similar to server-action-service

Related-List-LWC
My first real foray into Lightning Web Components - an sobject / list view driven lightning data table
Stars: ✭ 21 (+10.53%)
Mutual labels:  lightning, salesforce
Sfdc Ui Lookup
Salesforce Lookup Component (Aura version, maintenance only, see LWC version for updates)
Stars: ✭ 94 (+394.74%)
Mutual labels:  lightning, salesforce
Design System React
Salesforce Lightning Design System for React
Stars: ✭ 676 (+3457.89%)
Mutual labels:  lightning, salesforce
Lightning Data Grid
A data grid for Lightning Component Framework
Stars: ✭ 24 (+26.32%)
Mutual labels:  lightning, salesforce
sfdc-error-playground
Lightning & Apex Error Playground
Stars: ✭ 30 (+57.89%)
Mutual labels:  lightning, salesforce
Salesforcedx Vscode
Salesforce Extensions for VS Code
Stars: ✭ 653 (+3336.84%)
Mutual labels:  lightning, salesforce
Purealoe
Salesforce Sample App part of the sample gallery. Agriculture and retail use case. Get inspired and learn best practices.
Stars: ✭ 65 (+242.11%)
Mutual labels:  lightning, salesforce
Api server boilerplate
typescript express board boilerplate using routing controller
Stars: ✭ 52 (+173.68%)
Mutual labels:  service, action
vuetning
Salesforce Lightning Design System framework for Vue.js 2
Stars: ✭ 21 (+10.53%)
Mutual labels:  lightning, salesforce
Haoide
Stop upgrade, most of features were delivered in https://github.com/xjsender/haoide-vscode
Stars: ✭ 194 (+921.05%)
Mutual labels:  lightning, salesforce
Create Lwc App
Quickstart command line interface for scaffolding your Lightning Web Components projects
Stars: ✭ 144 (+657.89%)
Mutual labels:  lightning, salesforce
SF-Lightning-Lookup
Salesforce lightning dynamic lookup component.
Stars: ✭ 15 (-21.05%)
Mutual labels:  lightning, salesforce
lwc-modules
Build any LWC you want without ever having to touch Apex
Stars: ✭ 20 (+5.26%)
Mutual labels:  lightning, salesforce
lwc-redux
Integrate Redux with Lightning Web Component
Stars: ✭ 35 (+84.21%)
Mutual labels:  lightning, salesforce
httpbun
A simple HTTP server with responses tuned to be useful in testing HTTP clients. Heavily inspired by httpbin, but doesn't intend to be a perfect clone.
Stars: ✭ 14 (-26.32%)
Mutual labels:  service
mnemosyne
Session management service with RPC API based on protobuf.
Stars: ✭ 15 (-21.05%)
Mutual labels:  service
android-textoverlay
Provides a simple service that allows to display arbitrary text as a system-window overlay.
Stars: ✭ 20 (+5.26%)
Mutual labels:  service
lightning-tools
Tools for Lightning Network node operators
Stars: ✭ 19 (+0%)
Mutual labels:  lightning
hls-live-thumbnails
A service which will generate thumbnails from a live HLS stream.
Stars: ✭ 49 (+157.89%)
Mutual labels:  service
lychee-action
Github action to check for broken links in Markdown, HTML, and text files using lychee, a fast link checker written in Rust.
Stars: ✭ 89 (+368.42%)
Mutual labels:  action

Salesforce Lightning Server Side Actions Service Component

About

This is a generic and reusable Lightning component that calls server-side actions.
This is a service component so it has no user interface of it's own: it is meant to be called by other components.

Features

The component provides the following features:

  • integrated error notifications (developer console + toast notifications in Lightning Experience)
  • support for storable actions (cached)
  • custom success and error callbacks

Installation

Option 1: deploy the component and the sample application with Salesforce DX by clicking on this button:

Deploy

Option 2: install just the service component without the sample app as an unmanaged package either by

Option 2a: running this Salesforce DX command:

sfdx force:package:install --package 04t1t000002sBIc

Option 2b: clicking this link:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1t000002sBIc

Documentation

The component is documented using Aura documentation.
You can access it from this URL (replace the domain):
https://<YOUR_DOMAIN>.lightning.force.com/auradocs/reference.app#reference?descriptor=c:ServerActionService&defType=component

Here is an overview of how the service integrates with a calling component:

architecture

Use the service by adding the component to a parent component's markup:

<!-- Add dependency to server side action service -->
<c:ServerActionService aura:id="server"/>

Then, simply call a server-side action from the parent's component controller like this:

// Get server action service
const server = component.find('server');
// Get server-side action
const action = component.get('c.anAction');
// Call server-side action with no parameters and no callback
server.callServer(action);

Server-side actions can also be called with optional parameters, optional custom success and error handlers:

server.callServer(
    action, // Server-side action
    parameters, // Action parameters
    false, // Disable cache
    $A.getCallback(function(response) { // Custom success callback
        // Handle response
    }),
    $A.getCallback(function(errors) { // Custom error callback
        // Handle errors
    }),
    false, // Disable built-in error notification
    false, // Disable background
    false // Not abortable
);

Server-side actions can also be called in a JS Promise chain (Not supported in IE11):

server.callServerPromise(
    action, // Server-side action
    parameters, // Action parameters
    false, // Disable cache
    false, // Disable built-in error notification
    false, // Disable background
    false // Not abortable
).then($A.getCallback(response => {
    // Handle response
}))
.catch($A.getCallback(errors => {
    // Handle errors
}));

Sample application

The default installation (if you do not use the package) installs the component and a sample application available under this URL (replace the domain):
https://<YOUR_DOMAIN>.lightning.force.com/c/SampleServerActionApp.app

If you wish to install manually the project without the sample app, edit sfdx-project.json and remove the src-sample path.

Sample app screenshot

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].