• rajs
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 12
    Replies

Hello,

 

I have used 'Double' data type variables in my simple addition calculations.  Input valuses containing 2 decimal places so I'm expecting same decimal places in the result of addition but it's not giving the expected result.

 

Double du1 = 600.66, du2 = 600.00;
Double du3 = du1+du2;
System.debug('**** Total = '+ du3);

Here Expected Result = 1200.66
but Actual Result = 1200.6599999999999

 

If I use Decimal data type, I can get the expected result. Whats wrong in 'Double' datatype. Can any one help me to understand the issue

 

Note: I'm getting these unexpected result for some selected inputs only

 

Thanks,

Raj

  • February 03, 2012
  • Like
  • 0

Created one visualforce page and placed this on "Home Page"  by using "Sidebar component" with <iframe> tag. Here my problem is, when I click the button on that page, It refreshes with in the iframe instead of refreshing parent window.

 

Can you please guide me to refresh the parent window from iframe?

 

Thanks in advance!

  • September 13, 2010
  • Like
  • 0

Hi,

    I have problem in Batch Apex Query.Below is My Query,

 

 

return DataBase.getQueryLocator('Select Id,Account.Annual_Account_Target_Number__c,Account.Target_for_Q1__c,Account.Target_for_Q2__c,Account.Target_for_Q3__c,Account.Target_for_Q4__c,Territory.Name,Account.Name,Opportunity__c,CloseDate,Projections__c,Closed_Won__c,AccountId,StageName,(Select Id, Name,Start_Date__c,End_Date__c,Opportunity__c,Resource_Amount__c,CreatedDate From OpportunityProducts__r where Start_Date__c >= '+g_StartDate+' AND End_Date__c <= '+ g_EndDate +') from Opportunity where (StageName!=\'Lead\' AND StageName!=\'Closed Lost\') AND (CloseDate >= '+g_StartDate+' AND CloseDate <= '+ g_EndDate +' )ORDER BY CloseDate');

 

 The error message is : System.QueryException: line 1:411 no viable alternative at character ' ' .

 

Please help me to get out from this bug.

 

Thanks! 

 

  • November 19, 2009
  • Like
  • 0

Hi,I am not able to call the webservices which is exposed by our client.I have used webservice callout and http protocols but not working.

 

 can you guide me ?

 

What I have tried ,

 

My services are living here 'https://www.criminalbackground.com/HRXMLWebServiceTest/Service.asmx'

 

Http h = new Http(); HttpRequest req = new HttpRequest(); String url= 'https://www.criminalbackground.com/HRXMLWebServiceTest/Service.asmx'; req.setEndpoint(url); req.setMethod('POST'); req.setHeader('content-type','text/xml'); req.setHeader('SOAPAction','GetPackages(userId,password)'); HttpResponse res = new HttpResponse(); res= h.send(req); //code ...

how to call the 'getpackage(String UserId,String Password)' method from our apex class.

Please give some example code other than sfdoc examples which will be helpful to us.

 

Thanks,

Raj

Message Edited by rajs on 07-10-2009 07:59 AM
  • July 10, 2009
  • Like
  • 0

Hi All ,

      

  I am accessing webservices through this end point URL "https://www.criminalbackground.com/HRXMLWebServiceTest/Service.asmx".There are four service available in this URL.I could able to access the " getpackage "  service but I am not able to acess the "Submitscreening" service. In Submitscreening service In Submitscreening service,HR-XML(www.hr-xml.org) is a input. anybodies who have work with HR-XML schema. If so please share your exprience.

 

Note:I could able to pass xml as request, but Iam not able to pass an hr-xml as input.

 

Thanks,

Raj

  • July 06, 2009
  • Like
  • 0

Hi ,

   I am trying to access facebook application in Visual force page. I have followed each step given in the facebook tutorial(Facebook Integration)But This is not working for me. The log details is listed below

 

