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

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 10
    Replies
Hi All,

I am facing an issue with test class .We have done the integration with mule sytsem.

Apex class

private static List<String> GDMSWebService (Id enqId,Integer fileIndex)
    {
        List<String> responses = new List<String>();
        String docString;
        String urlString;
        String referenceNo;
        List<Attachment> attach = new List<Attachment>();
        GDMSFileWrapperList wraplist= new GDMSFileWrapperList();
        HttpRequest req = new HttpRequest();
        
        MuleEndpoint__c setting = MuleEndpoint__c.getValues('MuleEndPoint');
        // Specify the required user name and password to access the endpoint
        // As well as the header and header information
        req.setEndpoint(setting.MuleUploadEndpoint__c);
        req.setMethod('POST');
        req.setHeader('Content-Type', 'application/json');
        
        attach = [SELECT Id,ParentID,name,ContentType,BodyLength,Body FROM Attachment where ParentID = :enqId];
        system.debug('attach in GDMS' + attach);
        if (fileIndex > attach.size() - 1)
        {
            system.debug('GDMSWebService, fileIndex > attach.size - 1, do nothing ' + attach.size());
            responses.add('No ID');
            responses.add('GDMSWebService, fileIndex > attach.size - 1, do nothing');
            return responses;
        }
        
        wraplist.Body = EncodingUtil.base64Encode(attach[fileIndex].Body);
        wraplist.fileName = attach[fileIndex].name;
        
        ContactUs_Enquiry__c enq = [SELECT id, name,
                                   File1_DocumentIdReturnString__c, File1_UrlReturnString__c,
                                   File2_DocumentIdReturnString__c, File2_UrlReturnString__c,
                                   File3_DocumentIdReturnString__c, File3_UrlReturnString__c
                                   from ContactUs_Enquiry__c where id = :enqId];
        
        String authorizationHeader = setting.MuleHeader__c;
        req.setHeader('Authorization', authorizationHeader);
        // Specify the required user name and password to access the endpoint
        // As well as the header and header information
        referenceNo = enq.Name;
        String body ='{'+
            '"ServiceInvoker": "SG_SF",'+ //wraplist.ServiceInvoker +
            '"CountryCode": "SG",'+ //wraplist.CountryCode +
            '"ImportDocument": { '+
            '"fileContent":"'+wraplist.Body +'",'+
            '"fileName": "'+wraplist.fileName +'",'+
            '"DocMetadataForImportingDoc": { '+
            '"DocMetadataForImportingDocType": { '+
            '"DocDs": "Application",'+ // wraplist.DocDs +
            '"SubDocDs": "Application", '+ //wraplist.SubDocDs +
            '"SubmissionNo": "'+referenceNo +'"'+
            ' }'+
            ' }'+
            ' }'+
            '}';
        
        req.setBody(body);
        System.debug('GDMSWebService, request Body ' + body);
        //System.debug('GDMSWebService, request ' + req);
        
        // Create a new http object to send the request object
        // A response object is generated as a result of the request  
        docString = '';
        urlString = '';
        Http http = new Http();
        Integer setTime = Integer.ValueOf(setting.SetTimeOut__c);
        req.setTimeout(setTime);
        HTTPResponse res = http.send(req);
        //System.debug('GDMSWebService, response ' + res);
        System.debug('GDMSWebService, response body ' +res.getBody());
        
        //deserialize json body to fetch UrlReturnString & DocumentIdReturnString
        try
        {
            if (res.getStatusCode() == 200)
            {    
                String strjson = res.getbody();
                Map<String,Object> m = (Map<String,Object>)JSON.deserializeUntyped(strjson);
                //system.debug('GDMSWebService, m ' +m);
                Map<String,Object> importdoc = (Map<String, Object>)m.get('ImportDocumentReturnType');
                //system.debug('GDMSWebService, importdoc ' +importdoc);
                docString = String.valueOf(importdoc.get('DocumentIdReturnString'));
                urlString = String.valueOf(importdoc.get('UrlReturnString'));
                System.debug('GDMSWebService, res.getStatusCode() == 200');
                System.debug('GDMSWebService, docString '+docString);
                System.debug('GDMSWebService, urlString '+urlString);
            }
            else
            {
                docString = String.valueOf(res.getStatusCode());
                urlString = 'GDMSWebService Error, res.getStatusCode() <> 200';
                System.debug('GDMSWebService, res.getStatusCode() <> 200');
                System.debug('GDMSWebService, docString '+docString);
                System.debug('GDMSWebService, urlString '+urlString);
            }
        }
        catch (System.CalloutException ex)
        {
            System.debug('GDMSWebService, exception ' + ex.getMessage() + ' on line ' + ex.getLineNumber());
            docString = String.valueOf(ex.getLineNumber());
            urlString = 'GDMSWebService Error, exception ' + ex.getMessage();
            System.debug('GDMSWebService, docString exception '+docString);
            System.debug('GDMSWebService, urlString exception '+urlString);
        }
        
        responses.add(docString);
        responses.add(urlString);
        return responses;
    }
    


