• anuraj
  • NEWBIE
  • 55 Points
  • Member since 2011

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

Hi,

 

I am new to Visual Force development and creating my first visual force page. All that I want to do is show records from a custom object on a VF page. I don't see any employee names.

 

Below is my code.

<apex:page standardController="Employee__c" >    

   <apex:pageBlock title="Employee details">      

       Employee email -  {!Employee__c.Emp_Email__c}       

   </apex:pageBlock>   

   <apex:detail />  

</apex:page>

 

Any help is much appreciated.

Thanks.

Hi 

I am trying to Pass parameter to Apex method from VF page. But i am not able to get the parameter value.

 

My code

<td ><apex:outputText value="{!slot.tstart1}"/></td> 
<td width="15%" hight="5%"><apex:commandButton value="Book Appointment" action="{!callAppointment}" id="buttonid">
<apex:param name="tstart" value="{!slot.tstart1}" />
</apex:commandButton> </td>

 

public PageReference callAppointment() 
    {
       
        PageReference redirect = new PageReference ('/apex/appointment');
       // redirect.getParameters().put('time', liTimeSlots);
       // string myParam = apexpages.currentpage().getparameters().get('tstart');
        system.debug('++++++++++++++++++++++++++++++ apexpages.currentpage() '+ apexpages.currentpage().getparameters().get('tstart1') );
        redirect.getRedirect();
        return redirect;
    }

 debug log 

04:42:39.064 (64864000)|SYSTEM_METHOD_EXIT|[682]|System.PageReference.getParameters()
04:42:39.064 (64887000)|SYSTEM_METHOD_ENTRY|[682]|MAP.get(ANY)
04:42:39.064 (64902000)|SYSTEM_METHOD_EXIT|[682]|MAP.get(ANY)
04:42:39.064 (64927000)|SYSTEM_METHOD_ENTRY|[682]|System.debug(ANY)
04:42:39.064 (64936000)|USER_DEBUG|[682]|DEBUG|++++++++++++++++++++++++++++++ apexpages.currentpage() null
04:42:39.064 (64943000)|SYSTEM_METHOD_EXIT|[682]|System.debug(ANY)
04:42:39.064 (64956000)|SYSTEM_METHOD_ENTRY|[683]|System.PageReference.getRedirect()
04:42:39.065 (65014000)|SYSTEM_METHOD_EXIT|[683]|System.PageReference.getRedirect()
04:42:39.065 (65045000)|CODE_UNIT_FINISHED|AppointmentController invoke(callAppointment)
04:42:39.065 (65090000)|VF_APEX_CALL|buttonid|{!callAppointment}|PageReference:/apex/appointment

 Please help me to find the solution for this 

 

Thanks

Anuraj

 


  • February 15, 2012
  • Like
  • 0

Hi

I am trying to load xml into the salesforce but not getting value into the salesforce

 

my Vf page 

<apex:page controller="testxmlCont">
  <apex:form >
    <apex:commandButton value="{!runxml}" title="click"/>
  </apex:form>
</apex:page>

 Controller 

public class testxmlCont {

    public String getRunxml() 
    {
        String fakeSoapResponse = '';
            
                fakeSoapResponse = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">' +
                '<soap:Header>' +
                '<wsa:Action>http://www.right90.com/r90/v1/api/UpdateGenericForecastResponse</wsa:Action>' +
                '<wsa:MessageID>urn:uuid:2cee4a82-6492-4453-a42b-2c353ed0f630</wsa:MessageID>' +
                '<wsa:RelatesTo>urn:uuid:524e9e22-e97a-4e6f-9ed6-33049c22ebab</wsa:RelatesTo>' +
                '<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>' +
                '</soap:Header>' +
                '<soap:Body xmlns="http://www.right90.com/r90/v1/api">' +
                '<UpdateGenericForecastResponse xmlns="http://www.right90.com/r90/v1/api">' +
                '<UpdateGenericForecastResult xmlns="http://www.right90.com/r90/v1/api">' +
                '<ForecastResponse>' +
                '<StatusCode>Success</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message></Message>' +
                '<Element ExternalSystemId="00kS00000046XUIIA2" R90ElementId="107091"/>' +
                '<JudgmentResponses>' +
                '<JudgmentResponse>' +
                '<StatusCode>Success</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message>Successfully processed.</Message>' +
                '<Judgment MeasureName="FACTOR" Value="8" ForecastDate="2010-07-15T00:00:00" ModifiedByUserName="r90admin"/>' +
                '</JudgmentResponse>' +
                '</JudgmentResponses>' +
                '<JudgmentResponse>' +
                '<StatusCode>Error</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message>Time period specified is out of time horizon range.</Message>' +
                '<Judgment MeasureName="FACTOR" Value="0.58" ForecastDate="2013-05-15T00:00:00" ModifiedByUserName="r90admin" />' +
                '</JudgmentResponse>' +
                '</ForecastResponse>' +
                '</UpdateGenericForecastResult>' +
                '</UpdateGenericForecastResponse>' +
                '</soap:Body>' +
                '</soap:Envelope>' ;
            
            Dom.Document fakeDoc = new Dom.Document();
            fakeDoc.load(fakeSoapResponse);
           // envelope = fakeDoc.getRootElement();
            system.debug('++++++++++++++++++++++ '+fakeDoc);
            system.debug('+++++++++++++++++++++++++++++++Enve');
           // system.debug(envelope);

        return null;
    }

}

 I am getting this in the debug log.

