• Sarvesh_Ojha
  • NEWBIE
  • 35 Points
  • Member since 2016

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

We have requirement where in we need to display fields based on the checkbox selected .I have written a VF page and Apex classe but still not able to acieve the requirement below are the few points i am trying to achieve.
1. When first checkbox is selected second checkbox should be hidden and viceversa.
2. Also we need to clear the values from the  dependent fields in the pageblock section on unchecked box.

Any lead or steps to achieve this is very hepfull.

Thanks in Advance.
Visualforce Page:


<apex:page standardController="Opportunity" extensions="rpac">

<apex:form >
<apex:pageBlock >
  <apex:pageBlockSection columns="1" id="Test" >
 <apex:inputcheckbox value="{!Opportunity.abc__c}" >
 <apex:actionSupport event="onchange"  action="{!aaa}" rerender="Test" />
</apex:inputcheckbox>
  <!--<apex:outputPanel rendered="{!(Opportunity.abc__c)}" > -->
		<apex:inputField value="{!Opportunity.abc__c}"  rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Class__c}" rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Transition_Phase__c}" rendered="{!(Opportunity.abc__c)}" />
   </apex:pageBlockSection>
   
   <apex:pageBlockSection columns="1" id="Test1" > 
     <apex:inputcheckbox value="{!Opportunity.xyz__c}" > <!--removed selected=true label="Same as Above" -->
     <apex:actionSupport event="onchange" action="{!bbb}" rerender="Test1" />
     </apex:inputcheckbox>    
        <apex:inputField value="{!Opportunity.ayz_Payment_Terms__c}" rendered="{!(Opportunity.xyz__c)}" />
        <apex:inputField value="{!Opportunity.xyz_Record_Delete__c}" rendered="{!(Opportunity.xyz__c)}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


Apex class:

public with sharing class Repack{

    public Opportunity test{get;set;}
    public Opportunity test1{get;set;}
    public boolean abc {get;set;}
    public boolean ayz{get;set;}

        public Repack(ApexPages.StandardController stdCtrl) {
        this.test=(Opportunity)stdCtrl.getRecord();
        abc=False;
        this.test1=(Opportunity)stdCtrl.getRecord();
        ayz= False;
        //this.test=true;//observe the change in this line.Added this for proper behaviour on load 
       }
       
       public pagereference aaa(){
           
           return null;
       }
       public pagereference bbb(){
           
           return null;
       }

   }

User-added image
I have requirement of sharing the access of the records due to increase in business.
I have business say in 50 countries, wherein I have Sales Users, Key Users, Super Admin, System Admin

Requirement:

1. Sales users should not see each other's records.
2. Key Users can see respective countries sales users record but not the other countries records. Some of the Key Users can see other countries record as per Business. They can delete the record and generate the report.
3. Super Admin - Access to all data of 10 countries but not like system Admin.

Note that I have 4 business line, 25 reporting line and 40 sub reporting line.

Please guide me how to move ahead with profiles, roles and permission sets, How to setup the sharing setting. 
Hi Team,

How can we attach the event to a new opportunity?

Regards
Lakshmi

We have requirement where in we need to display fields based on the checkbox selected .I have written a VF page and Apex classe but still not able to acieve the requirement below are the few points i am trying to achieve.
1. When first checkbox is selected second checkbox should be hidden and viceversa.
2. Also we need to clear the values from the  dependent fields in the pageblock section on unchecked box.

Any lead or steps to achieve this is very hepfull.

Thanks in Advance.
Visualforce Page:


<apex:page standardController="Opportunity" extensions="rpac">

<apex:form >
<apex:pageBlock >
  <apex:pageBlockSection columns="1" id="Test" >
 <apex:inputcheckbox value="{!Opportunity.abc__c}" >
 <apex:actionSupport event="onchange"  action="{!aaa}" rerender="Test" />
</apex:inputcheckbox>
  <!--<apex:outputPanel rendered="{!(Opportunity.abc__c)}" > -->
		<apex:inputField value="{!Opportunity.abc__c}"  rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Class__c}" rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Transition_Phase__c}" rendered="{!(Opportunity.abc__c)}" />
   </apex:pageBlockSection>
   
   <apex:pageBlockSection columns="1" id="Test1" > 
     <apex:inputcheckbox value="{!Opportunity.xyz__c}" > <!--removed selected=true label="Same as Above" -->
     <apex:actionSupport event="onchange" action="{!bbb}" rerender="Test1" />
     </apex:inputcheckbox>    
        <apex:inputField value="{!Opportunity.ayz_Payment_Terms__c}" rendered="{!(Opportunity.xyz__c)}" />
        <apex:inputField value="{!Opportunity.xyz_Record_Delete__c}" rendered="{!(Opportunity.xyz__c)}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


Apex class:

public with sharing class Repack{

    public Opportunity test{get;set;}
    public Opportunity test1{get;set;}
    public boolean abc {get;set;}
    public boolean ayz{get;set;}

        public Repack(ApexPages.StandardController stdCtrl) {
        this.test=(Opportunity)stdCtrl.getRecord();
        abc=False;
        this.test1=(Opportunity)stdCtrl.getRecord();
        ayz= False;
        //this.test=true;//observe the change in this line.Added this for proper behaviour on load 
       }
       
       public pagereference aaa(){
           
           return null;
       }
       public pagereference bbb(){
           
           return null;
       }

   }

User-added image
I want to update a field of Opportunity object with a time dependent workflow action. I have created a workflow rule and added a criteria. it is
CloseDate LESS THAN Today
I added time dependent action as field update and it will fire 1 hour after rule trigger date.
I activated the rule.When i check the time based workflow queue my workflow rule is not listing there. can any one please help me to resolve this issue. any help will be liked.

Thanks,
Balayesu
Hi, while using developer console, I've encountered the following error. This is very disruptive to me. I have tried logging back out but that didn't work. 

Please do assist me on this issue. Thank you.
Hi Evryone ,
   I have this pretty simple code given below. Now everything works well here. What i want to do is, rather than the record being displayed as a 1 row with 3 columns. I want it to be displayed as 1 column 3 rows. Can anyone please help me with this?

Current Display Format : Name, Narrative Technical, Narrative Staffing
Desired Display Format : Name 1
                                             Narrative Technical 1
                                             Narrative Staffing 1
                                         Name 2
                                             Narrative Technical 2
                                             Narrative Staffing 2

<apex:page standardController="Project_Form__c" recordSetVar="ProjectForms">
    <apex:sectionHeader title="Form History"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />

            <apex:pageBlockSection title="Selected Project Review Forms" columns="1">
                 <apex:pageBlockTable value="{!selected}" var="form" columns="3">
                    <apex:column value="{!form.name}"/>
                    <apex:column value="{!form.Narrative_Technical__c}"/><br></br>
                    <apex:column value="{!form.Narrative_Staffing__c}"/><br></br>
                  </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>