Test class

static testMethod void testMethodrequest(){ 
          
        User usr = [Select id, Username from User where Username = 'uniqueName@test.com' limit 1];
        MuleEndpoint__c endpoint = [Select Id,GDMSLinkInRouteEmail__c,MuleHeader__c,SetTimeOut__c,MuleUploadEndpoint__c from MuleEndpoint__c where GDMSLinkInRouteEmail__c=true LIMIT 1];

        System.runAs(usr){
        Boolean GDMSLinkInRouteEmail =  endpoint.GDMSLinkInRouteEmail__c;       
        List<EmailServiceMasterData__c> custList = new List<EmailServiceMasterData__c>();    
        EmailServiceMasterData__c cust = new EmailServiceMasterData__c();
        cust.name = 'TestRec1';
        cust.Allow_Upload_Attachments__c = true;
        cust.Policy_Type__c ='Auto Insurance'; 
        cust.Query_Type__c ='Claims';
        cust.AckType__c = '5';
        cust.Product__c = '';
        cust.GDMSDocType__c = '';
        cust.EnquiryBy__c = 'B';
        cust.Type_of_Incident_Creation__c = 'Service Incident';
        cust.Routed_to_Mailbox__c='test@aig.com;test1@aig.com';
        cust.Salesfoce_Queue__c = 'CAutoQ';
        cust.Need_Incident_Creation__c = true;
        cust.Product__c = '';
        custList.add(cust);    
        
        EmailServiceMasterData__c cust1 = new EmailServiceMasterData__c();    
        cust1.name = 'TestRec2';
        cust1.Allow_Upload_Attachments__c = true;
        cust1.Policy_Type__c ='Auto Insurance'; 
        cust1.Query_Type__c ='Claims';
        cust1.AckType__c = '5';
        cust1.Product__c = '';
        cust1.GDMSDocType__c = '';
        cust1.EnquiryBy__c = 'B';
        cust1.Type_of_Incident_Creation__c = 'Service Incident';
        cust1.Routed_to_Mailbox__c='test44@aig.com;test1@aig.com';
        cust1.Salesfoce_Queue__c = 'CAutoQ';
        cust1.Need_Incident_Creation__c = true; 
        cust1.Product__c = '';
        custList.add(cust1);    
        insert custList;
        
        List<ContactUs_Enquiry__c> conlist = new List<ContactUs_Enquiry__c>();    
        ContactUs_Enquiry__c con = new ContactUs_Enquiry__c();
        con.EnquiryBy__c ='Broker/Agent';
        con.CustomerType__c='Individual';
        con.PolicyType_Agent__c='Auto Insurance';
        con.Nature_Agent__c='Claims';
        con.Producer_Cd__c='test001';
        con.Producer_Name__c='test';
        con.Prod_Mobile__c='84345553';
        con.Prod_Email__c='test@aig.com';
        con.Customer_Name__c='Sconty Test';
        con.NRIC__c='9999999';
        con.Policy_No__c='45565432';
        con.Cust_Phone__c='54554533';
        con.Cust_Email__c='test@aig.com';
        con.Enquiry_Detail__c='Test';
        con.Cust_Address__c = 'Sing';
        con.Cust_PostCode__c = '878987';
        con.File1__c = 'Test001.jpg';
        con.File2__c = 'Dummy File.docx';
        con.File3__c = 'test10.csv'; 
        con.File1_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/Test001.jpg?order=retrieve&item-id=A1001001A23A10A45213I21897&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A14.389201000&token=ADUA.MvzMHuJYx7U2_06dTHEwkVgRp9dS292THJgQRbxHW2oSMW7TNoiv2U2x;&content-length=0&content-type=image%2Fjpeg';
        con.File2_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/Dummy%20File.docx?order=retrieve&item-id=A1001001A23A10A45220D21899&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A21.167205000&token=ADUA.MvzMJeJZ1z_2_4TlmLMS5K4JByyZPECycJXRRe3IL94_GTVScEBI77.6;&content-length=0&content-type=application%2Fvnd.openxmlformats-officedocument.wordprocessingml.document';
           con.File3_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/test10.csv?order=retrieve&item-id=A1001001A23A10A45220D21899&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A21.167205000&token=ADUA.MvzMJeJZ1z_2_4TlmLMS5K4JByyZPECycJXRRe3IL94_GTVScEBI77.6;&content-length=0&content-type=application%2Fvnd.openxmlformats-officedocument.wordprocessingml.document';
        conlist.add(con);
            
        ContactUs_Enquiry__c con1 = new ContactUs_Enquiry__c();
        con1.EnquiryBy__c ='Broker/Agent';
        con1.CustomerType__c='Corporate';
        con1.PolicyType_Agent__c='Auto Insurance';
        con1.Nature_Agent__c='Claims';
        con1.Producer_Cd__c='test001';
        con1.Producer_Name__c='test';
        con1.Prod_Mobile__c='84345553';
        con1.Prod_Email__c='test@aig.com';
        con1.Customer_Name__c='Sconty V';
        con1.NRIC__c='9999999';
        con1.Policy_No__c='45565432';
        con1.Cust_Phone__c='54554533';
        con1.Cust_Email__c='test@aig.com';
        con1.Enquiry_Detail__c='Test';
        con1.Cust_Address__c = 'Sing';
        con1.Cust_PostCode__c = '878987';
        con1.File1__c = 'Test001.jpg';
        con1.File2__c = 'Dummy File.docx';
        con1.File3__c = 'test10.csv';    
        con1.File1_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/Test001.jpg?order=retrieve&item-id=A1001001A23A10A45213I21897&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A14.389201000&token=ADUA.MvzMHuJYx7U2_06dTHEwkVgRp9dS292THJgQRbxHW2oSMW7TNoiv2U2x;&content-length=0&content-type=image%2Fjpeg';
        con1.File2_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/Dummy%20File.docx?order=retrieve&item-id=A1001001A23A10A45220D21899&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A21.167205000&token=ADUA.MvzMJeJZ1z_2_4TlmLMS5K4JByyZPECycJXRRe3IL94_GTVScEBI77.6;&content-length=0&content-type=application%2Fvnd.openxmlformats-officedocument.wordprocessingml.document';
        con1.File3_UrlReturnString__c = 'https://cmicdev.aig.net:9444/icmrm/ICMResourceManager/test10.csv?order=retrieve&item-id=A1001001A23A10A45220D21899&version=1&collection=APAC.CLLCT001&libname=ICMNLSDB&update-date=2023-01-10+09%3A52%3A21.167205000&token=ADUA.MvzMJeJZ1z_2_4TlmLMS5K4JByyZPECycJXRRe3IL94_GTVScEBI77.6;&content-length=0&content-type=application%2Fvnd.openxmlformats-officedocument.wordprocessingml.document';
        conlist.add(con1);
        insert conlist;
        
        List<Attachment> attachList = new List<Attachment>();
        Blob b = Blob.valueOf('Test Data.txt');
        Attachment attach = new Attachment();
        attach.ParentId = con.id;
        attach.Name = 'Test Attachment 0';
        attach.Body = b;
        attachList.add(attach);
            
        Blob b1 = Blob.valueOf('Test Data.txt');    
        Attachment attach1 = new Attachment();
        attach1.ParentId = con.id;
        attach1.Name = 'Test Attachment 1';
        attach1.Body = b1;
        attachList.add(attach1);
            
        Blob b2 = Blob.valueOf('Test Data.txt');    
        Attachment attach2 = new Attachment();
        attach2.ParentId = con.id;
        attach2.Name = 'Test Attachment 2';
        attach2.Body = b2;  
        attachList.add(attach2);    
        insert attachList;
            
        GDMSFileWrapperList wraplist= new GDMSFileWrapperList();
        wraplist.Body = EncodingUtil.base64Encode(attachList[0].Body);
        wraplist.fileName = attachList[0].name;    
            
           
        Integer fileIndex = 1;
        RestRequest req = new RestRequest(); 
           RestResponse res = new RestResponse();
        
        String testJson ='{'+
            '"ServiceInvoker": "SG_SF",'+
            '"CountryCode": "SG",'+ 
            '"ImportDocument": { '+
            '"fileContent":"'+wraplist.Body +'",'+
            '"fileName": "'+wraplist.fileName +'",'+
            '"DocMetadataForImportingDoc": { '+
            '"DocMetadataForImportingDocType": { '+
            '"DocDs": "Application",'+ // wraplist.DocDs +
            '"SubDocDs": "Application", '+ //wraplist.SubDocDs +
            '"SubmissionNo": "'+con.Name +'"'+
            ' }'+
            ' }'+
            ' }'+
            '}';
            
        req.requestURI = endpoint.MuleUploadEndpoint__c;
        req.httpMethod = 'POST';
        req.addHeader('Content-Type', 'application/json');
        RestContext.request = req;
        req.requestBody = Blob.valueOf(testJson);
        RestContext.response = res;
            system.debug('res.. '+res);
        //System.assertEquals(200, res.statusCode);
            
            
        GDMSWebServiceController obj = new GDMSWebServiceController();
        GDMSWebServiceController.routeToMailbox(con.id);
        GDMSWebServiceController.routeToMailbox(con1.id);   
            
    }
    }



