Skip to content

anyei/customRecordForm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

customRecordForm

sfdc lightning component, customRecordForm to edit standard/custom object records.

demo

demo

Install

Deploy to Salesforce Button
Deploy to Salesforce
Manual Install

You may manually create the class within your org and copy paste the content of customRecordForm's src folder.

Usage

The simplest way to use this component is to put the markup anywhere within your lightninig component or lightning app, then set the properties and that's it. Here a simple examples, there are more if you scroll down:

simple example 1

We use the customRecordForm component to generate the form for several fields. We need to use the customDataManager, this is use to connect to the server will explain more about it later.

markup
<aura:application  extends="force:slds" >
  
    <aura:attribute name="recordId" type="String" default="006S000000C1QgyIAF" />
    
    <aura:attribute name="opptyFields" type="List" default="['Id','Owner_1__c', 'Position__c', 'Type', 'Business_Phone__c']"/>
  
   <aura:handler value="{!this}" name="init" action="{!c.doInit}" />

    <c:customFormDataManager aura:id="customDataManager" />
    
    <c:customRecordForm sObjectType="Opportunity" fields="{!v.opptyFields}" />

</aura:application>

In this sample markup, we are using additional attributes such as the recordId nad the opptyFields, these are needed in order to setup the components.

js controller
({
    doInit:function(component, event, helper){

        var opptyFields = component.get('v.opptyFields');
       var opptyId = component.get('v.recordId');
       

        component.find('customDataManager').set('v.setup',{ 
            Opportunity:{fieldNames :opptyFields, whereCondition:{Id:opptyId} }
        });
    }
})