function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
svpsvp 

VF Page is not working for Partner Portal users

Hi,

I have a VF page which override Opportunity.Edit button for Partner Portal; On VF page i have some code which disable the Opportunity.CloseDate when a check box is true(checked) on Opportunity. The VF page is working as expected as a standard user but not working as/for Parnter Portal user. Can any one help ?

Here is the page:

<apex:page showHeader="true" standardController="Opportunity" sidebar="false">
 <script>
//  ON LOAD FUNCTIONS
//  ----------------------------------------------------------------------------------------
    function addLoadEvent(func) {
       var oldonload = window.onload;
       if (typeof window.onload != 'function') {
          window.onload = func;
       } else {
          window.onload = function() {
             oldonload();
             func();
            }
        }
     }
    addLoadEvent(
        function() {    disableInputs();    }
    );  

     
//  DISABLE ELEMENTS
//  ----------------------------------------------------------------------------------------
    function disableInputs(){   
        y = document.getElementsByTagName("input");
            for (i=0; i<y.length; i++){
                if(y[i].className == 'disable')y[i].disabled=true;
        }
        
        
    }     
    
</script>
 <apex:composition template="PL_Template">
     <apex:define name="content">
        <apex:actionRegion immediate="true">
        <apex:form >

      <apex:pageBlock title="{!$Label.PRM_General_Opportunity_Edit}" mode="maindetail" id="opportunityPageBlock">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="{!$Label.PRM_General_Save}" id="saveCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!saveAndNew}" value="{!$Label.PRM_General_Save_and_New}" id="saveAndNewCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!cancel}" value="{!$Label.PRM_General_Cancel}" id="cancelCommandLink" immediate="true"/>
            </apex:pageBlockButtons>
      <!-- Opportunity Information Fields -->
            <apex:pageBlockSection title="{!$Label.PRM_General_Opportunity_Information}" columns="2" collapsible="false" id="opportunityInformationPageBlock">
                <apex:repeat value="{!$ObjectType.Opportunity.FieldSets.Opportunity_Information}" var="opportunityInformationFields">
                    <apex:inputField value="{!opp[opportunityInformationFields]}" required="{!opportunityInformationFields.Required}" styleClass="{!IF(opportunityInformationFields.FieldPath = 'CloseDate'&& Opportunity.LOCK__c,'disable','')}"/>
                </apex:repeat>
            </apex:pageBlockSection>

    </apex:pageBlock>
        
    </apex:form>
    </apex:actionRegion>
    </apex:define>
  </apex:composition>
</apex:page>

Any help must be appreciated ?

 

 

Best Regards.

Best Answer chosen by Admin (Salesforce Developers) 
svpsvp

This is fixed.

Opportunity.LOCK__c is set to hidden for Portal profiles at field Accessibility ,  changing the field Accessibility from hidden to visible/read only fixed the issue.

 

Thanks!!

All Answers

tproencatproenca

I'm having exactly the same problem. It doesn't authenticate partner portal users. Anybody has any workaround for that?

svpsvp

This is fixed.

Opportunity.LOCK__c is set to hidden for Portal profiles at field Accessibility ,  changing the field Accessibility from hidden to visible/read only fixed the issue.

 

Thanks!!

This was selected as the best answer