23:13:27.075 (75334000)|SYSTEM_METHOD_ENTRY|[45]|System.debug(ANY)
23:13:27.075 (75355000)|USER_DEBUG|[45]|DEBUG|++++++++++++++++++++++ Document[]
23:13:27.075 (75379000)|SYSTEM_METHOD_EXIT|[45]|System.debug(ANY)
23:13:27.075 (75415000)|SYSTEM_METHOD_ENTRY|[46]|System.debug(ANY)
23:13:27.075 (75481000)|USER_DEBUG|[46]|DEBUG|+++++++++++++++++++++++++++++++Enve
23:13:27.075 (75510000)|SYSTEM_METHOD_EXIT|[46]|System.debug(ANY)
23:13:27.075 (75535000)|CODE_UNIT_FINISHED|testxmlCont invoke(getrunxml)

 Can you please help me to solve my problem.

 

Thanks

Anuraj

 

  • February 06, 2012
  • Like
  • 0

i am writing a test class on this trigger 

rigger FillAccountandProduct on BBB_Transactions__c (before insert)
{
Set<String> productNames = new Set<String>();
Set<String> AccntNames = new Set<String>();

Map<String,integer> producttoSAPId=new Map<String,integer>();
Map<String,integer> accnttoSAPId=new Map<String,integer>(); 
  for (BBB_Transactions__c Btr : Trigger.new) 
    {    
      productNames.add(Btr.Product__c);
      AccntNames.add(Btr.Forecasted_Customer__c);
      
    }
   for(Product2 Pr:[Select p.Name,p.SAP_ID__c from Product2 p where p.Name in :productNames])
  {       
      producttoSAPId.put(Pr.Name,integer.valueOf(Pr.SAP_ID__c));
      
      
  }    
    for(Account a:[Select p.R90_Account_Name__c,p.SAP_ID__c from Account p where p.R90_Account_Name__c in :AccntNames])
  {       
      accnttoSAPId.put(a.R90_Account_Name__c,integer.valueOf(a.SAP_ID__c));      
  } 
    for (BBB_Transactions__c Btr : Trigger.new) 
    {
      Btr.SAP_Account_ID__c=accnttoSAPId.get(Btr.Forecasted_Customer__c);
      Btr.SAP_Product_ID__c=producttoSAPId.get(Btr.Product__c);
    }
    
}

 I wrote it like this

@isTest
public class TestFillAccountandProduct 
{
  static testmethod void testAccountandProduct()
  {
     String strRecordTypeIdItem = [Select Id, Name From RecordType Where SobjectType = 'Account' and Name = 'SAP Customer'].id;
     BBB_Transactions__c bbt = new BBB_Transactions__c();
     bbt.Product__c = 'bbproduct';
     bbt.Forecasted_Customer__c = 'bbforcast';
     bbt.Name = 'bbName';
     insert bbt;
     
     Product2 p = new Product2();
     p.Name = bbt.id;
     p.SAP_ID__c = 'pSapId';
     insert p;
     
     list< product2> pr2 = new list< product2>();
     pr2 = [select SAP_ID__c, name from product2 where name = :bbt.Product__c]; 
     
     Account a = new Account();
    // a.R90_Account_Name__c = bbt.id;
     a.Name = 'aName';
     a.Has_customer_been_contacted_or_visite__c  = 'ahasC';
     a.SAP_ID__c = 'aSname';
     a.RecordTypeId = strRecordTypeIdItem; 
     a.Location_Type__c = 'aLocation';
     insert a;
     
     list<Account> ac = new list<Account>();
     ac = [Select SAP_ID__c, R90_Account_Name__c from account where  R90_Account_Name__c = :bbt.Forecasted_Customer__c];
     
     list<BBB_Transactions__c> bt = new list<BBB_Transactions__c>();
     bt = [Select Product__c, Forecasted_Customer__c, SAP_Account_ID__c , SAP_Product_ID__c   from BBB_Transactions__c where id= :bbt.id];
     
    // bt[0].SAP_Product_ID__c  = bt[0].Forecasted_Customer__c;
    // bt[0].SAP_Account_ID__c  = bt[0].Product__c;
    // update bt;
     //system.assertEquals(bt[0].SAP_Account_ID__c, bt[0].Forecasted_Customer__c);
     //system.assertequals(bbt.SAP_Product_ID__c, bbt.Product__c);
   }
}

 but it have some error and need some changes which i am not able to make 

please help me 

 

Thanks

Anuraj

  • January 04, 2012
  • Like
  • 0

Hi

Please help me i want to get the number value in the bracket () 

456test(tata)(123)

i want 123 from the example 

the number in the bracket changes record by record so i want the number from the bracket 

thanks 

Anuraj

 

 

  • January 04, 2012
  • Like
  • 0

Hi

