• samreet_matharu@psl.co.in
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 16
    Replies

Hi,

 

Can we invoke standard action buttons dynamically in a test class.

Apex Page not Displayed the records in data Table please tell me what is error in my controller class or apex page please

 

This is my Apex Page Code

 

<apex:page id="helloWorld"  showHeader="false"  controller="TableClass" >
  <!-- Begin Default Content REMOVE THIS -->
   <apex:form id="HelloForm">
          Data Base Example
           <apex:outputLabel id="lblID" value="Enter ID"/>
           <apex:inputText required="true" id="txtID" value="{!ID}"/>
           <apex:outputLabel id="lblDescription" value="Enter Description"/>
           <apex:inputText required="true" id="txtdescription" value="{!Description}"/>
           <apex:outputLabel id="lblRecords" value="No of Records"/>
           <apex:outputLabel id="lblNoRecords" value="{!NoOfRecords}"/>
           <br/>
           <apex:outputLabel value="Records"/>
           <br/>
   <apex:dataTable value="{!accounts}" var="c" >
        <apex:column >
            <apex:facet name="header">ID</apex:facet>
            <apex:outputText value="{!c.ID__c}" />
        </apex:column>
    </apex:dataTable>
   </apex:form>
  <!-- End Default Content REMOVE THIS -->
</apex:page>

This my controller Class

 

public class TableClass
{

      private final List<AppHelloO__c> accounts;



    public List<AppHelloO__c> getAccounts() {
        if(accounts == null)
        {
      
        }
        return accounts;

    }
    public Integer ID
    {
        get;
        set;
    }
    public String Description
    {
        get;
        set;
    }
    public String NoOfRecords
    {
        get;
        set;
    }
    private AppHelloObject__c[] atRecords;
  
    public TableClass()
    {
      accounts=new List<AppHelloO__c>();
       
      /*  for(AppHello__c s:atRecords)
        {
           accounts.add(s);
   //        this.NoOfRecords=s.Description__c;
         }*/
         for(Integer i=0; i<7 ;i++)
         {
             AppHelloO__c c=new AppHelloO__c(ID__c=i);
             accounts.add(c);
          
                    this.NoOfRecords=String.valueOf(c.ID__c+10);
           this.ID=1;
   
         }  
        this.Description='Sohaib Ali';
       //   this.atRecords=[SELECT ID__c,Description__c FROM AppHello__c];
       
     //   AppHelloObject__c aaa=new   AppHelloObject__c();
       // aaa.AppHello__c=atRecords[0].id;
                    //atRecords=c;
      //  AppHello__c t=new AppHello__c();
       // t.id=aaa.AppHello__c;           
        this.NoOfRecords=String.valueOf(333);
    }
   
}

<apex:page id="helloWorld"  showHeader="false" tabStyle="AppHelloO__c" controller="TableClass" >
  <!-- Begin Default Content REMOVE THIS -->
   <apex:form id="HelloForm">
          Data Base Example
           <apex:outputLabel id="lblID" value="Enter ID"/>
           <apex:inputText required="true" id="txtID" value="{!ID}"/>
           <apex:outputLabel id="lblDescription" value="Enter Description"/>
           <apex:inputText required="true" id="txtdescription" value="{!Description}"/>
           <apex:outputLabel id="lblRecords" value="No of Records"/>
           <apex:outputLabel id="lblNoRecords" value="{!NoOfRecords}"/>
           <br/>
           <apex:outputLabel value="Records"/>
           <br/>
   <apex:dataTable value="{!accounts}" var="c" >
        <apex:column >
            <apex:facet name="header">ID</apex:facet>
            <apex:outputText value="{!c.ID__c}" />
        </apex:column>
    </apex:dataTable>
   </apex:form>
  <!-- End Default Content REMOVE THIS -->
</apex:page>

I want to show the images hosted in Picasa albums in some VisualForce Pages in Salesforce.

 

Any pointers on getting started would be appreciated..

 

Thanks

we hava a force.com site  with a search functionality implemented using a query locator.However our users are facing cursor issue somethimes while accessing site..

 