***Begining Page Log for /apex/FBToolkitPage 20090406121610.772:Class.FBTemplateController.<init>: line 16, column 9: FBTemplateController Constructor 20090406121610.772:Class.FBTemplateController.initConnection: line 26, column 9: FBTemplateController initConnection() 20090406121610.772:Class.FBTemplateController.initConnection: line 27, column 9: Raj Test 2: End initConnection() 20090406121610.772:Class.FacebookUtils.mapOut: line 51, column 9: SelectLoop:SET:String 20090406121610.772:Class.FacebookConnection.initialize: line 60, column 85: returning String from method public static String mapOut(MAP:String,String) in 0 ms 20090406121610.772:Class.FacebookConnection.initialize: line 60, column 9: FacebookConnection initialize() appName=Raj core.apexpages.devmode.url=1 20090406121610.772:Class.FacebookUtils.mapOut: line 51, column 9: SelectLoop:SET:String 20090406121610.772:Class.FacebookConnection.initializeParams: line 54, column 91: returning String from method public static String mapOut(MAP:String,String) in 0 ms 20090406121610.772:Class.FacebookConnection.initializeParams: line 54, column 9: FacebookConnection initializeParams() appName=Raj core.apexpages.devmode.url=1 20090406121610.772:Class.FacebookUtils.mapOut: line 51, column 9: SelectLoop:SET:String 20090406121610.772:Class.FacebookConnection.loadParameters: line 83, column 89: returning String from method public static String mapOut(MAP:String,String) in 0 ms 20090406121610.772:Class.FacebookConnection.loadParameters: line 83, column 9: FacebookConnection loadParameters() appName=Raj core.apexpages.devmode.url=1 20090406121610.772:Class.FacebookConnection.loadParameters: line 87, column 9: SelectLoop:SET:String 20090406121610.772:Class.FacebookConnection.initializeParams: line 56, column 9: returning from end of method private static void loadParameters(MAP:String,String) in 1 ms 20090406121610.772:Class.FacebookConnection.initialize: line 61, column 9: returning from end of method public static void initializeParams(MAP:String,String) in 1 ms 20090406121610.772:Class.FacebookConnection.initialize: line 70, column 9: {appName=Raj, core.apexpages.devmode.url=1} 20090406121610.772:Class.FacebookConnection.setKeys: line 102, column 9: FacebookConnection setKeys() Keys fbUserId: null sessionKey: null appKey: null appName: Raj 20090406121610.772:Class.FacebookConnection.checkAppRegistration: line 134, column 9: FacebookConnection checkAppRegistration() arguments apiKey: null appName: Raj 20090406121610.772:Class.FacebookConnection.checkAppRegistration: line 136, column 17: SOQL count() query with 1 row finished in 9 ms 20090406121610.772:Class.FacebookConnection.checkAppRegistration: line 137, column 43: SOQL query with 1 row finished in 5 ms 20090406121610.772:Class.FacebookConnection.setKeys: line 103, column 35: returning SOBJECT:FacebookAppList__c from method private static SOBJECT:FacebookAppList__c checkAppRegistration(String, String) in 16 ms 20090406121610.772:Class.FacebookConnection.setKeys: line 106, column 13: IN SETKEYS Appsecret is: d0d9b2e91a90959b7493ccdad8c336a5 20090406121610.772:Class.FacebookConnection.getFBApp: line 117, column 9: FacebookConnection getFBApp() arguments: api_key: 26c7f86fcddfeac3e87c46d7cb44c94j (Modified for security reason) fb_user_id: null force_user_id: 00580000001maB9AAI

 

       

 

Session key also null when I run this toolkit. I think the problem is "fb_user_id: null" . Please let me know where I made a mistake,Please let me know ,your own way to integrate the facebook through Visualforce and APEX.

 

Thanks

Raj

 

 

  • April 06, 2009
  • Like
  • 0
Hi All
    In my Components table having 2000 records. 1500  components are  Old  Components  and  500 are New.
my requirement is to display  all the 'Old Components'  in a picklist. when i use List like

List<Components__c> Equip=[select Id, Name, category__c from Components__c where category__c=:'old'];

to get the old components it shows error message.I think its Apex governor limit problem.how can i overcome this problem?

Regards
Raj
  • January 19, 2009
  • Like
  • 0
Hi
       I want use '>' and '<' char in my page.
Sample code:
<apex:commandbutton action="{!Save}" value=">" id="S1" />
but it not working for me . Can u  find where i made mistake.
 
 
Regards
Raj
  • December 22, 2008
  • Like
  • 0
In my visual force page,I am using <apex:actionstatus> and i assign two different JavaScript function to 'onstart' and 'onstop' attribute of actionstatus.onstart function is working fine but onstop function is not working well.
 
