• Brijesh Kumar
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 31
    Replies
Hi All,


I want to print a report(visualforce page) by using window.print().In printed page,it prints some extra information like header as URL and Footer as page information and date information.I don't wamt to print these extra information.How can i hide header and footer from printed page.

Please reply me as soon as possible It's very urgent for my project.

 

Thanks & Regards,

Brijesh Baser



 

Hi
I have found an exception :

System.Exception: Too many SOQL queries: 101
I explain my problem with simple example.This example look like as my application:

public class class1
{
    void show()
    {
        for(Integer i=0;i<5;i++)
        {
            Double d1=class2.getData();
            Double d2=class3.getData();
        }
    }
public pageReference save()
{
show();
}
}




// Another Apex class


global class class2
{
    Webservice static Double getData()
    {
        Double d=0.0;
        for(Integer i=0;i<12;i++)
        {
            // perform SOQL Query
            //just like......
            for(Object__ c:[select id__c from Object__c])
            {
                d=c.id__c;
            }
        }
        return d;
    }
}

// Another Apex class



global class class3
{
   
Webservice static Double getData()
    {
        Double d=0.0;
        for(Integer i=0;i<12;i++)
        {
            // perform SOQL Query
            //just like......
            for(Object__ c:[select id__c from Object__c])
            {
                d=c.id__c;
            }
        }
        return d;
    }
}


When i call save() from visual force page i am getting exception Too many SOQL queries.
Please solve my problem.

Thanks & Regards
Brijesh Kumar Baser

Hi
I am using <apex:outputLink value="">Go</apex:outputLink>
 
when i click Go it should be open a new window not in existing window.
 
I achieve this by using java script but i don't want to use java script.Is there any attribute of<apex:outputLink> such that i open in new window.
 
Please give me a solution
 
Thanks & Regards
Brijesh Kumar Baser
Hi
I want to add 4-5 custom buttons in new section of page layout in salesforce.
Can you please give me some steps to how to add custom buttons in new section of page-layout.
My object is standard object(case).

Thanks & Regards
Brijesh Kumar Baser
Hi
I craete an email services.But I don't know how to use this email service.
 
My problem is, i want to create a button that send an email.when i click button it opens a visual force template.
then send an email.
 
 
Can you suggest me how can develop this.
 
please give me some idea about this.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
can you please help me when i click on mail-box image outlook express edition should be open such that i will be send an email
 
 
Thanks & Regards
Brijesh Kumar Baser
Hi
can you please help me when i click on mail-box image outlook express edition should be open such that i will be send an email
 
 
Thanks & Regards
Brijesh Kumar Baser
Hi
Can you please tell me how can send an email from salesforce visualforce page.
 
i have an image of mailbox,whenever click on image outlook express edition should be open.Inside to (text-box) it populates email id from edit page.Its urgently required in my project.please give me suggestion ASAP.
 
 
please tell me how can i develop this.
 
Thanks & Regards
Brijesh Kumar Baser

Hi
i want to declare this.......

private Double[][] matrix;


but i am getting error.i am not find a solution to declaration of 2-D array.
Please give me  a solution to declared 2-D array because i am working of 2D matrix inversion.
It is most requirement in our project.


Thanks & Regards
Brijesh kumar baser
Hi
can you tell me what is the method for getting current user's profile name in apex class.
 
In visualforce page, we can use    {!$Profile.Name}  
 
 
 
it gives current profile name but i want a relavant method  in apex code.
 
Thanks & Regards
Brijesh Kumar Baser
 
Hi
 
I loging as a system admin account & i wants all profile name in apex class.
can you give me a solution how can i get.
please help me
 
Thanks & regards
Brijesh kumar baser
Hi
We are using ext.js library,inside this we are using column -model class.
Inside column model class we are trying to apply css we successfully applied css for cells but we are not able to apply css to header.can you give us solution. we are waiting...........
 
Inside Column model class we are giving dynamically column header
 
Thanks & Regards
brijesh Kumar Baser
Hi
I use <apex:outputlink> for e.g.
<apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>
It has one attribute disabled,when it is true link is not clickable and when it is false link is normally.
I done how to non-clickable link for user based.But my requirement is how can hide link for particular user.
 
