• Nitish Bansal 46
  • NEWBIE
  • -1 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hi Guys,

I have a custom list view VF button for mass action on my opportunity object. This works fine when I am using this on classic or Lightning experience.
Earlier there were no checkboxes for records within Napili template in list views and no button used to show up. In summer '17 release checkboxes and buttons are now showing up. But when I click on this button, wierdly enough nothing happens at all. My VF is lightning and Salesforce1 enabled. User has relevant permissions.
If anyone wants to check out this in their dev org for trial. Use this page for creating a list view button and add to layout.

This is very critical. Any pointers will be appreciated.

Apex class:
public class tenPageSizeExt {

    public tenPageSizeExt(ApexPages.StandardSetController controller) {
        controller.setPageSize(10);
    }
}

VF Page:
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt">
    <apex:form >
        <apex:pageBlock title="Edit Stage and Close Date" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="opp">
                <apex:column value="{!opp.name}"/>
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}"/>
                </apex:column>
                <apex:column headerValue="Close Date">
                    <apex:inputField value="{!opp.closeDate}"/>
                </apex:column>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
    </apex:page>


Regards,
Nitish
Hello Guys,

I want to mass edit records in Napili community but VF is not supported in Napili community. I have very less handson experience in building a lightning component for this. Any pointers/examples will help.

Looking forward to below use case:
Fetch all visible records from an object.
Select records which needs to be edited.
Selected records displayed in Edit mode.
User modified some values in 3 fields of these selected records and clicks on Save.
Records are updated and displayed.

If anything standard available to achieve above, please point me towards that as well. Thanks in advance.

Regards,
Nitish
Hi Guys,

I have a custom list view VF button for mass action on my opportunity object. This works fine when I am using this on classic or Lightning experience.
Earlier there were no checkboxes for records within Napili template in list views and no button used to show up. In summer '17 release checkboxes and buttons are now showing up. But when I click on this button, wierdly enough nothing happens at all. My VF is lightning and Salesforce1 enabled. User has relevant permissions.
If anyone wants to check out this in their dev org for trial. Use this page for creating a list view button and add to layout.

This is very critical. Any pointers will be appreciated.

Apex class:
public class tenPageSizeExt {

    public tenPageSizeExt(ApexPages.StandardSetController controller) {
        controller.setPageSize(10);
    }
}

VF Page:
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt">
    <apex:form >
        <apex:pageBlock title="Edit Stage and Close Date" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="opp">
                <apex:column value="{!opp.name}"/>
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}"/>
                </apex:column>
                <apex:column headerValue="Close Date">
                    <apex:inputField value="{!opp.closeDate}"/>
                </apex:column>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
    </apex:page>


Regards,
Nitish
Hello Guys,

I want to mass edit records in Napili community but VF is not supported in Napili community. I have very less handson experience in building a lightning component for this. Any pointers/examples will help.

Looking forward to below use case:
Fetch all visible records from an object.
Select records which needs to be edited.
Selected records displayed in Edit mode.
User modified some values in 3 fields of these selected records and clicks on Save.
Records are updated and displayed.

If anything standard available to achieve above, please point me towards that as well. Thanks in advance.

Regards,
Nitish
I have created a community using the Napili template and I want all the files, that are uploaded, to get uploaded into the files object(which happens by default), as well as to Sharepoint. So, is there any way to do it without Microsoft Azure or any other 3rd party adapters?
Hi All,

I'm trying to create a Lightning Component for a Global Quick Action in order to create a detail object "Billable__c" for a Master Object "Project__c".

I've got it working in Salesforce Lightning Experience, however I'm having issues using the global quick action in the Salesforce1 app.  I'm getting the following error:
 
Error in $A.getCallback() [undefined is not an object (evaluating 'a.attributes')]
Callback failed: serviceComponent://ui.chatter.components.aura.components.forceChatter.chatter.QuickActionLoaderController/ACTION$getQuickActions
(https://stratusg.lightning.force.com/auraFW/javascript/xH6sVFQUmvLYLsBsK3q02Q/aura_prod.js:2)

Here is my component:
 
<aura:component implements="force:lightningQuickActionWithoutHeader" controller="HoursController" access="GLOBAL">
    <aura:attribute name="newBillable" type="Billable__c" default="{ 'sobjectType': 'Billable__c'}"/>
    <aura:attribute name="options" type="list" default="[{ 'class': 'optionClass', label: '- None -', value: '' }]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <div class="slds-page-header" role="banner">
        <h1 class="slds-page-header__title slds-m-right--small slds-truncate slds-align-left">Log Hours</h1>
    </div>
    <label class="slds-form-element__label">Number of Hours</label>
    <force:inputField aura:id="hours" value="{!v.newBillable.Numer_of_Hours__c}" />
    <lightning:select aura:id="project" name="project" label="Project" value="{!v.newBillable.Project__c}" required="true">
    	<aura:iteration items="{!v.options}" var="item" >
            <option text="{!item.label}" value="{!item.value}" selected="{!item.selected}"/>
        </aura:iteration>
    </lightning:select>
    <label class="slds-form-element__label">Date</label>
    <force:inputField aura:id="date" value="{!v.newBillable.Date__c}" />
    <label class="slds-form-element__label">Description</label>
    <force:inputField aura:id="desc" value="{!v.newBillable.Description__c}" />
    <lightning:button label="Save Billable" onclick="{!c.handleSaveBillable}" variant="brand" class="slds-m-top-medium"/>
</aura:component>

Here is my Controller:
 
({
    doInit : function (component, event, helper) {
        helper.loadProjects(component);
    },
    
	handleSaveBillable : function(component, event, helper) {
        var newBillable = component.get("v.newBillable");
        helper.upsertBillable(component, newBillable);
    }
})
Helper:
 
({
    loadProjects : function(component) {
        var action = component.get("c.getProjects");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === "SUCCESS") {
                //component.set("v.projects", response.getReturnValue());
                //var projects = component.get("v.projects");
        		var projects = response.getReturnValue();
                var opts = new Array();
        		opts.push({value: "", label: "- None -"});
                for(var i=0; i<projects.length; i++){
                    var p = projects[i];
                    console.log(p);
                    opts.push({value: p.Id, label: p.Name});
                }
                console.log(opts);
                component.set("v.options", opts);
            } else {
                console.log('Problem getting Projects, response state: '+state);
            }
        });
        $A.enqueueAction(action);
    },
    
    upsertBillable : function(component, billable) {
        var action = component.get("c.saveBillable");
        action.setParams({
            "billable": billable
        });
        $A.enqueueAction(action);
    }
})

Apex Controller:
 
public with sharing class HoursController {
	
    @AuraEnabled
    public static List<Project__c> getProjects(){
        return [SELECT Id, Name FROM Project__c WHERE Status__c = 'Active'];
    }
    
    @auraEnabled
    public static Billable__c saveBillable(Billable__c billable){
        upsert billable;
        return billable;
    }
}

Any help is appreciated.

 
I am struggling to add custom field to NetworkMember Object can any one tell me how to do it ??

I have a controller extension for a list view.

 

The user selects a subset of the items in the list and clicks a button that goes to my custom VF Page.

 

I want to retain the order they were selected in the list from top to bottom. So if Selected Item A is before Selected Item B when the button is clicked, that is the order I WANT them passed to the controller.

 

However, the method getSelected() on the StandardSetController does not return the items in a sorted list the same as the screen.

 

Does anyone know how to keep the selected items sorted from the previous pages list view?