My question is that if we replace the query locator implementation with the list of records,will this limit be bypassed?

That is replacing Database.getquerylocator(query) with Database.query(query)

 

Thanks in advance..

                

We have a force.com site which is to be rendered in two languages.We have used apex to set and read the language cookie.

The site is working in the sandbox properly.

But when we moved to production , we faced certain issues regarding to translations,the cookie could not be set in the site.

 

We have discovered if we use a secure connection (HTTPS) there is no problem with the translations. The issue, however, persists if we use the non-secure (HTTP) connection.

We could not enforce a secure connection on the guest visitors.

 

If anyone has any possible suggestions,Please do help.

Hi,

 

I have created a approval process on the 'Opportu nity' object.When a opportunity record is submitted for approval, a new post is added on the chatter wall.For this post I am not getting an email alert from chatter..

For additional info, I am getting approval mails, according to the template specified in the approval process, but I want to get the chatter email alert for new approval process post on the chatter.

Any pointers on the issue, caan be of great help.

 

  • February 25, 2013
  • Like
  • 0

Is it possible to render part of a VF page as pdf.

I don't want the entire page to be rendered as pdf because the user should have an option to select a date on the VF page. On selecting the date, the bottom part must be rendered as pdf.

 

How can i achieve this?

 

Thanks in Advance,

Rohit R

  • February 14, 2013
  • Like
  • 0

Hi,

   I have this field (xyz)of type input text area on my visualforce page as <apex:inputField  value ="{!Opportunity.xyz__c}"/>. If i give characters more than the default limit of  text area type, Then it gives an error message , which should happen. But instead of one I am getting two error messages below that field. Can anyone please suggest me a way to rectify this issue?

Hi,

 

Can we invoke standard action buttons dynamically in a test class.

I want to show the images hosted in Picasa albums in some VisualForce Pages in Salesforce.

 

Any pointers on getting started would be appreciated..

 

Thanks

Dear Friends:

I am trying to invoke an apex method from javascript but some reason it's not. I must be doing bluder mistake which I could not figure out so I woule like request the member to review the below given code and let me know what am I doing wrong.

 

Thank you very much inadvance for your time.

 

VF Page:

<apex:page showheader="false" controller="CaptureSignature">
    <head>
      <link rel="stylesheet" href="{!URLFOR($Resource.jsSignature,'build/jquery.signaturepad.css')}" />
      <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
      <script src="{!URLFOR($Resource.jsSignature, 'build/jquery.signaturepad.min.js')}"></script>
      <script src="{!URLFOR($Resource.jsSignature, 'build/json2.min.js')}"></script>
    </head>

   <body>
        <form method="post" class="sigPad" >
           <apex:form >
             <apex:actionFunction action="{!capSig}" name="capSignature"/>
                  <ul class="sigNav">
                  <li class="drawIt"><a href="#draw-it">Draw your signature</a></li>
                  <li class="clearButton"><a href="#clear">Clear</a></li>
                  </ul>
                      <div class="sig sigWrapper">
                      <canvas class="pad" width="198" height="55"></canvas>
                      <input type="hidden" name="output" class="output"/>
                      </div>
                      <button name="submit" onClick="saveImg(output);">Submit</button>
            </apex:form>
        </form>
     
        <script>
            function saveImg()
            {
                var api = $('.sigPad').signaturePad();
                var sigPad;
                var sig = '';
                if(api.validateForm())
                {
                    sig = api.getSignatureImage();
                     alert('sig = ' + sig);
                  //  document.getElementById('submit').innerHTML = sig;
                  }
                capSignature();
               return sig;
              
            }
            $(document).ready(function() {
              sigPad = $('.sigPad').signaturePad({drawOnly:true});
            });
        </script>
    </body>
</apex:page>

 

Controller:

public class CaptureSignature {
    
    public string SignatureImage{get; set;}
    