It is giving System.NullPointerException: Attempt to de-reference a null object error for line req.setEndpoint(setting.MuleUploadEndpoint__c);

Please suggest how can i resolved this issue.

Thanks,
A
Hi All,

My requirement is as follow :
1. Save attachment in SF , upload to mule endpoint and delete attachment from SF.
Or Upload the attachment to mule endpoint directly.

Please need your help..

Thanks,,
Anish
Hi All , 

I  tried test class for Error (Both  DisplayErrorMsg and Checkmail) method but it didn't work.

Apex class

    public void DisplayErrorMsg(){
           
        String phone = con.Prod_Mobile__c;
        system.debug('@@phone'+phone);
        if(phone.length() == 8 && (phone.startsWith('6') || phone.startsWith('8') || phone.startsWith('9'))){
            system.debug('if loop');
            //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Invalid Contact No. Please enter a valid mobile no (8 digits, starts with 6, 8 or 9)'));
        }
        else{
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Check your phoine'));
              system.debug('else loop');
        }
    }
    public void checkEmail(){
        string emailVal = con.Prod_Email__c;
        system.debug('@@email'+emailVal);
        if(!Pattern.matches('[a-zA-Z0-9._-]+@[a-zA-Z]+.[a-zA-Z]{2,4}[.]{0,1}[a-zA-Z]{0,2}', emailVal))
        {
            EmailerrorMessage = 'Invalid email address entered.';
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'Check your email'));
        }
    }
}