I have wrote a bean in process conf in apex data loder  

 

C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin>process.bat ../samples/conf BBBT

0 [main] INFO com.salesforce.lexiloader.process.ProcessConfig  - Loading process configuration from config file: C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin\..\samples\conf\process-conf.

xml

766 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin\..\samples\conf\proce

ss-conf.xml]

891 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Using JAXP implementation [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl@1256ea2]

3359 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  - Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system ID [http://www.springframework.org/dt

d/spring-beans.dtd]

3391 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  - Trying to locate [spring-beans.dtd] in Spring jar

3391 [main] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver  - Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath

3969 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser  - Loading bean definitions

4656 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser  - Default lazy init 'false'

4656 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser  - Default autowire 'no'

4656 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser  - Default dependency check 'none'

4703 [main] INFO org.springframework.core.CollectionFactory  - JDK 1.4+ collections available

4922 [main] INFO org.springframework.core.CollectionFactory  - Commons Collections 3.x available

4922 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.util.LinkedHashMap]

4938 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.util.LinkedHashMap]

4938 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.util.LinkedHashMap]

4953 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.util.LinkedHashMap]

4953 [main] DEBUG org.springframework.core.CollectionFactory  - Creating [java.util.LinkedHashMap]

5047 [main] ERROR com.salesforce.lexiloader.process.ProcessConfig  - Error loading process: BBBT configuration from config file: C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin\..\samples\co

nf\process-conf.xml

org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'BBBT' defined in file [C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin\..\samples\conf\proce

ss-conf.xml]: Bean class [com.salesforce.dataloader.process.ProcessRunner] not found; nested exception is java.lang.ClassNotFoundException: com.salesforce.dataloader.process.ProcessRunner

java.lang.ClassNotFoundException: com.salesforce.dataloader.process.ProcessRunner

        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:242)

        at org.springframework.util.ClassUtils.forName(ClassUtils.java:108)

        at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)

        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:426)

        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:392)

        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:307)

        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:295)

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)

        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)

        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:68)

        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:56)

        at com.salesforce.lexiloader.process.ProcessConfig.getBeanFactory(ProcessConfig.java:79)

        at com.salesforce.lexiloader.process.ProcessConfig.getProcessInstance(ProcessConfig.java:68)

        at com.salesforce.lexiloader.process.ProcessRunner.getInstance(ProcessRunner.java:262)

        at com.salesforce.lexiloader.process.ProcessRunner.getInstance(ProcessRunner.java:248)

        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:227)

C:\Program Files\salesforce.com\Apex Data Loader 14.0\bin>

 

my bean

<bean id="BBBT"
class="com.salesforce.dataloader.process.ProcessRunner"
singleton="false">
<property name="name" value="BBBT"/>
<property name="configOverrideMap">
<map>
<entry key="sfdc.endpoint" value="https://test.salesforce.com"/>
<entry key="sfdc.username" value="anuraj@cm-focus.com"/>
<!-- password below has been encrypted using key file, therefore it will not work without the key setting: process.encryptionKeyFile
the password is not a valid encrypted value, please generate the real value using encrypt.bat utility -->
<entry key="sfdc.password" value="afe97be08dcd23770450e1e255217d600fc01a2740d63f9fd65ec29475da4681edbcbcf7c98cbf73"/>
<entry key="sfdc.timeoutSecs" value="600"/>
<entry key="sfdc.loadBatchSize" value="200"/>
<entry key="sfdc.entity" value="BBB_Transaction__c"/>
<entry key="process.operation" value="insert"/>
<entry key="process.mappingFile" value="C:\Program Files\salesforce.com\Apex Data Loader 14.0\samples\conf\BBB_TransactionsMapFile.sdl"/>
<entry key="dataAccess.name" value="C:\Program Files\salesforce.com\Apex Data Loader 14.0\samples\data\TestLoad.csv"/>
<entry key="dataAccess.type" value="csvRead"/>
<entry key="process.initialLastRunDate" value="2006-12-01T00:00:00.000-0800"/>
<entry key="sfdc.debugMessages" value="true"/>
<entry key="sfdc.debugMessagesFile" value="C:\Program Files\salesforce.com\Apex Data Loader 14.0\samples\data\accountMasterSoapTrace.log"/>
</map>
</property>
</bean>

 

thanks

Anuraj

 

  • January 04, 2012
  • Like
  • 0

Please tell me how to get the value from the bracket in regex expression. i am trying to get the number from the bracket.

String selectvalue = '456TATA(Test)(123)';
Pattern p = Pattern.compile('(\B)');
String test = p.matcher(selectvalue).replaceAll('');
inputvalue = test;
return null;

 

I want '123' from 456TATA(Test)(123).
please help me to solve this
Thanks

Thanks

  • January 02, 2012
  • Like
  • 0

Hi 

please tell me how to copy a value on clicking a button. and after that i want to past the value into a notepad using keybord (ctrl+ v)

 

thanks 

Anuraj

  • December 27, 2011
  • Like
  • 0

Hi 

I am trying to display the account name , Mailing_Street__c from account object in VF page but i am not able to display it. The code is here 

