• Kitpith
  • NEWBIE
  • 5 Points
  • Member since 2013

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

Hello,

Could anybody tell me in one field in object, Date is stored. So i need to get record showing Month for that date . Is there any method like oracle i.e. to_char(StoredDate,MM) 

 

Or any method like Month(StoredDate).

 

 

 

Hello,

Could anybody help. 

I have one field where I am populating the Value from User Table and saving inside one lookup field. 

In the controller when saving this value in Lookup Field its giving the error as :

"Error System.StringException: Invalid id:"

 

Regards

Kit

Hello I am trying to rerender the input inside a panel but its not refreshing the input text but also creating a new input text field.

 

Below is the Controller code which is fetching value and after checking the logs i found the name is properly coming but when displaying it into the input text field its not showing.

 

Controller code :

=========================================================================================

public class toolExtension {         

  public  RecordedTools__c Recordtools; //User sobject   

  public String selectedTool {get;set;}

    public String lname{get;set;}

    public String lookupvalue{get;set;}

    //initializes the private member variable u by using the getRecord method from the standard controller   

// public toolExtension(ApexPages.StandardController stdController) {                   // }   

   public toolExtension(ApexPages.StandardController stdController) {     }   

      public PageReference retrieveVal()     {

        String ipString = changepicklistvalue();         return null;     }   

 

  public string changepicklistvalue()

{

 //system.debug(apexpages.currentpage().getparameters().get('selectedTool'));   

  System.debug('lookup val**'+selectedTool);   

  ToolResponsible__c toolres = [SELECT p.User__c FROM ToolResponsible__c p where p.DTools__c =:selectedTool];     User user=[SELECT p.Name FROM User p where p.id =:toolres.User__c];   

  //System.debug('Val***'+toolres.User__c);    

System.debug('Name***'+user.Name);

  String lname = user.Name;    

//System.debug "Values"+name;   

// System.debug('Name'+name);

     System.debug('Name'+lname);   

  return lname;

}

 

}

 

 

===================================================================================

VF Page :

===================================================================================

<apex:page standardController="User" extensions="toolExtension">     

     <apex:outputText id="NbLoginTool" value="21" rendered="true"/>   

  <apex:messages id="messages" />  

   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

      <script type="text/javascript" >       

    function callonlookup(val) {

    alert('check'+val.value);

           callpicklistmethod(val.value);     }

 

         function loadLoginTool(idGet, idBut, fldTool, nbMax) {    

        $('[id $="lTool22"]').css('display','block');        

   // 'input[id $="fl_Tools_Tool_21"]').val()=$('input[id $="fl_Tools_Tool_21"]').val()+1      

     // 'input[id $="NbLoginTool"]').val()=$('input[id $="NbLoginTool"]').val()+1     

      }     </script>

 

   <apex:form id="FrmTools">   

      <apex:pageBlock >  

      <apex:pageBlockSection id="UserInfo" title="UserInformation">  

     <div id='LoginTool' >

        <TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="2">           

    <tr id='lTool21' >  

               <TD VALIGN="Top" COLSPAN="2" ><br></br>   

                  <apex:selectList id="tools1" value="{!selectedTool}" size="1" title="tools" onchange="callonlookup(this)">                   <apex:selectOptions value="{!tools}" ></apex:selectOptions>  

              <apex:actionFunction name="callpicklistmethod" reRender="lpanel1,messages" action="{!retrieveVal}">  <apex:param name="selectedTool" value="{!selectedTool}" assignTo="{!selectedTool}"/> </apex:actionFunction></apex:selectList>

</TD>     

  <apex:outputPanel id="lpanel1" >

      <TD VALIGN="Top" COLSPAN="2" ><br></br>

       <apex:inputText id="fl_Tools_Tool_21" label="hello" value="{!lname}"/>

            </td>     

      </apex:outputPanel>       

       <td><br></br><span id='lToolBut'>

<a class="bouton" style = "cursor:hand" onclick="loadLoginTool('lTool', 'lToolBut', 'NbLoginTool', '30');">Add a Tool</a></span></td> </TR>  

   </TABLE>  

   </div>

</apex:pageBlockSection>

</apex:pageBlock>

    </apex:form>   

</apex:page>

 