    public PageReference capSig() {
            System.debug('**** SignatureImage:' + SignatureImage);
           //create sample signature attachment image
            Attachment newAttachment = new Attachment();
            newAttachment.ParentId = 'TestSigCap';
            String imageBody = SignatureImage.replaceAll('data:image/png;base64,', '');
            newAttachment.body = Encodingutil.base64Decode(imageBody);
            newAttachment.name = 'sampleSignature.png';
            insert newAttachment;

     
    return null;
    }

}

  • October 03, 2012
  • Like
  • 0

 

 

 

Hi  SFDL,

 

my code: 
 
public class login
{
public String currentUserProf { get; set; }
public String profilename { get; set; }
String name='System Administrator';

public String isAdmin()


{
return null;
}
String profileId= UserInfo.getProfileId();
boolean isAdmin=false;
Profile currentUserProf= [select name from Profile where id =:profileId limit 1];

if(currentUserProf==NULL)
{
isAdmin=false;
else
isAdmin=true;
if(currentUserProf.name.equalsIgnoreCase('System Administrator'))
System.debug('System Administrator');
else
if(currentUserProf.name.equalsIgnoreCase('RSL gold partner user'))
System.debug('RSL gold partner user');
else
if(currentUserProf.name.equalsIgnoreCase('RSL gold partner manager user'))
{
System.debug'(RSL gold partner manager user');


}
 }
}
my vf page:
 
<apex:page controller="login">
<apex:outputLabel value="U R Admin" rendered="{isAdmin()}"/>
<apex:outputLabel value="U RませAdmin" rendered="{NOTIsAdmin()}"/> </頂点:ページ>

 

 