<apex:page standardController="account">
<apex:form >
<apex:pageBlock >

{!account.name}
<apex:pageBlockSection title="Account Details" columns="1"> 
<apex:outputField value="{!account.name}" label="Account" />
<apex:outputField value="{!account.Mailing_Street__c}"/>
</apex:pageBlockSection>

<!--<table border ="1">
  <tr>
    <td>{!account.name}</td>
  </tr>
</table>-->
</apex:pageBlock>
</apex:form>
</apex:page>

  When i used this code i am only able to display the field name only. please help me to solve this problem.

thanks

Anuraj

  • December 27, 2011
  • Like
  • 0

Hi

I am writing a test class but i am getting this error 

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION,

 

but when i enetr value to

p.Forecastable__c = 'yes'; 

then i have another

error Field is not writeable: 

it is a formula filed

 

Please help me to solve this 

Thanks

Anuraj

 

  • December 09, 2011
  • Like
  • 0

Hi

 I am writing a test class for a trigger. But i am not able to run it properly it only contain 68%. 

The error is

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This part is not forecastable. Contact the Marketing Manager for more information, refer to the Parts Lookup report in the TriQuint Pricing Reports folder.: []

 

my code is

@isTest
private class TestTriggers
{
   static testMethod void testService()
   {        
   //Insert part    
    list<Opportunity> Opportunity = new list<Opportunity>();
    Opportunity = [Select id from Opportunity];
    list<Product2> Product = new list<Product2>();
    Product = [Select id from Product2];
    Part__c p = new Part__c(Stage__c = 'idea',Product__c=Product[0].id,Opportunity__c=Opportunity[0].id);
    insert p;
   
   //Update part
    list<part__c> partlist = new list<part__c>();
    partlist =  [Select Stage__c from part__c where Stage__c = 'idea'];
    partlist[0].Stage__c = 'update';
    update partlist;/* */
   }
}

 Thanks

Anuraj

  • December 06, 2011
  • Like
  • 0

 Hi
I am new to jasper only 2 days before i started. I download jasperReports and iReports. And installed iReports and installed jasper4salesforce in my salesforce account but not find any setup with jasperReports. How to use it I am totally confused i am not getting any idea to use it can you please help me to find the solution. I am trying to connect jasper to salesforce. 

Thanks   
Anuraj

  • December 02, 2011
  • Like
  • 0

Please tell me is it possible to connect jaspersoft iReport with salesforce. If yes then please tell me the ways to connect the salesforce with jaspersoft iReport.

Thanks

Anuraj

  • November 30, 2011
  • Like
  • 0

Please tell me is it possible to connect jaspersoft iReport with salesforce. If yes then please tell me the ways to connect the salesforce with jaspersoft iReport.

Thanks

Anuraj

  • November 30, 2011
  • Like
  • 0

Hi

   I have a trigger in Event and 1 in Appointment. If any update of delet in any of the object Event or Appointment the trigger will fire and will update or delet. eg : if any record is updated in the Event it also effect the Appointment. same happen with the Appointment. but i cant able to stop it please help me. If it is updated of deleted once then the trigger should not be fireed.

Thanks

Anuraj 

  • November 03, 2011
  • Like
  • 0

Hi

Please tell me how to arrange radio button in Horizontal view.

And want to add action on it. I want to display some checkbox, radiobutton, textinput on the selection of the radiobutton

please help me.

Thanks

Anuraj

  • October 24, 2011
  • Like
  • 0

Hi

  Please tell me how to create a action on a radio button.

  for ex: I want to display some inputtext, radiobutton, checkbox on selection  rediobutton

please help me

thanks

Anuraj

  • October 24, 2011
  • Like
  • 0

Hi

 I have done a code which contain Date, Appointment type, Clint, Status. And it contain 4 text box. I want to search the Date, Appointment type, Clint, Status. I am able to search Appointment type, Clint, Status. But when I add search for Date all other are not able to work. 

Please help me.

 

This is my code

