• Anish Mahadik 1
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 10
    Replies
I have requirement to show the counter variable in Salesforce reporting.
This counter variable is nothing but no. of times the user clicks on the hyperlink. So for these i have already created the counter with below logic and i just want to know how can i used this variable in my reporting for Lightning version.

<aura:attribute name="counter1" default="0" type="integer"/>          <lightning:button variant="Test1" label="Click" onclick="{!c.handleClick }" />  Counter value is : {!v.counter1}  

({     handleClick : function(component, event, helper) {         component.set('v.counter1',component.get('v.counter1')+1);              } })

Please let me know how i can used this variable for reporting in Lightning.
Hi All,

I am new to Salesforce Lightning version . I am trying to achieved the requirement as shown in attachment . I have already tried so many custom componenets (ex.card, boxes,listview etc) but i am unable to achieved my requirement . So please need some inputs from experts. 

Thanks,
AnishLightning requirement
Hi All,

I need to use multiple action methods on single fields which has multiple picklist values. (1. Redirect to new page for few values of picklist and 2. To show additional fields on one picklist values. 

Please let me know how can i achieve this in Vf  page.

Thanks in advance,
Anish
 
Hi All,

I have picklist component with 5 (A,B,C,D,E) values. and my requirement is when user select A or B then it will redirect to  the new VF page else it will remain on same page for other Values selection.

Thanks,
Anish
Hi All,

I have design the application in which 3 fields are dependent fields. (2 Picklist and 1 Multivalue Picklist). 
Please see the image, Line of Business is dependent on Select Organization for this request and Product (Which is Multivalue picklist) is dependent on Line of Business.
But Product part is not working for my case after submitting the request. Please can you suggest any alternative to resolve this issue.


User-added image
 
Hi All,

It is my Request page and Highlighted fields are Dropdown fields which are controlled by same fields (Ex.Product is controlled by Line of business and Line of business is controlled by Select the Organizations for these request.)
Vf Page issue

Problem is that Line of business did not populate anything once the What service are you looking for? Field selected. Line of business populate data when i deselect  What service are you looking for?  field.

Please see the below VF page coding.

<apex:pageblocksection columns="1" id="Requestor" title="Request Details" >
                            <apex:outputPanel >
                         <apex:inputField value="{!CCMNewRequest.What_service_are_you_looking_for__c}" >
                                                     <apex:actionSupport event="onchange" reRender="RequestorSection1,dummy,Requestor,FormId,CoSA" status="SearchStatus"/>                                   
</apex:inputField>

                            </apex:outputPanel>    
                        </apex:pageblocksectionItem>
                       
                    </apex:outputpanel>
 
                        <apex:pageblocksectionItem >
                            <apex:outputlabel value="Are you submitting on another person's behalf?" style="width:5px"> </apex:outputLabel>       
                            <apex:outputPanel >
                                                             
                                    <apex:inputField value="{!CCMNewRequest.Are_You_Submitting_on_Another_s_Behalf__c}" >
                                        <apex:actionSupport event="onchange"   reRender="RequestorSection,dummy" status="SearchStatus"/>
                                    </apex:inputField>
                                  </apex:outputPanel>    
                        </apex:pageblocksectionItem>
                       
                        </apex:pageBlockSection>
                                   
                      <apex:outputpanel id="RequestorSection" >  
                    <apex:outputpanel id="test">
                    <apex:pageblockSection id="CoSA" columns="1" >  
                        <apex:pageblocksectionItem >
                            <apex:outputlabel value="Is your request assigned to an Enterprise Project Manager?"  style="width:100px;" >                                    
                            </apex:outputLabel>
                            <apex:outputPanel >
                                 <apex:inputField value="{!CCMNewRequest.Is_your_request_assigned_to_an_Ent_PM__c }"   required="false"    >
                                        <apex:actionSupport event="onchange"  reRender="CoSA" status="SearchStatusprjmail"/>
                                    </apex:inputfield>
                             
                            </apex:outputPanel>
                          </apex:pageblocksectionItem> 
                       
                                             
                                                   <apex:pageblockSectionItem  >
                            <apex:outputLabel value="Select the organization(s) for this request "  >
                               
                            </apex:outputLabel>
                            
                            
                                <apex:inputField value="{!CCMNewRequest.Select_the_org_s_for_this_request__c}" styleClass="required" style="float:left;margin-left:13px;width:150px">
                                    <apex:actionSupport event="onchange" reRender="maillink,pocSection1,CoSA"  status="SearchStatuscom"/>
                                </apex:inputField></apex:actionRegion>
                                </apex:outputPanel>
                          
                        </apex:pageblockSectionItem> 
                       
                            <apex:pageblocksectionItem >           
                            <apex:outputlabel value="Line of Business" >
                               </apex:outputlabel>
                            <apex:outputpanel >                
                                <apex:inputField value="{!CCMNewRequest.Line_of_Business__c}" id="line" styleClass="required" style="float:left;margin-left:13px;width:150px"/>
                                <apex:actionSupport event="onchange"  reRender="maillink,pocSection1"   status="SearchStatuscom"/>
                               
                            </apex:outputpanel>
                         </apex:pageBlockSectionItem>
  
                               <apex:pageblocksectionItem >           
                          <apex:outputlabel value="Product" >
                                </apex:outputlabel>
                           <apex:outputpanel > 
                                <apex:inputField value="{!CCMNewRequest.Product__c}" id="product" styleClass="required" />
                               <apex:actionSupport event="onchange"  action="{!getProductValues}" reRender="maillink,pocSection1"   status="SearchStatuscom"/>


 
Hi All,

I need to create field which give the user option to browse and upload document. Please help on these.

Thanks,
Anish
Hi All,

I am getting an error of "Insufficient access right on cross reference id" while loading data.

Please help.

Thanks,
Anish
Hi all,

I am unable to create the test class for cancel button. I tried but got error 
 Argument 1 cannot be null.
Please provide the test class for following code

   public pagereference cancel()
    {
     
       PageReference reqPageRef = new PageReference(ApexPages.currentPage().getParameters().get('retURL')); 
       reqPageRef.setRedirect(true);  
       return reqPageRef;
    }

Thanks
I am getting following errors while deploying code to production but i am not getting any error in sandbox and test environment.
Please find the details below:
System.DmlException: Update failed. First exception on row 0 with id a275000000Vy68ZAAR; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, : execution of BeforeUpdate
Thanks, Anish
Hi All,

Following is the apex code for which i am unable to create test class for readonlyfieldmap. Please help me.
public void doQuery( String recId) {
String query='SELECT Id,RecordType.Name '+formQuery()+' FROM Test_Tool__c WHERE ID =:recId';
edaoTest = new Test_Tool__c(); edaoTest =Database.query(query); selectedTestType =edaoTest.Test_Type__c; if(edaoTest.Issue_Status__c == 'Submitted' || edaoTest.Issue_Status__c == 'Under Review' ||edaoTest.Issue_Status__c == 'IMP to be worked') { // isRerouteEnabledOnStatus = true; readOnlyFieldsMap.put('Test_Name__c',false); } // else if(edaoTest.Issue_Status__c == 'IMP to be worked') // { // readOnlyFieldsMap.put('Test_Name__c',false); // isRerouteEnabledOnStatus = false; // } else if(edaoTest.Issue_Status__c == 'Test Complete') { readOnlyFieldsMap.put('Actual_Hours__c',true); // readOnlyFieldsMap.put('CEO_Strategic_Priority__c',true); readOnlyFieldsMap.put('Issue_Status__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('TestsonValidationStatus__c',true); readOnlyFieldsMap.put('Tests_on_Withdrawn_Status__c',true); readOnlyFieldsMap.put('IMP_Test__c',true); readOnlyFieldsMap.put('IMP_Test_2__c',true); readOnlyFieldsMap.put('IMP_Test_3__c',true); readOnlyFieldsMap.put('IMP_Test_4__c',true); readOnlyFieldsMap.put('IMP_Test_5__c',true); readOnlyFieldsMap.put('Estimated_Start_Date__c',true); readOnlyFieldsMap.put('Estimated_Completion_Date__c',true); // readOnlyFieldsMap.put('New_or_Modified_UDA__c',true); // readOnlyFieldsMap.put('Governance_Approval_Granted__c',true); // readOnlyFieldsMap.put('Data_Sensitivity__c',true); // readOnlyFieldsMap.put('Data_Sources_Utilized__c',true); // readOnlyFieldsMap.put('Other_Tool_Technology_Utilitzed__c',true); readOnlyFieldsMap.put('Other_Type_of_Service__c',true); // readOnlyFieldsMap.put('Collaboration_Entities__c',true); // readOnlyFieldsMap.put('Collaborative_Test_Indicator__c',true); readOnlyFieldsMap.put('Ent_Test_Hrs__c',true); // readOnlyFieldsMap.put('Testected_Hours_Change_Reason__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); // readOnlyFieldsMap.put('Tools_Technologies_Utilized__c',true); // readOnlyFieldsMap.put('Testect_ID__c',false); readOnlyFieldsMap.put('What_Test_is_Testing_this__c',true); readOnlyFieldsMap.put('What_Business_Unit_is_Testing_this__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Type_of_Works_Performed__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); readOnlyFieldsMap.put('Test_Learn_Phase__c',true); readOnlyFieldsMap.put('EBS_Priority__c',true); readOnlyFieldsMap.put('Planned_or_unplanned__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); readOnlyFieldsMap.put('Test__c',true); readOnlyFieldsMap.put('Total_Hrs__c',true); readOnlyFieldsMap.put('Testected_Hours__c',true); readOnlyFieldsMap.put('Actual_Hours_History__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Testected_Hours_History__c',true); // readOnlyFieldsMap.put('ReRoute_History__c',true); // readOnlyFieldsMap.put('Reroute_Date__c',true); readOnlyFieldsMap.put('Initiated_Date__c',true); readOnlyFieldsMap.put('In_Progress__c',true); readOnlyFieldsMap.put('In_Validation__c',true); readOnlyFieldsMap.put('Validation_Completed_on__c',true); readOnlyFieldsMap.put('Completed__c',true); readOnlyFieldsMap.put('Withdrawn__c',true); readOnlyFieldsMap.put('On_Hold__c',true); readOnlyFieldsMap.put('TestInitiated__c',true); readOnlyFieldsMap.put('TestInQueue__c',true); readOnlyFieldsMap.put('TestValidating__c',true); readOnlyFieldsMap.put('TestWorking__c',true);
} else { // isRerouteEnabledOnStatus = false; readOnlyFieldsMap.put('Test_Name__c',false); }
/* if(edaoTest.Issue_Status__c =='Tester Validation' || edaoTest.Issue_Status__c == 'Validation Complete'|| edaoTest.Issue_Status__c == 'Result Not Valid') { readOnlyFieldsMap.put('Validation_Status__c',false); }*/ if(edaoTest.Issue_Status__c=='On Hold' ||edaoTest.Issue_Status__c=='Withdrawn')
{ // readOnlyFieldsMap.put('Testect_ID__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); // readOnlyFieldsMap.put('UDA_Catalog_ID__c',true); readOnlyFieldsMap.put('Test__c',true); } else { readOnlyFieldsMap.put('Validation_Status__c',true); }
/* if(edaoTest.What_Test_is_Testing_this__c =='Other' ||edaoTest.What_Business_Unit_is_Testing_this__c =='Not Listed') { readOnlyFieldsMap.put('Other_Type_of_Service__c',false); }
*/ if(edaoTest.Issue_Status__c != 'Test Complete' && relatedListFlag == False) { readOnlyFieldsMap.put('Actual_Hours__c',true); // readOnlyFieldsMap.put('CEO_Strategic_Priority__c',true); readOnlyFieldsMap.put('Issue_Status__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('TestsonValidationStatus__c',true); readOnlyFieldsMap.put('Tests_on_Withdrawn_Status__c',false); readOnlyFieldsMap.put('IMP_Test__c',true); readOnlyFieldsMap.put('IMP_Test_2__c',true); readOnlyFieldsMap.put('IMP_Test_3__c',true); readOnlyFieldsMap.put('IMP_Test_4__c',true); readOnlyFieldsMap.put('IMP_Test_5__c',true); readOnlyFieldsMap.put('Estimated_Start_Date__c',true); readOnlyFieldsMap.put('Estimated_Completion_Date__c',true); // readOnlyFieldsMap.put('New_or_Modified_UDA__c',true); // readOnlyFieldsMap.put('Governance_Approval_Granted__c',true); // readOnlyFieldsMap.put('Data_Sensitivity__c',true); // readOnlyFieldsMap.put('Data_Sources_Utilized__c',true); // readOnlyFieldsMap.put('Other_Tool_Technology_Utilitzed__c',true); readOnlyFieldsMap.put('Other_Type_of_Service__c',true); // readOnlyFieldsMap.put('Collaboration_Entities__c',true); // readOnlyFieldsMap.put('Collaborative_Test_Indicator__c',true); readOnlyFieldsMap.put('Ent_Test_Hrs__c',true); // readOnlyFieldsMap.put('Testected_Hours_Change_Reason__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); // readOnlyFieldsMap.put('Tools_Technologies_Utilized__c',true); // readOnlyFieldsMap.put('Testect_ID__c',false); readOnlyFieldsMap.put('What_Test_is_Testing_this__c',true); readOnlyFieldsMap.put('What_Business_Unit_is_Testing_this__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Type_of_Works_Performed__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',false); readOnlyFieldsMap.put('Test_Learn_Phase__c',true); readOnlyFieldsMap.put('EBS_Priority__c',true); readOnlyFieldsMap.put('Planned_or_unplanned__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); readOnlyFieldsMap.put('Test__c',true); readOnlyFieldsMap.put('Total_Hrs__c',true); readOnlyFieldsMap.put('Testected_Hours__c',true); readOnlyFieldsMap.put('Actual_Hours_History__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Testected_Hours_History__c',true); // readOnlyFieldsMap.put('ReRoute_History__c',true); // readOnlyFieldsMap.put('Reroute_Date__c',true); readOnlyFieldsMap.put('Initiated_Date__c',true); readOnlyFieldsMap.put('In_Progress__c',true); readOnlyFieldsMap.put('In_Validation__c',true); readOnlyFieldsMap.put('Validation_Completed_on__c',true); readOnlyFieldsMap.put('Completed__c',true); readOnlyFieldsMap.put('Withdrawn__c',true); readOnlyFieldsMap.put('On_Hold__c',true); readOnlyFieldsMap.put('TestInitiated__c',true); readOnlyFieldsMap.put('TestInQueue__c',true); readOnlyFieldsMap.put('TestValidating__c',true); readOnlyFieldsMap.put('TestWorking__c',true); readOnlyFieldsMap.put('Description__c',true); readOnlyFieldsMap.put('Test_Name__c',true);
readOnlyFieldsMap.put('What_is_the_Business_Benefit__c',true);
readOnlyFieldsMap.put('Priority__c',true);
readOnlyFieldsMap.put('Document_Link__c',true);
}
readOnlyFieldsMap.put('Test_Type__c',true); readOnlyFieldsMap.put('Opt_in_for_Email_notification__c',true); readOnlyFieldsMap.put('Tests_History__c',true); }
Thanks,
Anish
Hi All,

I have created the permission set with read as well as edit access to all objects and fields. But my app is not displaying default values which i have set up for fields. I have admin access so i can view the default value when i open the application but it is not showing for users to whom permission sets has been assign. Please let me know if anything i m missing

Thanks,
Anish
Hi All,

I have created the permission set and assign read only access to all the fields of the object. Here my requirement is to give edit access to few fields but when i check Edit access in field permission for those particular fields of the object then it is not working and suppose if i give the access in object permission then all the fields become editable. I need on those few fields which should be editable for that permission set.

Thanks,
Anish
Hi All,
I am trying to hide the custom button based on permission set.For that i already wrote a code but it is giving me an error.

 public void Custombutton()
         {
                for(PermissionSetAssignment permission : [SELECT Id, PermissionSet.Name FROM PermissionSetAssignment WHERE AssigneeId =:UserInfo.getUserId() ])
            {
                 permissionSetNameList.add(permission.PermissionSet.Name); 
                                          
            }          
            userPermissionList.addAll(permissionSetNameList);   
            
            for(User userIterator : [SELECT Id, Profile.Name FROM User WHERE Id =: UserInfo.getUserId()])
            {
                userProfileSet.add(userIterator.Profile.Name);
            }                 
            if( userPermissionList.contains('Test_Permission')== true)
            {
                relatedListFlag = true;       
            } 

I called the Custombutton() in controller .
Afte that i added the relatedListflag in rendered property of the button.

Vf Page Code
<apex:commandButton id="hideEditbtn1" Styleclass="btn btn-primary" action="{!makeFormEdit}" rendered="{!!isEditMode && relatedListFlag}" value="Edit" reRender="contentPanel,actProjHist,formId" oncomplete="loadToggle();hidePOC();showHeader();hideHelptext();"> </apex:commandButton> &nbsp;&nbsp;  

But when i tested the app with  Test_Permission . it is giving me an error
  System.NullPointerException: Attempt to de-reference a null object       

Please help me on this.

Thanks,
Anish  
 
Hi All,

I have custom button (Edit and clone ) in my VF page and my requirement is for one particular permission set i need to hide those button which i created using commandbutton expression. Please help me on these.

Thanks,
Anish
Hi All,

I am facing a problem to change the font color of fielset label based on conditional formatting.
<apex:outputLabel Value="{!reqField.Label}" styleClass="{!if(reqField.label=='Enter Business Unit if "Others"','green','red')}" />

Please help me on these. I am getting Expression unbalanced Error.

Thanks,
Anish
I have requirement to show the counter variable in Salesforce reporting.
This counter variable is nothing but no. of times the user clicks on the hyperlink. So for these i have already created the counter with below logic and i just want to know how can i used this variable in my reporting for Lightning version.

<aura:attribute name="counter1" default="0" type="integer"/>          <lightning:button variant="Test1" label="Click" onclick="{!c.handleClick }" />  Counter value is : {!v.counter1}  

({     handleClick : function(component, event, helper) {         component.set('v.counter1',component.get('v.counter1')+1);              } })

Please let me know how i can used this variable for reporting in Lightning.
Hi All,

It is my Request page and Highlighted fields are Dropdown fields which are controlled by same fields (Ex.Product is controlled by Line of business and Line of business is controlled by Select the Organizations for these request.)
Vf Page issue

Problem is that Line of business did not populate anything once the What service are you looking for? Field selected. Line of business populate data when i deselect  What service are you looking for?  field.

Please see the below VF page coding.

<apex:pageblocksection columns="1" id="Requestor" title="Request Details" >
                            <apex:outputPanel >
                         <apex:inputField value="{!CCMNewRequest.What_service_are_you_looking_for__c}" >
                                                     <apex:actionSupport event="onchange" reRender="RequestorSection1,dummy,Requestor,FormId,CoSA" status="SearchStatus"/>                                   
</apex:inputField>

                            </apex:outputPanel>    
                        </apex:pageblocksectionItem>
                       
                    </apex:outputpanel>
 
                        <apex:pageblocksectionItem >
                            <apex:outputlabel value="Are you submitting on another person's behalf?" style="width:5px"> </apex:outputLabel>       
                            <apex:outputPanel >
                                                             
                                    <apex:inputField value="{!CCMNewRequest.Are_You_Submitting_on_Another_s_Behalf__c}" >
                                        <apex:actionSupport event="onchange"   reRender="RequestorSection,dummy" status="SearchStatus"/>
                                    </apex:inputField>
                                  </apex:outputPanel>    
                        </apex:pageblocksectionItem>
                       
                        </apex:pageBlockSection>
                                   
                      <apex:outputpanel id="RequestorSection" >  
                    <apex:outputpanel id="test">
                    <apex:pageblockSection id="CoSA" columns="1" >  
                        <apex:pageblocksectionItem >
                            <apex:outputlabel value="Is your request assigned to an Enterprise Project Manager?"  style="width:100px;" >                                    
                            </apex:outputLabel>
                            <apex:outputPanel >
                                 <apex:inputField value="{!CCMNewRequest.Is_your_request_assigned_to_an_Ent_PM__c }"   required="false"    >
                                        <apex:actionSupport event="onchange"  reRender="CoSA" status="SearchStatusprjmail"/>
                                    </apex:inputfield>
                             
                            </apex:outputPanel>
                          </apex:pageblocksectionItem> 
                       
                                             
                                                   <apex:pageblockSectionItem  >
                            <apex:outputLabel value="Select the organization(s) for this request "  >
                               
                            </apex:outputLabel>
                            
                            
                                <apex:inputField value="{!CCMNewRequest.Select_the_org_s_for_this_request__c}" styleClass="required" style="float:left;margin-left:13px;width:150px">
                                    <apex:actionSupport event="onchange" reRender="maillink,pocSection1,CoSA"  status="SearchStatuscom"/>
                                </apex:inputField></apex:actionRegion>
                                </apex:outputPanel>
                          
                        </apex:pageblockSectionItem> 
                       
                            <apex:pageblocksectionItem >           
                            <apex:outputlabel value="Line of Business" >
                               </apex:outputlabel>
                            <apex:outputpanel >                
                                <apex:inputField value="{!CCMNewRequest.Line_of_Business__c}" id="line" styleClass="required" style="float:left;margin-left:13px;width:150px"/>
                                <apex:actionSupport event="onchange"  reRender="maillink,pocSection1"   status="SearchStatuscom"/>
                               
                            </apex:outputpanel>
                         </apex:pageBlockSectionItem>
  
                               <apex:pageblocksectionItem >           
                          <apex:outputlabel value="Product" >
                                </apex:outputlabel>
                           <apex:outputpanel > 
                                <apex:inputField value="{!CCMNewRequest.Product__c}" id="product" styleClass="required" />
                               <apex:actionSupport event="onchange"  action="{!getProductValues}" reRender="maillink,pocSection1"   status="SearchStatuscom"/>


 
Hi All,

I need to create field which give the user option to browse and upload document. Please help on these.

Thanks,
Anish
Hi All,

Following is the apex code for which i am unable to create test class for readonlyfieldmap. Please help me.
public void doQuery( String recId) {
String query='SELECT Id,RecordType.Name '+formQuery()+' FROM Test_Tool__c WHERE ID =:recId';
edaoTest = new Test_Tool__c(); edaoTest =Database.query(query); selectedTestType =edaoTest.Test_Type__c; if(edaoTest.Issue_Status__c == 'Submitted' || edaoTest.Issue_Status__c == 'Under Review' ||edaoTest.Issue_Status__c == 'IMP to be worked') { // isRerouteEnabledOnStatus = true; readOnlyFieldsMap.put('Test_Name__c',false); } // else if(edaoTest.Issue_Status__c == 'IMP to be worked') // { // readOnlyFieldsMap.put('Test_Name__c',false); // isRerouteEnabledOnStatus = false; // } else if(edaoTest.Issue_Status__c == 'Test Complete') { readOnlyFieldsMap.put('Actual_Hours__c',true); // readOnlyFieldsMap.put('CEO_Strategic_Priority__c',true); readOnlyFieldsMap.put('Issue_Status__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('TestsonValidationStatus__c',true); readOnlyFieldsMap.put('Tests_on_Withdrawn_Status__c',true); readOnlyFieldsMap.put('IMP_Test__c',true); readOnlyFieldsMap.put('IMP_Test_2__c',true); readOnlyFieldsMap.put('IMP_Test_3__c',true); readOnlyFieldsMap.put('IMP_Test_4__c',true); readOnlyFieldsMap.put('IMP_Test_5__c',true); readOnlyFieldsMap.put('Estimated_Start_Date__c',true); readOnlyFieldsMap.put('Estimated_Completion_Date__c',true); // readOnlyFieldsMap.put('New_or_Modified_UDA__c',true); // readOnlyFieldsMap.put('Governance_Approval_Granted__c',true); // readOnlyFieldsMap.put('Data_Sensitivity__c',true); // readOnlyFieldsMap.put('Data_Sources_Utilized__c',true); // readOnlyFieldsMap.put('Other_Tool_Technology_Utilitzed__c',true); readOnlyFieldsMap.put('Other_Type_of_Service__c',true); // readOnlyFieldsMap.put('Collaboration_Entities__c',true); // readOnlyFieldsMap.put('Collaborative_Test_Indicator__c',true); readOnlyFieldsMap.put('Ent_Test_Hrs__c',true); // readOnlyFieldsMap.put('Testected_Hours_Change_Reason__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); // readOnlyFieldsMap.put('Tools_Technologies_Utilized__c',true); // readOnlyFieldsMap.put('Testect_ID__c',false); readOnlyFieldsMap.put('What_Test_is_Testing_this__c',true); readOnlyFieldsMap.put('What_Business_Unit_is_Testing_this__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Type_of_Works_Performed__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); readOnlyFieldsMap.put('Test_Learn_Phase__c',true); readOnlyFieldsMap.put('EBS_Priority__c',true); readOnlyFieldsMap.put('Planned_or_unplanned__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); readOnlyFieldsMap.put('Test__c',true); readOnlyFieldsMap.put('Total_Hrs__c',true); readOnlyFieldsMap.put('Testected_Hours__c',true); readOnlyFieldsMap.put('Actual_Hours_History__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Testected_Hours_History__c',true); // readOnlyFieldsMap.put('ReRoute_History__c',true); // readOnlyFieldsMap.put('Reroute_Date__c',true); readOnlyFieldsMap.put('Initiated_Date__c',true); readOnlyFieldsMap.put('In_Progress__c',true); readOnlyFieldsMap.put('In_Validation__c',true); readOnlyFieldsMap.put('Validation_Completed_on__c',true); readOnlyFieldsMap.put('Completed__c',true); readOnlyFieldsMap.put('Withdrawn__c',true); readOnlyFieldsMap.put('On_Hold__c',true); readOnlyFieldsMap.put('TestInitiated__c',true); readOnlyFieldsMap.put('TestInQueue__c',true); readOnlyFieldsMap.put('TestValidating__c',true); readOnlyFieldsMap.put('TestWorking__c',true);
} else { // isRerouteEnabledOnStatus = false; readOnlyFieldsMap.put('Test_Name__c',false); }
/* if(edaoTest.Issue_Status__c =='Tester Validation' || edaoTest.Issue_Status__c == 'Validation Complete'|| edaoTest.Issue_Status__c == 'Result Not Valid') { readOnlyFieldsMap.put('Validation_Status__c',false); }*/ if(edaoTest.Issue_Status__c=='On Hold' ||edaoTest.Issue_Status__c=='Withdrawn')
{ // readOnlyFieldsMap.put('Testect_ID__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); // readOnlyFieldsMap.put('UDA_Catalog_ID__c',true); readOnlyFieldsMap.put('Test__c',true); } else { readOnlyFieldsMap.put('Validation_Status__c',true); }
/* if(edaoTest.What_Test_is_Testing_this__c =='Other' ||edaoTest.What_Business_Unit_is_Testing_this__c =='Not Listed') { readOnlyFieldsMap.put('Other_Type_of_Service__c',false); }
*/ if(edaoTest.Issue_Status__c != 'Test Complete' && relatedListFlag == False) { readOnlyFieldsMap.put('Actual_Hours__c',true); // readOnlyFieldsMap.put('CEO_Strategic_Priority__c',true); readOnlyFieldsMap.put('Issue_Status__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('TestsonValidationStatus__c',true); readOnlyFieldsMap.put('Tests_on_Withdrawn_Status__c',false); readOnlyFieldsMap.put('IMP_Test__c',true); readOnlyFieldsMap.put('IMP_Test_2__c',true); readOnlyFieldsMap.put('IMP_Test_3__c',true); readOnlyFieldsMap.put('IMP_Test_4__c',true); readOnlyFieldsMap.put('IMP_Test_5__c',true); readOnlyFieldsMap.put('Estimated_Start_Date__c',true); readOnlyFieldsMap.put('Estimated_Completion_Date__c',true); // readOnlyFieldsMap.put('New_or_Modified_UDA__c',true); // readOnlyFieldsMap.put('Governance_Approval_Granted__c',true); // readOnlyFieldsMap.put('Data_Sensitivity__c',true); // readOnlyFieldsMap.put('Data_Sources_Utilized__c',true); // readOnlyFieldsMap.put('Other_Tool_Technology_Utilitzed__c',true); readOnlyFieldsMap.put('Other_Type_of_Service__c',true); // readOnlyFieldsMap.put('Collaboration_Entities__c',true); // readOnlyFieldsMap.put('Collaborative_Test_Indicator__c',true); readOnlyFieldsMap.put('Ent_Test_Hrs__c',true); // readOnlyFieldsMap.put('Testected_Hours_Change_Reason__c',true); readOnlyFieldsMap.put('Validation_Status__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',true); // readOnlyFieldsMap.put('Tools_Technologies_Utilized__c',true); // readOnlyFieldsMap.put('Testect_ID__c',false); readOnlyFieldsMap.put('What_Test_is_Testing_this__c',true); readOnlyFieldsMap.put('What_Business_Unit_is_Testing_this__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Type_of_Works_Performed__c',true); readOnlyFieldsMap.put('Withdraw_the_Test__c',false); readOnlyFieldsMap.put('Test_Learn_Phase__c',true); readOnlyFieldsMap.put('EBS_Priority__c',true); readOnlyFieldsMap.put('Planned_or_unplanned__c',true); readOnlyFieldsMap.put('Link_to_previous_Test__c',true); readOnlyFieldsMap.put('Test__c',true); readOnlyFieldsMap.put('Total_Hrs__c',true); readOnlyFieldsMap.put('Testected_Hours__c',true); readOnlyFieldsMap.put('Actual_Hours_History__c',true); readOnlyFieldsMap.put('TestsonIssueStatus__c',true); readOnlyFieldsMap.put('Testected_Hours_History__c',true); // readOnlyFieldsMap.put('ReRoute_History__c',true); // readOnlyFieldsMap.put('Reroute_Date__c',true); readOnlyFieldsMap.put('Initiated_Date__c',true); readOnlyFieldsMap.put('In_Progress__c',true); readOnlyFieldsMap.put('In_Validation__c',true); readOnlyFieldsMap.put('Validation_Completed_on__c',true); readOnlyFieldsMap.put('Completed__c',true); readOnlyFieldsMap.put('Withdrawn__c',true); readOnlyFieldsMap.put('On_Hold__c',true); readOnlyFieldsMap.put('TestInitiated__c',true); readOnlyFieldsMap.put('TestInQueue__c',true); readOnlyFieldsMap.put('TestValidating__c',true); readOnlyFieldsMap.put('TestWorking__c',true); readOnlyFieldsMap.put('Description__c',true); readOnlyFieldsMap.put('Test_Name__c',true);
readOnlyFieldsMap.put('What_is_the_Business_Benefit__c',true);
readOnlyFieldsMap.put('Priority__c',true);
readOnlyFieldsMap.put('Document_Link__c',true);
}
readOnlyFieldsMap.put('Test_Type__c',true); readOnlyFieldsMap.put('Opt_in_for_Email_notification__c',true); readOnlyFieldsMap.put('Tests_History__c',true); }
Thanks,
Anish
Hi All,
I am trying to hide the custom button based on permission set.For that i already wrote a code but it is giving me an error.

 public void Custombutton()
         {
                for(PermissionSetAssignment permission : [SELECT Id, PermissionSet.Name FROM PermissionSetAssignment WHERE AssigneeId =:UserInfo.getUserId() ])
            {
                 permissionSetNameList.add(permission.PermissionSet.Name); 
                                          
            }          
            userPermissionList.addAll(permissionSetNameList);   
            
            for(User userIterator : [SELECT Id, Profile.Name FROM User WHERE Id =: UserInfo.getUserId()])
            {
                userProfileSet.add(userIterator.Profile.Name);
            }                 
            if( userPermissionList.contains('Test_Permission')== true)
            {
                relatedListFlag = true;       
            } 

I called the Custombutton() in controller .
Afte that i added the relatedListflag in rendered property of the button.

Vf Page Code
<apex:commandButton id="hideEditbtn1" Styleclass="btn btn-primary" action="{!makeFormEdit}" rendered="{!!isEditMode && relatedListFlag}" value="Edit" reRender="contentPanel,actProjHist,formId" oncomplete="loadToggle();hidePOC();showHeader();hideHelptext();"> </apex:commandButton> &nbsp;&nbsp;  

But when i tested the app with  Test_Permission . it is giving me an error
  System.NullPointerException: Attempt to de-reference a null object       

Please help me on this.

Thanks,
Anish  
 
Hi All,

I have custom button (Edit and clone ) in my VF page and my requirement is for one particular permission set i need to hide those button which i created using commandbutton expression. Please help me on these.

Thanks,
Anish
Hi All,

I am facing a problem to change the font color of fielset label based on conditional formatting.
<apex:outputLabel Value="{!reqField.Label}" styleClass="{!if(reqField.label=='Enter Business Unit if "Others"','green','red')}" />

Please help me on these. I am getting Expression unbalanced Error.

Thanks,
Anish