• Melvin_Developer
  • NEWBIE
  • 45 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
How to get the HTML table header in each page in PDF? I've tried with thead {display:table-header-group; } into CSS which is not supporting in HTMLTOPDF.. Please help me out.

Hi,
Is there someone out there who can answer this question:
- Do salesforce servers support HTML5 web sockets?
- If not will this support be coming? and when?

Thank you,
                Melvin!

Does anyone know how I can create a Parameterized class?

For Example:
I want to be able to do the following, customClass<String> cc = new customClass<String>();
So all the methods in the customClass work with String in this case, but should allow any type to be passed in.

Simular to the way a Map or List works!

Any help on this would be great,

Thank you,
                  Melvin!

Hi, I ran into an issue when using the StandardSetController it appears that I am limited to querying only 10,000 records.
Does anyone know of a way to overcome this issue?

What am I attempting to do:
return all the 50,000 records I have and access these in sets of 20 records.

 

The standardSetController provides me with the exact functionality I need and it would be great if I could find a way to resolve the limit issue so I can continue to use this standard controller provided and supported by force.com however if you believe you know a better solution I would still like to hear it!

Thanks in advance,
                            Melvin!

Does anyone know how I can create a Parameterized class?

For Example:
I want to be able to do the following, customClass<String> cc = new customClass<String>();
So all the methods in the customClass work with String in this case, but should allow any type to be passed in.

Simular to the way a Map or List works!

Any help on this would be great,

Thank you,
                  Melvin!

I have a custom object   Cobject. It has some data in it. with the help of  CobjectId, I am displaying the individual records in a visualforce page.This visualforce page has a custom controller. I am displaying records in the visualforce page with this url like https://cnp.na3.visual.force.com/apex/Cobjectdetail?id=a055000000AJDJT.

 

 