<apex:page controller="apposearchController" sidebar="false">
  <apex:form > 
     <apex:pageMessages id="errors" />
      <apex:pageBlock title="Appoinment!" mode="edit">
        <table>
            <tr>
                <td width="200" valign="top">
                <apex:pageBlock title="Parameters" mode="edit" id="criteria">
                    <script type="text/javascript">
                              function doSearch() {
                                searchServer(
                                document.getElementById("AppoinmentType").value,
                                document.getElementById("Clint").value,
                                document.getElementById("StartDate").value,
                                document.getElementById("Status").options[document.getElementById("Status").selectedIndex].value
                                );
                              }
                        </script>
                        
                        <script type="text/javascript" src="clear-default-text.js"></script>
                        
                        <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
                         <apex:param name="AppoinmentType" value="" />
                         <apex:param name="Clint" value="" />
                         <apex:param name="StartDate" value="" />
                         <apex:param name="Status" value="" />
                        </apex:actionFunction>
                         
                         <table cellpadding="2" cellspacing="2">
                             <tr>
                            <td style="font-weight:bold;">Appoinment Type<br/>
                            <input type="text" id="AppoinmentType" onchange="doSearch();" class="cleardefault"/>
                            </td>
                          </tr>
                          <tr>
                            <td style="font-weight:bold;">Clint<br/>
                            <input type="text" id="Clint" onchange="doSearch();" class="cleardefault"/>
                            
                            </td>
                          </tr>
                          <tr>
                            <td style="font-weight:bold;">Start Date<br/>
                           <!-- <html>
                                <head> -->
                                  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
                                  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
                                  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
                                  
                                  <script>
                                      $(document).ready(function() {
                                        $("#datepicker").datepicker();
                                      });
                                  </script>
                                      <!--  </head>
                                        <body style="font-size:80.5%;"> -->
                                          <!-- <div id="datepicker"></div>
                                           <div id="datepicker"><input type="text" id="datepicker" onchange="doSearch();" class="cleardefault"/></div> -->
                                  <div ><input type="text" id="datepicker" onchange="doSearch();" class="cleardefault"/></div>
                                       <!-- </body>
                                    </html>-->
                                  <!--  <input type="text" id="StartDate" onchange="doSearch();" class="cleardefault"/>
                                    <apex:inputField value="{!appoit.Start_Date__c}"  onchange="doSearch();"/>-->
                            </td>
                          </tr>
                          <tr>
                            <td style="font-weight:bold;">Status<br/>
                              <select id="Status" onchange="doSearch();">
                                <option value=""></option>
                                <apex:repeat value="{!Status}" var="tech">
                                  <option value="{!tech}">{!tech}</option>
                                </apex:repeat>
                              </select>
                            </td>
                          </tr>
                        </table>
                </apex:pageBlock>
                </td>
                <td valign="top">
                    <apex:pageBlock mode="edit" id="results">
                         <apex:pageBlockTable value="{!Appoinment}" var="Appointment">
                             <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="AppoinmentType" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Appointment_Type__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Appointment.Appointment_Type__c}"/>
            </apex:column>
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Clint" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Client__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Appointment.Client__c}"/>
            </apex:column>
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="StartDate" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Start_Date__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Appointment.Start_Date__c}"/>
            </apex:column>
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Status" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Status__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Appointment.Status__c}"/>
            </apex:column>
                         </apex:pageBlockTable>
                    </apex:pageBlock>
                </td>
            </tr>
        </table>      
    
           <apex:pageBlock title="Debug - SOQL" id="debug">
              <apex:outputText value="{!debugSoql}" />           
          </apex:pageBlock>
          

          
          </apex:pageBlock>
    
  </apex:form>
</apex:page>
public class apposearchController{
   // public String appoit { get; set; }    public List<Appointment1__c> Appoinment{get;set;}    private String soql {get;set;}    public String technologies { get; set; }       public String sortDir     {        get  { if (sortDir == null) {  sortDir = 'asc'; }                 return sortDir;      }                set;    }        public String sortField {    get  { if (sortField == null) {sortField = 'Appointment_Type__c'; }           return sortField;      }       set;    }        public String debugSoql {    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20'; }    set;      }          public apposearchController() {    //delete(soql);    soql = 'select Appointment_Type__c, Client__c, Start_Date__c, Status__c, Client_First_Name__c from Appointment1__c where Client_First_Name__c!= null';    System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Appoinment '+ Appoinment);    System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++'+ soql  );    runQuery();      }             public void toggleSort()     {        sortDir = sortDir.equals('asc') ? 'desc' : 'asc';                 runQuery();            }
  //  public List<Appointment1__c> appo {get;set;}
    public String getStatus() {        return null;    }

    public void runQuery() {         try     {     string a=soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20';     system.debug(a);      Appoinment = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20');      System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Appoinment '+ Appoinment);     }     catch (Exception e)     {      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));    }    }       public PageReference runSearch()     {         String AppoinmentType;     String Clint;     String  StartDate;     String Status;     String  datepicker;     Date myDate;      datetime newdate;            AppoinmentType = Apexpages.currentPage().getParameters().get('AppoinmentType');     System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++AppoinmentType '+ AppoinmentType);     Clint = Apexpages.currentPage().getParameters().get('Clint');     System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Clint '+ Clint);          StartDate = Apexpages.currentPage().getParameters().get(StartDate);     if (datepicker != null)     myDate = date.valueOf(datepicker);    // newdate = myDate.substring(0,10);    // trim(myDate);    // System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++StartDate '+ StartDate);   //  System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++newdate '+ newdate);    // System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++myDate  '+ myDate);         Status = Apexpages.currentPage().getParameters().get('Status');     soql = 'select Appointment_Type__c, Client__c, Start_Date__c, Status__c, Client_First_Name__c from Appointment1__c where Client_First_Name__c != null';       if (!AppoinmentType.equals(''))      soql += ' and Appointment_Type__c  LIKE \''+String.escapeSingleQuotes(AppoinmentType)+'%\'';      System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++AppoinmentType '+ AppoinmentType);    if (!Clint.equals(''))      soql += ' and Client_First_Name__c  LIKE \''+String.escapeSingleQuotes(Clint)+'%\'';      System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Clint '+ Clint);     if (StartDate != null)     soql += ' and  Start_Date__c = ' + myDate;          //if (StartDate != null)    // soql += ' and  Start_Date__c = ' + myDate ;   //  System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Appoinments.Start_Date__c '+ Appoinments.Start_Date__c);     //soql += ' and Start_Date__c = \'' + myDate + '\'';     // soql += ' and Start_Date__c = '+ myDate + '' ;     //integer year = myDate.year();    // integer month = myDate.month();    // integer day = DAY_ONLY(myDate);          //  soql += ' and Start_Date__c equals (\''+myDate+'\')';    //  soql += ' and Client_First_Name__c  LIKE \''+date.escapeSingleQuotes(myDate)+'%\'';      // System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++myDate '+ myDate);     if (!Status.equals(''))     soql += ' and Status__c LIKE \''+String.escapeSingleQuotes(Status)+'%\'';     System.debug('++++++++++++++++++++++++++++++++++++++++++++++++++++++++Status'+ Status);             runQuery();        return null;     }           public List<String> Status        {            get             {            if (Status == null)             {            Status = new List<String>();            Schema.DescribeFieldResult field = Appointment1__c.Status__c.getDescribe();                 for (Schema.PicklistEntry f : field.getPicklistValues())            Status.add(f.getLabel());          }          return Status;                  }        set;            }
}

 