for non-clickable ,i differntciate user inside controller
private Boolean linkDisabled = false;
    private String userId = UserInfo.getProfileId();
    public PageReference hello() {
   
    if(userId!='00e70000000wnPPAAY')
    {
    linkDisabled = true;
    }
        return null;
    }
    public Boolean getLinkDisabled () {
        return linkDisabled ;
    }
 
so please give me a solution how can hide a link rather than non-clickable.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
How can i write method for same working as {!$User.LastName} in visual force page.
 
I also found what are the method's for
 
1.{!$UserRole
2.{!$User
3.{!$System
4.{!$SControl
5.{!$Profile
6.{!$Organization
7.{!$ObjectType
8.{!$Api
9.{!$Action
 
These are used in s-controll.I wants what are the method which can be used in apex-code.
Or you can give link where i got
 
 
Thanks & Regards
Brijesh baser
Hi
I used ext.js .I am not found dynamically columns.
Please give me some reference to get this.
 
 
Thanks & Regards
Brijesh Kumar Baser
hi
how can we expire session from visualforce page.
i used
 <apex:page >
  <apex:outputLink value="http://na5.salesforce.com/secur/logout.jsp">log-out</apex:outputLink>
</apex:page>
 
when i click logout application of this window log-out but another window is not log-out.So i wants whenever click log-out session should be expire.
Please help me
Thanks & Regards
Brijesh Baser
Hi
On salesforce application there is log-out facility.I wants same facility on visualforce page.How can i get this facility.
 
I used this
<apex:page showHeader="false" sidebar="false">
</apex:page>
 
In this page there is no log out link.so i wants logout facility in visualforce page.Please help me .It's very urgent requirement for my project.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
i create a output link in visual force page.
<apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>
when we right click the this link we wants to disable (open in new window)  or (open in new tab)
how can get this functionality in output link.please give me a reply because it's very urgent in my project requirement.
 
 
Thanks & Regards
Brijesh Kumar Baser
 
hi
I am trying to set hidden field value at onload event,but i am not able to do this.
 
 
here is my code:
 
<apex:page controller="TestForProfile" action="{!hello}">
 <apex:outputLink value="https://www.salesforce.com" id="theLink" disabled="{!linkDisabled}">www.salesforce.com</apex:outputLink>
 <apex:outputText value="{!$Profile.Name}"></apex:outputText>
 <apex:outputText value="{!myObject.hiddenField}"></apex:outputText>
 
 <apex:form id="form" >
   
    <apex:inputhidden id="otherName" value="{!myObject.hiddenField}" />
    <apex:commandButton action="{!hello}" onclick="changeValue()"></apex:commandButton>
    <script>
     
      var otherName = document.getElementById("{!$Component.otherName}");
    </script>
  </apex:form>
 
  <script>
   window.onload = new function() {
   otherName.value = "{!$Profile.Name}";
   alert("hello" + otherName.value);
  
    };
 
   
    function changeValue() {
    alert(otherName.value);
      otherName.value = "{!$Profile.Name}";
      return true;
    }
  </script>
   
</apex:page>
 
 
========================================
controller
=========================================
 
public class TestForProfile
{
    public PageReference hello() {
    System.debug('*****************'+getMyObject().hiddenField);
    if(getMyObject().hiddenField=='System Administrator')
    {
    linkDisabled = true;
    }
        return null;
    }
Boolean linkDisabled = false;

public Boolean getLinkDisabled () {
        return linkDisabled ;
    }
    public class MyObject {
    private String hiddenField = 'Lorem ipsum dolor';
   
    public String getHiddenField() { return hiddenField; }
    public void setHiddenField(String data) { hiddenField = data; }
   
  }
  private myObject my_object;
  public MyObject getMyObject() {
    if (my_object == null) { my_object = new MyObject(); }
    return my_object;
  }
  public String handleSubmit() {
    return null;
  }

}
 
 
 
At onclick event the hidden field value has been set. but I want to set hidden field value at onload event.
Inside
 window.onload = new function() {
   otherName.value = "{!$Profile.Name}";
   alert("hello" + otherName.value);
alert gives the changed value but in <apex:outputText value="{!myObject.hiddenField}"></apex:outputText>
 
It gives previous value. please give me a appropriate answer.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
I am using <apex:outputLink value="">Go</apex:outputLink>
 
when i click Go it should be open a new window not in existing window.
 
I achieve this by using java script but i don't want to use java script.Is there any attribute of<apex:outputLink> such that i open in new window.
 
Please give me a solution
 
Thanks & Regards
Brijesh Kumar Baser
Hi
I want to add 4-5 custom buttons in new section of page layout in salesforce.
Can you please give me some steps to how to add custom buttons in new section of page-layout.
My object is standard object(case).

Thanks & Regards
Brijesh Kumar Baser
Hi
I craete an email services.But I don't know how to use this email service.
 
My problem is, i want to create a button that send an email.when i click button it opens a visual force template.
then send an email.
 
 
Can you suggest me how can develop this.
 
please give me some idea about this.
 
Thanks & Regards
Brijesh Kumar Baser

Hi
i want to declare this.......

private Double[][] matrix;


but i am getting error.i am not find a solution to declaration of 2-D array.
Please give me  a solution to declared 2-D array because i am working of 2D matrix inversion.
It is most requirement in our project.


Thanks & Regards
Brijesh kumar baser
I am loving outlook connect from an efficiency standpoint.  The problem I have is that it opens a IE window with every move.  Is it possible to identify Firefox as the preferred browser?  Firefox currently opens with everything else in my outlook setup how can I make this happen in outlook connect?

Forgive me if this has already been asked or if the fix is under my nose.

Lindsey
  • September 19, 2008
  • Like
  • 0
Hi
can you tell me what is the method for getting current user's profile name in apex class.
 
In visualforce page, we can use    {!$Profile.Name}  
 
 
 
it gives current profile name but i want a relavant method  in apex code.
 
Thanks & Regards
Brijesh Kumar Baser
 
Hi
 
I loging as a system admin account & i wants all profile name in apex class.
can you give me a solution how can i get.
please help me
 
Thanks & regards
Brijesh kumar baser
Hi
I use <apex:outputlink> for e.g.
<apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>
It has one attribute disabled,when it is true link is not clickable and when it is false link is normally.
I done how to non-clickable link for user based.But my requirement is how can hide link for particular user.
 
for non-clickable ,i differntciate user inside controller
private Boolean linkDisabled = false;
    private String userId = UserInfo.getProfileId();
    public PageReference hello() {
   
    if(userId!='00e70000000wnPPAAY')
    {
    linkDisabled = true;
    }
        return null;
    }
    public Boolean getLinkDisabled () {
        return linkDisabled ;
    }
 
so please give me a solution how can hide a link rather than non-clickable.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
How can i write method for same working as {!$User.LastName} in visual force page.
 
I also found what are the method's for
 
1.{!$UserRole
2.{!$User
3.{!$System
4.{!$SControl
5.{!$Profile
6.{!$Organization
7.{!$ObjectType
8.{!$Api
9.{!$Action
 
These are used in s-controll.I wants what are the method which can be used in apex-code.
Or you can give link where i got
 
 
Thanks & Regards
Brijesh baser
Hi
I used ext.js .I am not found dynamically columns.
Please give me some reference to get this.
 
 
Thanks & Regards
Brijesh Kumar Baser
Hi
On salesforce application there is log-out facility.I wants same facility on visualforce page.How can i get this facility.
 
I used this
<apex:page showHeader="false" sidebar="false">
</apex:page>
 
In this page there is no log out link.so i wants logout facility in visualforce page.Please help me .It's very urgent requirement for my project.
 
Thanks & Regards
Brijesh Kumar Baser
Hi
i create a output link in visual force page.
<apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>
when we right click the this link we wants to disable (open in new window)  or (open in new tab)
how can get this functionality in output link.please give me a reply because it's very urgent in my project requirement.
 
 
Thanks & Regards
Brijesh Kumar Baser