Skip to content

Instantly share code, notes, and snippets.

View maujood's full-sized avatar

Mehdi Maujood maujood

View GitHub Profile
@maujood
maujood / ApexHelper.cmp
Last active March 10, 2021 05:21
Utility Component to call Apex and SOQL from Lightning Components using just one line of code
<aura:component extensible="true"
controller="ApexHelperController">
{!v.body}
</aura:component>
@maujood
maujood / sample.js
Last active February 25, 2019 18:47
Using the ApexHelper component
//You can use these utility methods by extending from the ApexHelper component created earlier:
//<aura:component extends="c:ApexHelper">
//Example of executing an Apex Method through our new utility:
helper.apex(component, "search", { searchstr : searchTerm })
.then(function (result) {
//do something with the result
})
.catch(function (error) {
//do something about the error
@maujood
maujood / AppEventLifecycleComponentInner.cmp
Created February 5, 2019 17:49
Lightning Application Events Demo
<aura:component>
<aura:attribute name="globalId" type="String"/>
<aura:registerEvent name="appEvent" type="c:LightningSimpleEvent"></aura:registerEvent>
<aura:handler event="c:LightningSimpleEvent" action="{!c.handleEvent}" phase="capture"></aura:handler>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" padding="around-small">
Component: {!v.globalId}
</lightning:layoutItem>
<lightning:layoutItem size="12" padding="around-small">
@maujood
maujood / CompEventLifecycleApp.app
Created February 5, 2019 21:18
Lighting Component Events Demo
<aura:application extends="force:slds">
<aura:attribute name="globalId" type="String" />
<aura:registerEvent name="compEvent" type="c:LightningComponentEvent"></aura:registerEvent>
<aura:handler name="compEvent" event="c:LightningComponentEvent" action="{!c.handleEvent}" phase="bubble"></aura:handler>
<aura:handler name="compEvent" event="c:LightningComponentEvent" action="{!c.handleEventCapture}" phase="capture"></aura:handler>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" padding="around-small">
Application: {!v.globalId}
</lightning:layoutItem>
@maujood
maujood / ApexSandboxPracticeDataModel.MD
Last active January 13, 2024 06:09
ApexSandbox.io Practice Data Model

Interplanetary School of Programming

This is a work-in-progress for the practice data model for an Interplanetary School of Programming.

This data model is used for practice problems on ApexSandbox.io. Click here for a Schema Builder ERD of the data model, or continue below to the detailed data dictionary.

Student (apxio__Student__c)

Represents a student that can be enrolled in classes.

Field Type Additional Info