thanks

Anuraj

  • October 13, 2011
  • Like
  • 0

Hi

Tell me how to get only date from a value or how to delete time from this format.

2011-09-20 00:00:00

 

thanks

Anuraj

  • October 12, 2011
  • Like
  • 0

Hi

While searching for date I am getting this error 

 

no viable alternative at character ' '

 

 

the code is 

if (StartDate != null)
      soql += ' and Start_Date__c equals ' +  myDate ;

 please help me 

thanks 

anuraj

  • October 11, 2011
  • Like
  • 0

Hi

In this code I have a text box where i have to enter the date and the code is for searching the date from the object.

 

The code is 

 

Date myDate = date.valueOf(StartDate);
if (!StartDate.equals(''))
 soql += ' and Start_Date__c LIKE (\''+myDate+'\')';


if the format is in year-month-date then the error
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));

and if any other format is used the the error is :

System.TypeException: Invalid date: 2011-16-9

 

thanks 

Anuraj

  • October 11, 2011
  • Like
  • 0

Hi 

I am trying to Pass parameter to Apex method from VF page. But i am not able to get the parameter value.

 

My code

<td ><apex:outputText value="{!slot.tstart1}"/></td> 
<td width="15%" hight="5%"><apex:commandButton value="Book Appointment" action="{!callAppointment}" id="buttonid">
<apex:param name="tstart" value="{!slot.tstart1}" />
</apex:commandButton> </td>

 

public PageReference callAppointment() 
    {
       
        PageReference redirect = new PageReference ('/apex/appointment');
       // redirect.getParameters().put('time', liTimeSlots);
       // string myParam = apexpages.currentpage().getparameters().get('tstart');
        system.debug('++++++++++++++++++++++++++++++ apexpages.currentpage() '+ apexpages.currentpage().getparameters().get('tstart1') );
        redirect.getRedirect();
        return redirect;
    }

 debug log 

04:42:39.064 (64864000)|SYSTEM_METHOD_EXIT|[682]|System.PageReference.getParameters()
04:42:39.064 (64887000)|SYSTEM_METHOD_ENTRY|[682]|MAP.get(ANY)
04:42:39.064 (64902000)|SYSTEM_METHOD_EXIT|[682]|MAP.get(ANY)
04:42:39.064 (64927000)|SYSTEM_METHOD_ENTRY|[682]|System.debug(ANY)
04:42:39.064 (64936000)|USER_DEBUG|[682]|DEBUG|++++++++++++++++++++++++++++++ apexpages.currentpage() null
04:42:39.064 (64943000)|SYSTEM_METHOD_EXIT|[682]|System.debug(ANY)
04:42:39.064 (64956000)|SYSTEM_METHOD_ENTRY|[683]|System.PageReference.getRedirect()
04:42:39.065 (65014000)|SYSTEM_METHOD_EXIT|[683]|System.PageReference.getRedirect()
04:42:39.065 (65045000)|CODE_UNIT_FINISHED|AppointmentController invoke(callAppointment)
04:42:39.065 (65090000)|VF_APEX_CALL|buttonid|{!callAppointment}|PageReference:/apex/appointment

 Please help me to find the solution for this 

 

Thanks

Anuraj

 


  • February 15, 2012
  • Like
  • 0

I have three fields  on the object "Building"

 

1)Building Name                                       Api Name          "Name"

2)Location                                                   Api Name          "Location__c"       It is a lookup field to the obj "Location"

3)Date                                                          Api Name          "Date__c"

 

 

When a user enters the building name ,location ,date and saves the record the Building Name should be autoupdated to

 

Building Name.Location.Date

 

 

date should be of the format "yyyy-mm-dd"

 

 

Can anybody shred light on to this and help me

 

 

 

 

Hi,

 

I am new to Visual Force development and creating my first visual force page. All that I want to do is show records from a custom object on a VF page. I don't see any employee names.

 

