You need to sign in to do that
Don't have an account?

how to refresh a lightning component when a record is inserted in a vf page controller
I have a lightning component where i am displaying list views. Now i want to implement a funcitonality where user can create a list view by clicking on a button on the lightning page. Button invoke a vf page where we enter the name of list view and filter criteria. Now i want to add newly Entered list view to the lightning compoenent list view picklist automatically after clicking on the save button of the vf page.
Here is the code;
Lightning component
-----
<aura:component controller="TransactionListController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<ltng:require styles="{!$Resource.Slds18 + '/styles/salesforce-lightning-design-system.css'}"/>
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="Transactions" type="akritiv__Transaction__c[]"/>
<aura:attribute name="arrowDirection" type="string" default="arrowup" description="Use for change arrow sign direction on header based on click"/>
<aura:attribute name="isAsc" type="boolean" default="true" description="boolean flag for pass sorting condition to apex class"/>
<aura:attribute name="selectedTabsoft" type="string" default="Name" description="Use for show/hide arraow sign on header based on conditions"/>
<aura:handler name="init" value="{!this}" action="{!c.getTransactionList}"/>
<lightning:select aura:id="selectListView" name="View" label="View :" required="False" class="select" onchange="{!c.onChange}">
<option value="">All Transactions</option>
<option value="2">All Closed</option>
<option value="3">All Open</option>
</lightning:select>
<ui:button class="slds-button slds-button_icon slds-button_neutral newbtn" press="{! c.ListViewGen}">
<lightning:icon iconName="utility:add" size="small" alternativeText="New"/>
</ui:button>
vf page
-----------
<apex:page docType="html-5.0" standardController="Account"
tabStyle="akritiv__Transaction__c"
id="customExportContractPage" extensions="transactionlistviewgeneratorExtension">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:outputpanel >
<apex:stylesheet value="{!URLFOR($Resource.Slds18, 'styles/salesforce-lightning-design-system.min.css')}" />
</apex:outputpanel>
</head>
<div class="slds">
<apex:pageBlockSection id="listdiv" columns="1">
<apex:pageBlockSectionItem id="listdivItem">
<apex:outputLabel value="List Name:"></apex:outputLabel>
<apex:inputField value="{!listViewObj.Name}" id="listName" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
</apex:pageBlockSectionItem>
<!-- <apex:pageBlockSectionItem id="IsGlobal" rendered="{!isSysAdmin}"> -->
<apex:pageBlockSectionItem id="IsGlobal" >
<apex:outputLabel value="Available to all?:"></apex:outputLabel>
<apex:inputField value="{!listViewObj.akritiv__Is_Global__c}" id="global"
styleclass="slds-input slds-input slds-small-size--1-of-5" style="width:1.25rem;" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:outputPanel id="filterCriteria">
<b><apex:outputLabel value="Filter Criteria :"></apex:outputLabel></b>
<br/>
<br/>
</apex:outputPanel>
<apex:outputPanel id="filter1outputpanel1">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield1}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter1();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp1}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue1}" id="filtervalue1" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
<apex:selectList value="{!selectCondition1}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8" >
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel2">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield2}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter2();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp2}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue2}" id="filtervalue2" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
<apex:selectList value="{!selectCondition2}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel3">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield3}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter3();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp3}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue3}" id="filtervalue3" rendered="true"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
<apex:selectList value="{!selectCondition3}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel4">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield4}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter4();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp4}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue4}" id="filtervalue4" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
<apex:selectList value="{!selectCondition4}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel5">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield5}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter5();startProcess();" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp5}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue5}" id="filtervalue5" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
</apex:outputPanel>
<div class="slds-m-vertical--medium"></div>
<br></br>
<apex:outputPanel id="olinkCustomExport">
<table>
<tr>
<td><label> </label></td>
<td> <apex:commandButton value="Save & List View" action="{!save}" styleclass="slds-button slds-button--neutral" />
<apex:commandButton value="Cancel" action="{!save}" styleclass="slds-button slds-button--neutral" /></td>
</tr>
</table>
</apex:outputPanel>
<div class="slds-m-vertical--medium"></div>
</apex:form>
</apex:pageBlock>
</div>
</html>
</apex:page>
vf page controller
-----------------------
public class transactionlistviewgeneratorExtension{
public akritiv__Custom_List_View__c listViewObj {get;set;}
public akritiv__Transaction__c Transactions {get;set;}
public Account acc {get;set;}
public String accid {get;set;}
public String filterValue1 {get;set;}
public String filterValue2 {get;set;}
public String filterValue3 {get;set;}
public String filterValue4 {get;set;}
public String filterValue5 {get;set;}
public String selectedFilterfield1 {get;set;}
public String selectedFilterfield2 {get;set;}
public String selectedFilterfield3 {get;set;}
public String selectedFilterfield4 {get;set;}
public String selectedFilterfield5 {get;set;}
public String selectedFilterOp1 {get;set;}
public String selectedFilterOp2 {get;set;}
public String selectedFilterOp3 {get;set;}
public String selectedFilterOp4 {get;set;}
public String selectedFilterOp5 {get;set;}
public String selectCondition1 {get;set;}
public String selectCondition2 {get;set;}
public String selectCondition3 {get;set;}
public String selectCondition4 {get;set;}
public List<SelectOption> fieldNames {get;set;}
public List<SelectOption> Operators {get;set;}
public List<SelectOption> condition {get;set;}
public transactionlistviewgeneratorExtension(ApexPages.StandardController st){
listViewObj = new akritiv__Custom_List_View__c();
// get and add fields in picklist
fieldNames = new List<SelectOption>();
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType ObjectSchema = schemaMap.get('akritiv__Transaction__c');
Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
fieldNames.add(new SelectOption('', '--None--'));
for(String fieldName : fieldMap.keySet())
{
String fName = String.ValueOf(fieldMap.get(fieldName));
String fLabel = fieldMap.get(fieldName).getDescribe().getLabel();
fieldNames.add(new SelectOption(fName, fLabel));
}
//add operators in picklist
Operators = new List<SelectOption>();
Operators.add(new SelectOption('', '--None--'));
Operators.add(new SelectOption('=', 'Equal To'));
Operators.add(new SelectOption('!=', 'Not Equal To'));
Operators.add(new SelectOption('>', 'Greater Than'));
Operators.add(new SelectOption('>=', 'Greater Than or Equal To'));
Operators.add(new SelectOption('<', 'Less Than'));
Operators.add(new SelectOption('<=', 'Less Than or Equal To'));
Operators.add(new SelectOption('<=', 'Like'));
Operators.add(new SelectOption('<=', 'Contains'));
Operators.add(new SelectOption('<=', 'Does Not Contain'));
// add condition in picklist
condition = new List<SelectOption>();
condition.add(new SelectOption('AND', 'AND'));
condition.add(new SelectOption('OR', 'OR'));
this.acc= (Account) st.getRecord();
accid = (String) st.getRecord().Id;
}
public PageReference save(){
system.debug('Name====='+listViewObj.Name);
String filCrit = '';
if(String.isNotBlank(selectedFilterfield1) && String.isNotBlank(filterValue1)){
filCrit = selectedFilterfield1 +':'+ selectedFilterOp1 + ':' + filterValue1;
}
if(String.isNotBlank(selectedFilterfield2) && String.isNotBlank(filterValue2)){
filCrit += selectCondition1+'NEXTFILTER'+selectedFilterfield2 +':'+ selectedFilterOp2 + ':' + filterValue2;
}
if(String.isNotBlank(selectedFilterfield3) && String.isNotBlank(filterValue3)){
filCrit += selectCondition2+'NEXTFILTER'+selectedFilterfield3 +':'+ selectedFilterOp3 + ':' + filterValue3;
}
if(String.isNotBlank(selectedFilterfield4) && String.isNotBlank(filterValue4)){
filCrit += selectCondition3+'NEXTFILTER'+selectedFilterfield4 +':'+ selectedFilterOp4 + ':' + filterValue4;
}
if(String.isNotBlank(selectedFilterfield5) && String.isNotBlank(filterValue5)){
filCrit += selectCondition4+'NEXTFILTER'+selectedFilterfield5 +':'+ selectedFilterOp5 + ':' + filterValue5;
}
akritiv__Custom_List_View__c insertListView = new akritiv__Custom_List_View__c();
insertListView.Name = listViewObj.Name;
insertListView.akritiv__Is_Global__c = listViewObj.akritiv__Is_Global__c;
insertListView.akritiv__Filter_Criteria__c = filCrit;
insert insertListView;
return Null;
}
}
I have a custom object named custom list view where all the details from the vf page will be stored . From there in want to fetch newly created list view and add it to the lightning component and display data.
Thanks,
Here is the code;
Lightning component
-----
<aura:component controller="TransactionListController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<ltng:require styles="{!$Resource.Slds18 + '/styles/salesforce-lightning-design-system.css'}"/>
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="Transactions" type="akritiv__Transaction__c[]"/>
<aura:attribute name="arrowDirection" type="string" default="arrowup" description="Use for change arrow sign direction on header based on click"/>
<aura:attribute name="isAsc" type="boolean" default="true" description="boolean flag for pass sorting condition to apex class"/>
<aura:attribute name="selectedTabsoft" type="string" default="Name" description="Use for show/hide arraow sign on header based on conditions"/>
<aura:handler name="init" value="{!this}" action="{!c.getTransactionList}"/>
<lightning:select aura:id="selectListView" name="View" label="View :" required="False" class="select" onchange="{!c.onChange}">
<option value="">All Transactions</option>
<option value="2">All Closed</option>
<option value="3">All Open</option>
</lightning:select>
<ui:button class="slds-button slds-button_icon slds-button_neutral newbtn" press="{! c.ListViewGen}">
<lightning:icon iconName="utility:add" size="small" alternativeText="New"/>
</ui:button>
vf page
-----------
<apex:page docType="html-5.0" standardController="Account"
tabStyle="akritiv__Transaction__c"
id="customExportContractPage" extensions="transactionlistviewgeneratorExtension">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:outputpanel >
<apex:stylesheet value="{!URLFOR($Resource.Slds18, 'styles/salesforce-lightning-design-system.min.css')}" />
</apex:outputpanel>
</head>
<div class="slds">
<apex:pageBlockSection id="listdiv" columns="1">
<apex:pageBlockSectionItem id="listdivItem">
<apex:outputLabel value="List Name:"></apex:outputLabel>
<apex:inputField value="{!listViewObj.Name}" id="listName" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
</apex:pageBlockSectionItem>
<!-- <apex:pageBlockSectionItem id="IsGlobal" rendered="{!isSysAdmin}"> -->
<apex:pageBlockSectionItem id="IsGlobal" >
<apex:outputLabel value="Available to all?:"></apex:outputLabel>
<apex:inputField value="{!listViewObj.akritiv__Is_Global__c}" id="global"
styleclass="slds-input slds-input slds-small-size--1-of-5" style="width:1.25rem;" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem />
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
<apex:outputPanel id="filterCriteria">
<b><apex:outputLabel value="Filter Criteria :"></apex:outputLabel></b>
<br/>
<br/>
</apex:outputPanel>
<apex:outputPanel id="filter1outputpanel1">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield1}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter1();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp1}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue1}" id="filtervalue1" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
<apex:selectList value="{!selectCondition1}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8" >
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel2">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield2}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter2();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp2}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue2}" id="filtervalue2" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" />
<apex:selectList value="{!selectCondition2}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel3">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield3}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter3();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp3}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue3}" id="filtervalue3" rendered="true"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
<apex:selectList value="{!selectCondition3}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel4">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield4}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter4();startProcess();"
styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp4}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue4}" id="filtervalue4" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
<apex:selectList value="{!selectCondition4}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-8">
<apex:selectOptions value="{!condition}" />
</apex:selectList>
</apex:outputPanel>
<br></br>
<br></br>
<apex:outputPanel id="filter1outputpanel5">
<b> <apex:outputLabel value="Filter"></apex:outputLabel></b>
<apex:selectList value="{!selectedFilterfield5}" multiselect="false"
size="1" onchange="getTypeOfSelectedFilter5();startProcess();" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5" >
<apex:selectOptions value="{!fieldNames}" />
</apex:selectList>
<apex:selectList value="{!selectedFilterOp5}" multiselect="false"
size="1" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5">
<apex:selectOptions value="{!Operators}" />
</apex:selectList>
<apex:inputText value="{!filterValue5}" id="filtervalue5" rendered="true" styleclass="slds-form-element__control slds-select_container slds-select slds-small-size--1-of-5"/>
</apex:outputPanel>
<div class="slds-m-vertical--medium"></div>
<br></br>
<apex:outputPanel id="olinkCustomExport">
<table>
<tr>
<td><label> </label></td>
<td> <apex:commandButton value="Save & List View" action="{!save}" styleclass="slds-button slds-button--neutral" />
<apex:commandButton value="Cancel" action="{!save}" styleclass="slds-button slds-button--neutral" /></td>
</tr>
</table>
</apex:outputPanel>
<div class="slds-m-vertical--medium"></div>
</apex:form>
</apex:pageBlock>
</div>
</html>
</apex:page>
vf page controller
-----------------------
public class transactionlistviewgeneratorExtension{
public akritiv__Custom_List_View__c listViewObj {get;set;}
public akritiv__Transaction__c Transactions {get;set;}
public Account acc {get;set;}
public String accid {get;set;}
public String filterValue1 {get;set;}
public String filterValue2 {get;set;}
public String filterValue3 {get;set;}
public String filterValue4 {get;set;}
public String filterValue5 {get;set;}
public String selectedFilterfield1 {get;set;}
public String selectedFilterfield2 {get;set;}
public String selectedFilterfield3 {get;set;}
public String selectedFilterfield4 {get;set;}
public String selectedFilterfield5 {get;set;}
public String selectedFilterOp1 {get;set;}
public String selectedFilterOp2 {get;set;}
public String selectedFilterOp3 {get;set;}
public String selectedFilterOp4 {get;set;}
public String selectedFilterOp5 {get;set;}
public String selectCondition1 {get;set;}
public String selectCondition2 {get;set;}
public String selectCondition3 {get;set;}
public String selectCondition4 {get;set;}
public List<SelectOption> fieldNames {get;set;}
public List<SelectOption> Operators {get;set;}
public List<SelectOption> condition {get;set;}
public transactionlistviewgeneratorExtension(ApexPages.StandardController st){
listViewObj = new akritiv__Custom_List_View__c();
// get and add fields in picklist
fieldNames = new List<SelectOption>();
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType ObjectSchema = schemaMap.get('akritiv__Transaction__c');
Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
fieldNames.add(new SelectOption('', '--None--'));
for(String fieldName : fieldMap.keySet())
{
String fName = String.ValueOf(fieldMap.get(fieldName));
String fLabel = fieldMap.get(fieldName).getDescribe().getLabel();
fieldNames.add(new SelectOption(fName, fLabel));
}
//add operators in picklist
Operators = new List<SelectOption>();
Operators.add(new SelectOption('', '--None--'));
Operators.add(new SelectOption('=', 'Equal To'));
Operators.add(new SelectOption('!=', 'Not Equal To'));
Operators.add(new SelectOption('>', 'Greater Than'));
Operators.add(new SelectOption('>=', 'Greater Than or Equal To'));
Operators.add(new SelectOption('<', 'Less Than'));
Operators.add(new SelectOption('<=', 'Less Than or Equal To'));
Operators.add(new SelectOption('<=', 'Like'));
Operators.add(new SelectOption('<=', 'Contains'));
Operators.add(new SelectOption('<=', 'Does Not Contain'));
// add condition in picklist
condition = new List<SelectOption>();
condition.add(new SelectOption('AND', 'AND'));
condition.add(new SelectOption('OR', 'OR'));
this.acc= (Account) st.getRecord();
accid = (String) st.getRecord().Id;
}
public PageReference save(){
system.debug('Name====='+listViewObj.Name);
String filCrit = '';
if(String.isNotBlank(selectedFilterfield1) && String.isNotBlank(filterValue1)){
filCrit = selectedFilterfield1 +':'+ selectedFilterOp1 + ':' + filterValue1;
}
if(String.isNotBlank(selectedFilterfield2) && String.isNotBlank(filterValue2)){
filCrit += selectCondition1+'NEXTFILTER'+selectedFilterfield2 +':'+ selectedFilterOp2 + ':' + filterValue2;
}
if(String.isNotBlank(selectedFilterfield3) && String.isNotBlank(filterValue3)){
filCrit += selectCondition2+'NEXTFILTER'+selectedFilterfield3 +':'+ selectedFilterOp3 + ':' + filterValue3;
}
if(String.isNotBlank(selectedFilterfield4) && String.isNotBlank(filterValue4)){
filCrit += selectCondition3+'NEXTFILTER'+selectedFilterfield4 +':'+ selectedFilterOp4 + ':' + filterValue4;
}
if(String.isNotBlank(selectedFilterfield5) && String.isNotBlank(filterValue5)){
filCrit += selectCondition4+'NEXTFILTER'+selectedFilterfield5 +':'+ selectedFilterOp5 + ':' + filterValue5;
}
akritiv__Custom_List_View__c insertListView = new akritiv__Custom_List_View__c();
insertListView.Name = listViewObj.Name;
insertListView.akritiv__Is_Global__c = listViewObj.akritiv__Is_Global__c;
insertListView.akritiv__Filter_Criteria__c = filCrit;
insert insertListView;
return Null;
}
}
I have a custom object named custom list view where all the details from the vf page will be stored . From there in want to fetch newly created list view and add it to the lightning component and display data.
Thanks,
Are you redirecting to a vf page or the flow is something else?
Cheers!!!