===================================================================================

 

==========================================================================================

Hello,

Could anybody tell me in one field in object, Date is stored. So i need to get record showing Month for that date . Is there any method like oracle i.e. to_char(StoredDate,MM) 

 

Or any method like Month(StoredDate).

 

 

 

Hello,

Could anybody help. 

I have one field where I am populating the Value from User Table and saving inside one lookup field. 

In the controller when saving this value in Lookup Field its giving the error as :

"Error System.StringException: Invalid id:"

 

Regards

Kit

Hello I am trying to rerender the input inside a panel but its not refreshing the input text but also creating a new input text field.

 

Below is the Controller code which is fetching value and after checking the logs i found the name is properly coming but when displaying it into the input text field its not showing.

 

Controller code :

=========================================================================================

public class toolExtension {         

  public  RecordedTools__c Recordtools; //User sobject   

  public String selectedTool {get;set;}

    public String lname{get;set;}

    public String lookupvalue{get;set;}

    //initializes the private member variable u by using the getRecord method from the standard controller   

// public toolExtension(ApexPages.StandardController stdController) {                   // }   

   public toolExtension(ApexPages.StandardController stdController) {     }   

      public PageReference retrieveVal()     {

        String ipString = changepicklistvalue();         return null;     }   

 

  public string changepicklistvalue()

{

 //system.debug(apexpages.currentpage().getparameters().get('selectedTool'));   

  System.debug('lookup val**'+selectedTool);   

  ToolResponsible__c toolres = [SELECT p.User__c FROM ToolResponsible__c p where p.DTools__c =:selectedTool];     User user=[SELECT p.Name FROM User p where p.id =:toolres.User__c];   

  //System.debug('Val***'+toolres.User__c);    

System.debug('Name***'+user.Name);

  String lname = user.Name;    

//System.debug "Values"+name;   

// System.debug('Name'+name);

     System.debug('Name'+lname);   

  return lname;

}

 

}

 

 

===================================================================================

VF Page :

===================================================================================

<apex:page standardController="User" extensions="toolExtension">     

     <apex:outputText id="NbLoginTool" value="21" rendered="true"/>   

  <apex:messages id="messages" />  

   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

      <script type="text/javascript" >       

    function callonlookup(val) {

    alert('check'+val.value);

           callpicklistmethod(val.value);     }

 

         function loadLoginTool(idGet, idBut, fldTool, nbMax) {    

        $('[id $="lTool22"]').css('display','block');        

   // 'input[id $="fl_Tools_Tool_21"]').val()=$('input[id $="fl_Tools_Tool_21"]').val()+1      

     // 'input[id $="NbLoginTool"]').val()=$('input[id $="NbLoginTool"]').val()+1     

      }     </script>

 

   <apex:form id="FrmTools">   

      <apex:pageBlock >  

      <apex:pageBlockSection id="UserInfo" title="UserInformation">  

     <div id='LoginTool' >

        <TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="2">           

    <tr id='lTool21' >  

               <TD VALIGN="Top" COLSPAN="2" ><br></br>   

                  <apex:selectList id="tools1" value="{!selectedTool}" size="1" title="tools" onchange="callonlookup(this)">                   <apex:selectOptions value="{!tools}" ></apex:selectOptions>  

              <apex:actionFunction name="callpicklistmethod" reRender="lpanel1,messages" action="{!retrieveVal}">  <apex:param name="selectedTool" value="{!selectedTool}" assignTo="{!selectedTool}"/> </apex:actionFunction></apex:selectList>

</TD>     

  <apex:outputPanel id="lpanel1" >

      <TD VALIGN="Top" COLSPAN="2" ><br></br>

       <apex:inputText id="fl_Tools_Tool_21" label="hello" value="{!lname}"/>

            </td>     

      </apex:outputPanel>       

       <td><br></br><span id='lToolBut'>

<a class="bouton" style = "cursor:hand" onclick="loadLoginTool('lTool', 'lToolBut', 'NbLoginTool', '30');">Add a Tool</a></span></td> </TR>  

   </TABLE>  

   </div>

</apex:pageBlockSection>

</apex:pageBlock>

    </apex:form>   

</apex:page>

 

===================================================================================

 

==========================================================================================