Below is my code.

<apex:page standardController="Employee__c" >    

   <apex:pageBlock title="Employee details">      

       Employee email -  {!Employee__c.Emp_Email__c}       

   </apex:pageBlock>   

   <apex:detail />  

</apex:page>

 

Any help is much appreciated.

Thanks.

Hi

I am trying to load xml into the salesforce but not getting value into the salesforce

 

my Vf page 

<apex:page controller="testxmlCont">
  <apex:form >
    <apex:commandButton value="{!runxml}" title="click"/>
  </apex:form>
</apex:page>

 Controller 

public class testxmlCont {

    public String getRunxml() 
    {
        String fakeSoapResponse = '';
            
                fakeSoapResponse = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">' +
                '<soap:Header>' +
                '<wsa:Action>http://www.right90.com/r90/v1/api/UpdateGenericForecastResponse</wsa:Action>' +
                '<wsa:MessageID>urn:uuid:2cee4a82-6492-4453-a42b-2c353ed0f630</wsa:MessageID>' +
                '<wsa:RelatesTo>urn:uuid:524e9e22-e97a-4e6f-9ed6-33049c22ebab</wsa:RelatesTo>' +
                '<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>' +
                '</soap:Header>' +
                '<soap:Body xmlns="http://www.right90.com/r90/v1/api">' +
                '<UpdateGenericForecastResponse xmlns="http://www.right90.com/r90/v1/api">' +
                '<UpdateGenericForecastResult xmlns="http://www.right90.com/r90/v1/api">' +
                '<ForecastResponse>' +
                '<StatusCode>Success</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message></Message>' +
                '<Element ExternalSystemId="00kS00000046XUIIA2" R90ElementId="107091"/>' +
                '<JudgmentResponses>' +
                '<JudgmentResponse>' +
                '<StatusCode>Success</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message>Successfully processed.</Message>' +
                '<Judgment MeasureName="FACTOR" Value="8" ForecastDate="2010-07-15T00:00:00" ModifiedByUserName="r90admin"/>' +
                '</JudgmentResponse>' +
                '</JudgmentResponses>' +
                '<JudgmentResponse>' +
                '<StatusCode>Error</StatusCode>' +
                '<ErrorCode>0</ErrorCode>' +
                '<Message>Time period specified is out of time horizon range.</Message>' +
                '<Judgment MeasureName="FACTOR" Value="0.58" ForecastDate="2013-05-15T00:00:00" ModifiedByUserName="r90admin" />' +
                '</JudgmentResponse>' +
                '</ForecastResponse>' +
                '</UpdateGenericForecastResult>' +
                '</UpdateGenericForecastResponse>' +
                '</soap:Body>' +
                '</soap:Envelope>' ;
            
            Dom.Document fakeDoc = new Dom.Document();
            fakeDoc.load(fakeSoapResponse);
           // envelope = fakeDoc.getRootElement();
            system.debug('++++++++++++++++++++++ '+fakeDoc);
            system.debug('+++++++++++++++++++++++++++++++Enve');
           // system.debug(envelope);

        return null;
    }

}

 I am getting this in the debug log.

23:13:27.075 (75334000)|SYSTEM_METHOD_ENTRY|[45]|System.debug(ANY)
23:13:27.075 (75355000)|USER_DEBUG|[45]|DEBUG|++++++++++++++++++++++ Document[]
23:13:27.075 (75379000)|SYSTEM_METHOD_EXIT|[45]|System.debug(ANY)
23:13:27.075 (75415000)|SYSTEM_METHOD_ENTRY|[46]|System.debug(ANY)
23:13:27.075 (75481000)|USER_DEBUG|[46]|DEBUG|+++++++++++++++++++++++++++++++Enve
23:13:27.075 (75510000)|SYSTEM_METHOD_EXIT|[46]|System.debug(ANY)
23:13:27.075 (75535000)|CODE_UNIT_FINISHED|testxmlCont invoke(getrunxml)

 Can you please help me to solve my problem.

 

Thanks

Anuraj

 

  • February 06, 2012
  • Like
  • 0

i am writing a test class on this trigger 

rigger FillAccountandProduct on BBB_Transactions__c (before insert)
{
Set<String> productNames = new Set<String>();
Set<String> AccntNames = new Set<String>();

Map<String,integer> producttoSAPId=new Map<String,integer>();
Map<String,integer> accnttoSAPId=new Map<String,integer>(); 
  for (BBB_Transactions__c Btr : Trigger.new) 
    {    
      productNames.add(Btr.Product__c);
      AccntNames.add(Btr.Forecasted_Customer__c);
      
    }
   for(Product2 Pr:[Select p.Name,p.SAP_ID__c from Product2 p where p.Name in :productNames])
  {       
      producttoSAPId.put(Pr.Name,integer.valueOf(Pr.SAP_ID__c));
      
      
  }    
    for(Account a:[Select p.R90_Account_Name__c,p.SAP_ID__c from Account p where p.R90_Account_Name__c in :AccntNames])
  {       
      accnttoSAPId.put(a.R90_Account_Name__c,integer.valueOf(a.SAP_ID__c));      
  } 
    for (BBB_Transactions__c Btr : Trigger.new) 
    {
      Btr.SAP_Account_ID__c=accnttoSAPId.get(Btr.Forecasted_Customer__c);
      Btr.SAP_Product_ID__c=producttoSAPId.get(Btr.Product__c);
    }
    
}

 I wrote it like this