test class :
@isTest
public class ContactUsThankYouControllerTest {

     static testMethod void TestMethod2() 
    {
        ContactUs_Enquiry__c con = new ContactUs_Enquiry__c();
        insert con;
        con = [select Id,Name from ContactUs_Enquiry__c where id = : con.id];
        PageReference pageRef = Page.ContactUsMain;
        Test.setCurrentPage(pageRef);
        ApexPages.Standardcontroller sc = new ApexPages.Standardcontroller(con);
        ApexPages.currentPage().getParameters().put('Id',con.id);
        
    }
    static testMethod void TestMethod1(){
           ContactUs_Enquiry__c con = new ContactUs_Enquiry__c();
        ApexPages.StandardController sc = new ApexPages.StandardController(con);
        ContactUsThankYouController obj = new ContactUsThankYouController(sc);
        con.Prod_Mobile__c = '95473732';
        con.Prod_Email__c = 'test@gmail.com';
        con.Cust_Email__c = 'test';
          obj.DisplayErrorMsg();
        obj.checkEmail();
               }            
}


Thanks,
Anish
Hi All,
I am facing difficulty while applying style to pageblocksection.
I tried to used style on pageblocksection but it Pageblocksection color changedidn't worked.

<style>
.custom1 { background-color: red !important; }
.custom3 { background-color: green !important; }
</style>
<apex:pageBlock>
<apex:outputPanel layout="block" styleClass="custom1"> <apex:pageBlockSection title="Section 1"> Content 1 </apex:pageBlockSection>
</apex:outputPanel></apex:pageBlock>
Please see the attached file where i want to apply a style of blue color background to the highted yellow color portion.

Thanks in advance.
 
Hi All,

We have scheduled job and it is getting failed from last  few days with following error.

Cause:null LineNumber:5 Message:Argument cannot be null. StackRace:Class.GenerateHashDigest.generateSHA256HashCode: line 5, column 1
Class.TargetListCreation.execute

Below is the code line which causing an issue in both of these classes.
Generatehashdigest
 {
    
      public static String generateSHA256HashCode(String nricNumber){
        Blob targetBlob=blob.valueOf(nricNumber);
        Blob hashValue=Crypto.generateDigest('SHA-256',targetBlob);
        String hasValueNricNumber=EncodingUtil.convertToHex(hashValue);
        return hasValueNricNumber;
    }

Targetlistcreation
string nrHasCusStr = GenerateHashDigest.generateSHA256HashCode(eachTL.NRIC__c);

Need help on above issue. Thanks in advance.

Thanks,
Anish
Hi All , 
We are facing an issue with name field from User table in production . The issue is that when we lookup the employee details and save the request . In display mode, it is showing ID instead of Employee name and Its happening on in production . We have just used standard lookup user table and there is no custom coding. Does anybody have faced similar issue ?
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  
 
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