.How to write the  parameter  passing in this method of apex class (like IsProfile(String profilename))..it displays profile User name details like ('System Adminstrator of debug console)  .By using if else condition.

 

 

Thanks

Pradeep

 

Apex Page not Displayed the records in data Table please tell me what is error in my controller class or apex page please

 

This is my Apex Page Code

 

<apex:page id="helloWorld"  showHeader="false"  controller="TableClass" >
  <!-- Begin Default Content REMOVE THIS -->
   <apex:form id="HelloForm">
          Data Base Example
           <apex:outputLabel id="lblID" value="Enter ID"/>
           <apex:inputText required="true" id="txtID" value="{!ID}"/>
           <apex:outputLabel id="lblDescription" value="Enter Description"/>
           <apex:inputText required="true" id="txtdescription" value="{!Description}"/>
           <apex:outputLabel id="lblRecords" value="No of Records"/>
           <apex:outputLabel id="lblNoRecords" value="{!NoOfRecords}"/>
           <br/>
           <apex:outputLabel value="Records"/>
           <br/>
   <apex:dataTable value="{!accounts}" var="c" >
        <apex:column >
            <apex:facet name="header">ID</apex:facet>
            <apex:outputText value="{!c.ID__c}" />
        </apex:column>
    </apex:dataTable>
   </apex:form>
  <!-- End Default Content REMOVE THIS -->
</apex:page>

This my controller Class

 

public class TableClass
{

      private final List<AppHelloO__c> accounts;



    public List<AppHelloO__c> getAccounts() {
        if(accounts == null)
        {
      
        }
        return accounts;

    }
    public Integer ID
    {
        get;
        set;
    }
    public String Description
    {
        get;
        set;
    }
    public String NoOfRecords
    {
        get;
        set;
    }
    private AppHelloObject__c[] atRecords;
  
    public TableClass()
    {
      accounts=new List<AppHelloO__c>();
       
      /*  for(AppHello__c s:atRecords)
        {
           accounts.add(s);
   //        this.NoOfRecords=s.Description__c;
         }*/
         for(Integer i=0; i<7 ;i++)
         {
             AppHelloO__c c=new AppHelloO__c(ID__c=i);
             accounts.add(c);
          
                    this.NoOfRecords=String.valueOf(c.ID__c+10);
           this.ID=1;
   
         }  
        this.Description='Sohaib Ali';
       //   this.atRecords=[SELECT ID__c,Description__c FROM AppHello__c];
       
     //   AppHelloObject__c aaa=new   AppHelloObject__c();
       // aaa.AppHello__c=atRecords[0].id;
                    //atRecords=c;
      //  AppHello__c t=new AppHello__c();
       // t.id=aaa.AppHello__c;           
        this.NoOfRecords=String.valueOf(333);
    }
   
}

<apex:page id="helloWorld"  showHeader="false" tabStyle="AppHelloO__c" controller="TableClass" >
  <!-- Begin Default Content REMOVE THIS -->
   <apex:form id="HelloForm">
          Data Base Example
           <apex:outputLabel id="lblID" value="Enter ID"/>
           <apex:inputText required="true" id="txtID" value="{!ID}"/>
           <apex:outputLabel id="lblDescription" value="Enter Description"/>
           <apex:inputText required="true" id="txtdescription" value="{!Description}"/>
           <apex:outputLabel id="lblRecords" value="No of Records"/>
           <apex:outputLabel id="lblNoRecords" value="{!NoOfRecords}"/>
           <br/>
           <apex:outputLabel value="Records"/>
           <br/>
   <apex:dataTable value="{!accounts}" var="c" >
        <apex:column >
            <apex:facet name="header">ID</apex:facet>
            <apex:outputText value="{!c.ID__c}" />
        </apex:column>
    </apex:dataTable>
   </apex:form>
  <!-- End Default Content REMOVE THIS -->
</apex:page>

I think It's a bit related to security issue- but if I open visualforce

page as a PDF document, can I prevent the user from saving the document as file?

 

The tarfget is to allow only printing the document.

 

Hi Gurus,

 

I am facing problems with overriding "new" button.

 

We are using Professiona Edition. We needed a visualforce page in place of standard "new page".

 

So we created one, and replaced it. but when I am hitting save button, it has standard save function "{!save}", the new record is not being created and it is staying on the same page.

 

I tried to find out if PE allows such thing, and found out that it does allow.

 

Can you guys help me out.

 

i am trying to override standard oppotunity. the code is like this...

<apex:page standardController="opportunity" >
 
 <apex:form id="form00"  title="New Opportunity">
   <apex:pageBlock id="block01">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value=" Save "></apex:commandButton>
                <apex:commandButton action="{!cancel}" value=" Cancel "></apex:commandButton>
            </apex:pageBlockButtons>
       
       <apex:pageBlockSection id="sec01" title="Opportunity Details" columns="2">
           
           <apex:inputField label="Deal Size" value="{!opportunity.Amount}"/>                      
           <apex:inputField value="{!opportunity.owner.Name} "/>
           <apex:inputField value="{!opportunity.Name} "/>                      
           <apex:inputField value="{!opportunity.Account.Name} "/>
           <apex:inputField value="{!opportunity.StageName}"/>                      
           <apex:inputField value="{!opportunity.Probability}"/>
           <apex:inputField value="{!opportunity.ExpectedRevenue}"/>
           <apex:inputField value="{!opportunity.ForecastCategoryName}" style="width:130px"/>
           <apex:inputField value="{!opportunity.IsPrivate}"/>
           <apex:inputField value="{!opportunity.LeadSource}"/>
           <apex:inputField value="{!opportunity.NextStep}"/>
           <apex:inputField value="{!opportunity.Description}"/>
           
           <apex:inputField value="{!opportunity.type}" style="width:130px"/>
       </apex:pageblocksection>  
        
        
   </apex:pageBlock>
 </apex:form>

</apex:page>

 

 

 

 

 

 

Hi

I am using apex:PageBlockTable which has huge records and  i have business requirement  to freez the header portion of PageBlock Table so that the header  will fix and data will move.

 

Any help will be greatful.

 

Thanks

Pravin

  • September 06, 2012
  • Like
  • 0

Hi..my reqirement is if he is an administrator need to display ' U r Admin' else ' U r not an Admin'...

 

Is it possible???

Hi All,

 

I have 5 tabs in my custom vf page.

These 5 tabs have some set of question and their score in a picklist value.

A user can selet a score from picklist value for all question.

Now i need to add these score from all the 5 tabs and pass it to Account detail page.

Also, i have one "Calculate Score" button in each page.

Is any one any inputs for the same.

 

Thanks,

Robin.

i have put username in coockie object in apex class and how to display username in visualforce page after login ?

 

can anyone help me plz ?