Its working well. But if I remove id value from the url(https://cnp.na3.visual.force.com/apex/Cobjectdetail?id=)

 

Its giving this error:  

 

Visualforce Error

Id value is not valid for the TCObject__c standard controller.

 

 

How to handle this error. With out the CobjectId, it should redirect to custom object tab. 

 

Please help me.

 

Thanks,

Naresh

Can anyone give a suggestion on the below test.  When running the test, it does not return any rows and does not give me adequate coverage.

 

Controller

 

public class psuIdRequestController {
 private String requestid;
    public Participant_ID_Request__c participantmgr;
    public String strStatus;
    public User user;
    public Contact contactBusiness;
    public Contact contactTechnical;
    public Contact contactFinance;
    public Contact contactTreasury;
    public String comment;
    public String approver;
    public Date approvalDate;
    
    
    public psuIdRequestController(ApexPages.StandardController stdController) {
        requestid = ApexPages.currentPage().getparameters().get('requestid');

        //Fetch participant for Participant ID Request record.
        participantmgr = [select Id, Name, DCF_Approval_Due_Date__c,
                        Business_DCF_Approver__c, Technical_DCF_Approver__c, Finance_DCF_Approver__c, Treasury_DCF_Approver__c,
                        Business_DCF_Approval__c, Technical_DCF_Approval__c, Finance_DCF_Approval__c, Treasury_DCF_Approval__c,
                        Business_DCF_Approval_Date__c, Technical_DCF_Approval_Date__c, Finance_DCF_Approval_Date__c, Treasury_DCF_Approval_Date__c,
                        Business_DCF_Comments__c, Technical_DCF_Comments__c, Finance_DCF_Comments__c, Treasury_DCF_Comments__c      
                        from Participant_ID_Request__c where Id =:requestid limit 1];

     try{
        contactBusiness = [select Id, Name from Contact where Id =: participantmgr.Business_DCF_Approver__c limit 1];
        contactTechnical = [select Id, Name from Contact where Id =: participantmgr.Technical_DCF_Approver__c limit 1];
        contactFinance = [select Id, Name from Contact where Id =: participantmgr.Finance_DCF_Approver__c limit 1];
        contactTreasury = [select Id, Name from Contact where Id =: participantmgr.Treasury_DCF_Approver__c limit 1];
        
        }
    catch(QueryException e){
     // System.assert(false,'You must be assigned as an approver for this participant.');    
        
        }
    
    }
  
    public Participant_ID_Request__c getparticipant(){
        return participantmgr;
    }
    
    public void Approve(){
        setStatus('Approved');      
    }
    public void Reject(){
        setStatus('Rejected');
    }
    public String getUserName(){
        return UserInfo.getName();
    }
    public String getStatus(){ 
        if(UserInfo.getName() == contactBusiness.Name ){
                return participantmgr.Business_DCF_Approval__c;
            }
            else if (UserInfo.getName() == contactTechnical.Name ){
                return participantmgr.Technical_DCF_Approval__c;
            }
            else if (UserInfo.getName() == contactFinance.Name ){
                return participantmgr.Finance_DCF_Approval__c;
            }
            else if (participantmgr.Treasury_DCF_Approver__c <> Null ){
                if (UserInfo.getName() == contactTreasury.Name ){
                    return participantmgr.Treasury_DCF_Approval__c;
                }
            }
        return strStatus;
    }
    public void setStatus(String status){
    
        if(UserInfo.getName() == contactBusiness.Name ){
            participantmgr.Business_DCF_Approval__c = status;
            participantmgr.Business_DCF_Comments__c = comment;
            participantmgr.Business_DCF_Approval_Date__c = approvalDate;
            update participantmgr;
        }
        else if (UserInfo.getName() == contactTechnical.Name ){
            participantmgr.Technical_DCF_Approval__c = status;
            participantmgr.Technical_DCF_Comments__c = comment;
            participantmgr.Technical_DCF_Approval_Date__c = approvalDate;
            update participantmgr;
        }
        else if (UserInfo.getName() == contactFinance.Name ){
            participantmgr.Finance_DCF_Approval__c = status;
            participantmgr.Finance_DCF_Comments__c = comment;
            participantmgr.Finance_DCF_Approval_Date__c = approvalDate;
            update participantmgr;
        }
        else if (participantmgr.Treasury_DCF_Approver__c <> Null ){
            if (UserInfo.getName() == contactTreasury.Name ){
            participantmgr.Treasury_DCF_Approval__c = status;
            participantmgr.Treasury_DCF_Comments__c = comment;
            participantmgr.Treasury_DCF_Approval_Date__c = approvalDate;
            update participantmgr;
            }
        }
    }
            
    public String getParticipantName() {
        return participantmgr.Name;       
    }
    
    public String getComment(){
    
            if(UserInfo.getName() == contactBusiness.Name ){
                return participantmgr.Business_DCF_Comments__c ;
            }
            else if (UserInfo.getName() == contactTechnical.Name ){
                return participantmgr.Technical_DCF_Comments__c;
            }
            else if (UserInfo.getName() == contactFinance.Name ){
                return participantmgr.Finance_DCF_Comments__c;
            }
            else if (participantmgr.Treasury_DCF_Approver__c <> Null ){
                if (UserInfo.getName() == contactTreasury.Name ){
                    return participantmgr.Treasury_DCF_Comments__c;
                }
                else{
                    comment = '';
                    return comment; 
                }
            }
            else{
                comment = '';
                return comment; 
            }
    }
    
    public void setComment(String value){
        comment = value;        
    }
    
    public Date getapprovalDate(){
    
            if(UserInfo.getName() == contactBusiness.Name ){
                return participantmgr.Business_DCF_Approval_Date__c;
            }
            else if (UserInfo.getName() == contactTechnical.Name ){
                return participantmgr.Technical_DCF_Approval_Date__c;
            }
            else if (UserInfo.getName() == contactFinance.Name ){
                return participantmgr.Finance_DCF_Approval_Date__c;
            }
            else if (participantmgr.Treasury_DCF_Approver__c <> Null ){
                if (UserInfo.getName() == contactTreasury.Name ){
                    return participantmgr.Treasury_DCF_Approval_Date__c;
                }
                else{
                    approvalDate = null;
                    return approvalDate; 
                }
            }
            else{
                approvalDate = null;
                return approvalDate;
            } 
    }
    
    public String getApprover(){
            if(UserInfo.getName() == contactBusiness.Name ){
                return contactBusiness.Name;
            }
            else if (UserInfo.getName() == contactTechnical.Name ){
                return contactTechnical.Name;
            }
            else if (UserInfo.getName() == contactFinance.Name ){
                return contactFinance.Name;
            }
            else if (participantmgr.Treasury_DCF_Approver__c <> Null ){
                if (UserInfo.getName() == contactTreasury.Name ){
                    return contactTreasury.Name;
                }
                else{
                approver = 'Not Eligilble to approve';
                return approver; 
                }
            }
            else{
                approver = 'Not Eligilble to approve';
                return approver; 
            }
    }

}

 Test

 

    static testmethod void testPsuIdRequest()
    {
        User BusinessUser = [select id,name,ContactId from User where Profile.Name = 'PORTAL: GNS Technical Account Management' and IsActive = true limit 1];
        User TechnicalUser = [select id,name,ContactId from User where Profile.Name = 'PORTAL: GNS Partner Operations' and IsActive = true limit 1];
        User FinanceUser = [select id,name,ContactId from User where Profile.Name = 'PORTAL: GNS Finance' and IsActive = true limit 1];
        User InvalidUser = [select id,name,ContactId from User where Profile.Name = 'PORTAL: AMEX Treasury' and IsActive = true limit 1];

        System.RunAs(BusinessUser){        
        RecordType recreq = [select ID,Name from RecordType where Name = 'ID REQUEST: Draft Approved' and SObjectType = 'Participant_ID_Request__c'];
        Participant_ID_Request__c preq = new Participant_ID_Request__c(recordtypeid=recreq.Id,
        Name='Test Deal1'); 
        insert preq;
        

            ApexPages.PageReference testpage = Page.psudcfreview;
            ApexPages.StandardController con = new ApexPages.StandardController(preq);
            psuIdRequestController pnid = new psuIdRequestController(con);
            Test.setCurrentPage(testpage);
            ApexPages.currentPage().getParameters().get('requestid');
    
            pnid = new psuIdRequestController(con);
            pnid.comment = 'testing';
            pnid.approve();
            }
        }

 

 

 

  • November 30, 2010
  • Like
  • 0

Good day All,

 

I create a site however some users can see the page but some are in fact having maintenance page, not sure if anyone encounter this before ? the site suppose to be publicly access as data entry form, not sure if any setting that i miss out ?

 

Thank you !

 

 

How to get the HTML table header in each page in PDF? I've tried with thead {display:table-header-group; } into CSS which is not supporting in HTMLTOPDF.. Please help me out.

I've got a VF page with some links to other VF pages. I'd like for a link to render only if that user's profile has been enabled to access the link's page. How do I do that?

 

Thanks in advance.

  • September 27, 2010
  • Like
  • 0