My sample code:
Code:
<apex:page Standardcontroller="Contact">
 <apex:form >
  <apex:pageBlock title="Calculated Lighting Measures" mode="edit" id="page">
   <apex:pageBlockButtons location="bottom">
    <apex:commandButton value="  Save  " action="{!Save}"  id="Sve"/>
    <apex:commandButton value="Cancel " action="{!Cancel}" />
    <script>
    function Btndisable()
    {
     alert("Hi");
    }
    function Btnenable()
    {
     alert("Hell0");
    }
    </script>
   </apex:pageBlockButtons>
   <apex:pageBlockSection columns="1" title="Information" id="info" >
    <apex:inputfield value="{!Contact.Picklist__c}">
     <apex:actionSupport event="onchange"  status="ActionStatus"  />
    </apex:inputfield>
    <apex:actionStatus id="ActionStatus" startText="Please Wait" onstart="BtnDisable()" onstop="BtnEnable()" ></apex:actionStatus>
   </apex:pageBlockSection>
  </apex:pageBlock>
 </apex:form >
</apex:page>               
              

 

 
Can any one help me to find , where i made mistake
 
Raj
  • December 16, 2008
  • Like
  • 0
Hi,
    I am new to Visualforce.
I have created five picklist fields by dynamicaly (b'cause of my requirements) by using PageBlockTable.I have used "setter" method to access field values.
but i could  access  only fifth picklist value (last field),insted of accesing all the picklist values.because setter method workes only on last picklist.
please help me:How to get selected values from all the five picklist.
My visualforce code:
 
<apex:page controller="Dynamicsample" id="thepage">
 <apex:pageBlock>   
   <apex:form>
     <apex:pageBlockTable value="{!tabval}" var="tabl">
               <apex:column>
                          <apex:selectList value="{!countries}" multiselect="false" size="1">
                                  <apex:selectOptions value="{!items}"/>
                                 <apex:actionSupport event="onchange" reRender="out" status="status"/>
                          </apex:selectList>
                </apex:column>
       </apex:pageBlockTable> 
       </apex:form>
        <apex:outputPanel id="out">
                <apex:actionstatus id="status" startText="testing...">
                        <apex:facet name="stop">
                                <apex:outputPanel>
                                        <p>You have selected:</p>
                                        <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
                                </apex:outputPanel>
                        </apex:facet>
                </apex:actionstatus>
        </apex:outputPanel>
   </apex:pageBlock>
</apex:page>
 
Controller Code:
 
 
public class Dynamicsample {
 
        String countries;
  Integer[] g=new Integer[]{1,2,3,4,5};
       
        public List<SelectOption> getItems() {
                List<SelectOption> options = new List<SelectOption>();
                options.add(new SelectOption('US','US'));
                options.add(new SelectOption('India','India'));
                options.add(new SelectOption('CANADA','Canada'));
                options.add(new SelectOption('MEXICO','Mexico'));
                return options;
            }
 
        public String getCountries() {
                return countries;
        }
 
        public void setCountries(String countries) {
                this.countries = countries;
          }
  public Integer[] gettabval()
    {
       return g;
    }
 }
 
please debug my code.let me know where i made a mistake.
 
  • September 08, 2008
  • Like
  • 0

Hi,

 

Any thoughts on the best way to show charts on a visualforce page rendered as PDF.

 

I have installed the google visulisation API which is great for interactive charts within the browser but it does not lead itself to PDF.

 

Thanks

 

R

Hi,I am not able to call the webservices which is exposed by our client.I have used webservice callout and http protocols but not working.

 

 can you guide me ?

 

What I have tried ,

 

My services are living here 'https://www.criminalbackground.com/HRXMLWebServiceTest/Service.asmx'

 

Http h = new Http(); HttpRequest req = new HttpRequest(); String url= 'https://www.criminalbackground.com/HRXMLWebServiceTest/Service.asmx'; req.setEndpoint(url); req.setMethod('POST'); req.setHeader('content-type','text/xml'); req.setHeader('SOAPAction','GetPackages(userId,password)'); HttpResponse res = new HttpResponse(); res= h.send(req); //code ...

how to call the 'getpackage(String UserId,String Password)' method from our apex class.

Please give some example code other than sfdoc examples which will be helpful to us.

 

Thanks,

Raj

Message Edited by rajs on 07-10-2009 07:59 AM
  • July 10, 2009
  • Like
  • 0
Hi All
    In my Components table having 2000 records. 1500  components are  Old  Components  and  500 are New.
my requirement is to display  all the 'Old Components'  in a picklist. when i use List like

List<Components__c> Equip=[select Id, Name, category__c from Components__c where category__c=:'old'];

to get the old components it shows error message.I think its Apex governor limit problem.how can i overcome this problem?

Regards
Raj
  • January 19, 2009
  • Like
  • 0
I have created one flex component and I include this in static resource and I call this in my visual force page by this direction
Code:
<apex:page>
<apex:flash height="55%" width="80%" src="{!$Resource.Gaugesemicircular}"></apex:flash>
</apex:page>
Its working fine in the local system but its not, when I integrate in SF.
Please let me know where I committed mistakes.

 
  • December 18, 2008
  • Like
  • 0
In my visual force page,I am using <apex:actionstatus> and i assign two different JavaScript function to 'onstart' and 'onstop' attribute of actionstatus.onstart function is working fine but onstop function is not working well.
 
My sample code:
Code:
<apex:page Standardcontroller="Contact">
 <apex:form >
  <apex:pageBlock title="Calculated Lighting Measures" mode="edit" id="page">
   <apex:pageBlockButtons location="bottom">
    <apex:commandButton value="  Save  " action="{!Save}"  id="Sve"/>
    <apex:commandButton value="Cancel " action="{!Cancel}" />
    <script>
    function Btndisable()
    {
     alert("Hi");
    }
    function Btnenable()
    {
     alert("Hell0");
    }
    </script>
   </apex:pageBlockButtons>
   <apex:pageBlockSection columns="1" title="Information" id="info" >
    <apex:inputfield value="{!Contact.Picklist__c}">
     <apex:actionSupport event="onchange"  status="ActionStatus"  />
    </apex:inputfield>
    <apex:actionStatus id="ActionStatus" startText="Please Wait" onstart="BtnDisable()" onstop="BtnEnable()" ></apex:actionStatus>
   </apex:pageBlockSection>
  </apex:pageBlock>
 </apex:form >
</apex:page>               
              

 

 
Can any one help me to find , where i made mistake
 
Raj
  • December 16, 2008
  • Like
  • 0
Hi,
    I am new to Visualforce.
I have created five picklist fields by dynamicaly (b'cause of my requirements) by using PageBlockTable.I have used "setter" method to access field values.
but i could  access  only fifth picklist value (last field),insted of accesing all the picklist values.because setter method workes only on last picklist.
please help me:How to get selected values from all the five picklist.
My visualforce code:
 
<apex:page controller="Dynamicsample" id="thepage">
 <apex:pageBlock>   
   <apex:form>
     <apex:pageBlockTable value="{!tabval}" var="tabl">
               <apex:column>
                          <apex:selectList value="{!countries}" multiselect="false" size="1">
                                  <apex:selectOptions value="{!items}"/>
                                 <apex:actionSupport event="onchange" reRender="out" status="status"/>
                          </apex:selectList>
                </apex:column>
       </apex:pageBlockTable> 
       </apex:form>
        <apex:outputPanel id="out">
                <apex:actionstatus id="status" startText="testing...">
                        <apex:facet name="stop">
                                <apex:outputPanel>
                                        <p>You have selected:</p>
                                        <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
                                </apex:outputPanel>
                        </apex:facet>
                </apex:actionstatus>
        </apex:outputPanel>
   </apex:pageBlock>
</apex:page>
 
Controller Code:
 
 
public class Dynamicsample {
 
        String countries;
  Integer[] g=new Integer[]{1,2,3,4,5};
       
        public List<SelectOption> getItems() {
                List<SelectOption> options = new List<SelectOption>();
                options.add(new SelectOption('US','US'));
                options.add(new SelectOption('India','India'));
                options.add(new SelectOption('CANADA','Canada'));
                options.add(new SelectOption('MEXICO','Mexico'));
                return options;
            }
 
        public String getCountries() {
                return countries;
        }
 
        public void setCountries(String countries) {
                this.countries = countries;
          }
  public Integer[] gettabval()
    {
       return g;
    }
 }
 
please debug my code.let me know where i made a mistake.
 
  • September 08, 2008
  • Like
  • 0