• subhash-cog
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi,

 

We are facing weird issue in custom mass edit functionality which we have developed by using standard list controller

 

VF page:-----

<apex:page standardController="Opportunity" recordSetVar="opportunities" extensions="selectedSizeWorkaround" tabStyle="Opportunity" sidebar="true" id="muopp">

    <apex:form id="muform">
   
        <apex:pageBlock title="Opportunity Mass-edit" mode="edit" id="mub1">
            <apex:pageMessages />
            <apex:pageBlockButtons >
               <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockTable value="{!selected}" var="opp" id="muform">
                <apex:column value="{!opp.Id}"/>
                <apex:column value="{!opp.name}"/>
                <apex:column value="{!opp.AccountId}"/>
                <apex:column value="{!opp.Application_Number__c}"/>
                <apex:column value="{!opp.Application_Date__c}"/>
                <apex:column value="{!opp.Amount}"/>
                <apex:column value="{!opp.StageName}"/>                              
                <apex:column headerValue="Probability">
                     <apex:inputField value="{!opp.Probability}" id="stagename">
                    <apex:actionSupport event="onchange" rerender="muselectedlist"/>
                </apex:inputField>
                </apex:column>               
             </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>


Controller extension:----------------------------------

public class selectedSizeWorkaround {

    ApexPages.StandardSetController setCon;

    public selectedSizeWorkaround(ApexPages.StandardSetController controller) {
        setCon = controller;
    }

    public integer getMySelectedSize() {
        return setCon.getSelected().size();
    }
    public integer getMyRecordsSize() {
        return setCon.getRecords().size();
    }
}

Eventhough this code works and successfully edit the probability value of selected records provided the create permission on Opportunity object to the user (i.e. user's profile).
If the user doesnot have create permission on Opportunity and only have read and create permission on Opportunity,then he can not edit that.
As per our setup we can't give the create permision on opportunity (though those users have edit and read permission on Opportunity)to the users who wants to use mass edit custom functionlity


This is something wierd issue i am facing,if somebody faced this issue please let me know and if any workaround.
we can not use mass edit app exchange as well as we want to show only probability for edit to the users and not all fields.

 

Thanks,

Hi,

 

We are facing weird issue in custom mass edit functionality which we have developed by using standard list controller

 

VF page:-----

<apex:page standardController="Opportunity" recordSetVar="opportunities" extensions="selectedSizeWorkaround" tabStyle="Opportunity" sidebar="true" id="muopp">

    <apex:form id="muform">
   
        <apex:pageBlock title="Opportunity Mass-edit" mode="edit" id="mub1">
            <apex:pageMessages />
            <apex:pageBlockButtons >
               <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockTable value="{!selected}" var="opp" id="muform">
                <apex:column value="{!opp.Id}"/>
                <apex:column value="{!opp.name}"/>
                <apex:column value="{!opp.AccountId}"/>
                <apex:column value="{!opp.Application_Number__c}"/>
                <apex:column value="{!opp.Application_Date__c}"/>
                <apex:column value="{!opp.Amount}"/>
                <apex:column value="{!opp.StageName}"/>                              
                <apex:column headerValue="Probability">
                     <apex:inputField value="{!opp.Probability}" id="stagename">
                    <apex:actionSupport event="onchange" rerender="muselectedlist"/>
                </apex:inputField>
                </apex:column>               
             </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>


Controller extension:----------------------------------

public class selectedSizeWorkaround {

    ApexPages.StandardSetController setCon;

    public selectedSizeWorkaround(ApexPages.StandardSetController controller) {
        setCon = controller;
    }

    public integer getMySelectedSize() {
        return setCon.getSelected().size();
    }
    public integer getMyRecordsSize() {
        return setCon.getRecords().size();
    }
}

Eventhough this code works and successfully edit the probability value of selected records provided the create permission on Opportunity object to the user (i.e. user's profile).
If the user doesnot have create permission on Opportunity and only have read and create permission on Opportunity,then he can not edit that.
As per our setup we can't give the create permision on opportunity (though those users have edit and read permission on Opportunity)to the users who wants to use mass edit custom functionlity


This is something wierd issue i am facing,if somebody faced this issue please let me know and if any workaround.
we can not use mass edit app exchange as well as we want to show only probability for edit to the users and not all fields.

 

Thanks,