• Girish Nallamothu 20
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I want to disable or hide commandbutton for users belong to two public groups "MMC: L1" and "MMC: L2". Please guide me.

VF page:
 <apex:pageBlockButtons >
   <apex:commandButton value="Save & Unlock"   action="{!saveAndUnlock}" styleClass="saveButton"/>
    </apex:pageBlockButtons>

Controller:
public PageReference saveAndUnlock() {
        
        if(!isNotAllwToSave())
            return null;

        if(!isOkToSave())
            return null;

        // update medical chart record...
        this.codingChart.Record_Lock__c = false;
        codingChart.Record_Lock_User__c = null;

        try {
            this.codingChart.Record_Lock__c = false;
            this.codingChart.Record_Lock_User__c = null;
            this.codingChart.Status__c = selectedStatusOption;
            this.codingChart.Saved_Record_Status_Check__c = false; 
            update this.codingChart;
            saveDxCodes();

        } catch(Exception ex) {
            Apexpages.addMessages(ex);
            return null;
        }
        deleteWorkingCodes();
       return new PageReference('/apex/MC_ChartsTab'); //Redirect to charts queue
    }
  • February 15, 2018
  • Like
  • 0
I want to disable or hide commandbutton for users belong to two public groups "MMC: L1" and "MMC: L2". Please guide me.

VF page:
 <apex:pageBlockButtons >
   <apex:commandButton value="Save & Unlock"   action="{!saveAndUnlock}" styleClass="saveButton"/>
    </apex:pageBlockButtons>

Controller:
public PageReference saveAndUnlock() {
        
        if(!isNotAllwToSave())
            return null;

        if(!isOkToSave())
            return null;

        // update medical chart record...
        this.codingChart.Record_Lock__c = false;
        codingChart.Record_Lock_User__c = null;

        try {
            this.codingChart.Record_Lock__c = false;
            this.codingChart.Record_Lock_User__c = null;
            this.codingChart.Status__c = selectedStatusOption;
            this.codingChart.Saved_Record_Status_Check__c = false; 
            update this.codingChart;
            saveDxCodes();

        } catch(Exception ex) {
            Apexpages.addMessages(ex);
            return null;
        }
        deleteWorkingCodes();
       return new PageReference('/apex/MC_ChartsTab'); //Redirect to charts queue
    }
  • February 15, 2018
  • Like
  • 0