@isTest
public class TestFillAccountandProduct 
{
  static testmethod void testAccountandProduct()
  {
     String strRecordTypeIdItem = [Select Id, Name From RecordType Where SobjectType = 'Account' and Name = 'SAP Customer'].id;
     BBB_Transactions__c bbt = new BBB_Transactions__c();
     bbt.Product__c = 'bbproduct';
     bbt.Forecasted_Customer__c = 'bbforcast';
     bbt.Name = 'bbName';
     insert bbt;
     
     Product2 p = new Product2();
     p.Name = bbt.id;
     p.SAP_ID__c = 'pSapId';
     insert p;
     
     list< product2> pr2 = new list< product2>();
     pr2 = [select SAP_ID__c, name from product2 where name = :bbt.Product__c]; 
     
     Account a = new Account();
    // a.R90_Account_Name__c = bbt.id;
     a.Name = 'aName';
     a.Has_customer_been_contacted_or_visite__c  = 'ahasC';
     a.SAP_ID__c = 'aSname';
     a.RecordTypeId = strRecordTypeIdItem; 
     a.Location_Type__c = 'aLocation';
     insert a;
     
     list<Account> ac = new list<Account>();
     ac = [Select SAP_ID__c, R90_Account_Name__c from account where  R90_Account_Name__c = :bbt.Forecasted_Customer__c];
     
     list<BBB_Transactions__c> bt = new list<BBB_Transactions__c>();
     bt = [Select Product__c, Forecasted_Customer__c, SAP_Account_ID__c , SAP_Product_ID__c   from BBB_Transactions__c where id= :bbt.id];
     
    // bt[0].SAP_Product_ID__c  = bt[0].Forecasted_Customer__c;
    // bt[0].SAP_Account_ID__c  = bt[0].Product__c;
    // update bt;
     //system.assertEquals(bt[0].SAP_Account_ID__c, bt[0].Forecasted_Customer__c);
     //system.assertequals(bbt.SAP_Product_ID__c, bbt.Product__c);
   }
}

 but it have some error and need some changes which i am not able to make 

please help me 

 

Thanks

Anuraj

  • January 04, 2012
  • Like
  • 0

Hi

Please help me i want to get the number value in the bracket () 

456test(tata)(123)

i want 123 from the example 

the number in the bracket changes record by record so i want the number from the bracket 

thanks 

Anuraj

 

 

  • January 04, 2012
  • Like
  • 0

Hi 

please tell me how to copy a value on clicking a button. and after that i want to past the value into a notepad using keybord (ctrl+ v)

 

thanks 

Anuraj

  • December 27, 2011
  • Like
  • 0

Hi 

I am trying to display the account name , Mailing_Street__c from account object in VF page but i am not able to display it. The code is here 

<apex:page standardController="account">
<apex:form >
<apex:pageBlock >

{!account.name}
<apex:pageBlockSection title="Account Details" columns="1"> 
<apex:outputField value="{!account.name}" label="Account" />
<apex:outputField value="{!account.Mailing_Street__c}"/>
</apex:pageBlockSection>

<!--<table border ="1">
  <tr>
    <td>{!account.name}</td>
  </tr>
</table>-->
</apex:pageBlock>
</apex:form>
</apex:page>

  When i used this code i am only able to display the field name only. please help me to solve this problem.

thanks

Anuraj

  • December 27, 2011
  • Like
  • 0

 Hi
I am new to jasper only 2 days before i started. I download jasperReports and iReports. And installed iReports and installed jasper4salesforce in my salesforce account but not find any setup with jasperReports. How to use it I am totally confused i am not getting any idea to use it can you please help me to find the solution. I am trying to connect jasper to salesforce. 

Thanks   
Anuraj

  • December 02, 2011
  • Like
  • 0

Please tell me is it possible to connect jaspersoft iReport with salesforce. If yes then please tell me the ways to connect the salesforce with jaspersoft iReport.

Thanks

Anuraj

  • November 30, 2011
  • Like
  • 0

Hi

   I have a trigger in Event and 1 in Appointment. If any update of delet in any of the object Event or Appointment the trigger will fire and will update or delet. eg : if any record is updated in the Event it also effect the Appointment. same happen with the Appointment. but i cant able to stop it please help me. If it is updated of deleted once then the trigger should not be fireed.

Thanks

Anuraj 

  • November 03, 2011
  • Like
  • 0

Hi

Please tell me how to arrange radio button in Horizontal view.

And want to add action on it. I want to display some checkbox, radiobutton, textinput on the selection of the radiobutton

please help me.

Thanks

Anuraj

  • October 24, 2011
  • Like
  • 0

Hi

Tell me how to get only date from a value or how to delete time from this format.

2011-09-20 00:00:00

 

thanks

Anuraj

  • October 12, 2011
  • Like
  • 0