• Gheorghe Sima 25
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hi,
I want to make a query with some parameters, but i don't know how to use a date field in it.
This is my code:
myQuery = 'select Name, Start_Date__c, Contact__c, Country__c, Data_Check_In__c, Data_Check_Out__c,Id from Visit__c'; 

if(myVisit.Start_Date__c != null || myVisit.Country__c != null)
     myQuery += ' where ';

     if (myVisit.Start_Date__c != null)
     {
         myQuery += ' Start_Date__c = ' + String.ValueOf(myVisit.Start_Date__c.day()) + '/' + String.ValueOf(myVisit.Start_Date__c.month()) + '/' + String.ValueOf(myVisit.Start_Date__c.year());
         if(myVisit.Country__c != null) myQuery+=' and ';
     }
if(myVisit.Country__c != null)
{
       myQuery += ' Country__c = \'' + myVisit.Country__c + '\'';
}
myQuery += ' LIMIT 20';

I recive the error : unexpected token: '/'. I also use the following sintax: myQuery += ' Start_Date__c = ' + myVisit.Start_Date__c, but it doesn't work.
Can anyone help me?
 
Hi,
I have 2 multiselect picklist component in a visualforce page and when the user modifies the first multiselect picklist I want to change the value from the second multiselect picklist. I want to make a dependency between those 2 picklist multiselect, but my code doesn't work...

Here is my code:
<apex:page standardStylesheets="true" controller="NewAccountAPVController2"  tabStyle="Account">
  <apex:param id="accountID" name="accountID" value=""/>
  <apex:pageMessages />
  <apex:form >
      <script type="text/javascript">  
          function navigate(){ 
              searchServer();  
          }
      </script>
      <apex:actionFunction name="searchServer" action="{!RefreshMultiSelect}" rerender="results"> </apex:actionFunction>
      <apex:pageBlock title="New Account">
          <apex:pageBlockButtons >
              <apex:commandButton action="{!cancel}" value="Cancel" styleClass="btn"/>
              <apex:commandButton action="{!savePage21}" value="Save" styleClass="btn"/>
          </apex:pageBlockButtons>
          <apex:pageBlockSection title="Subcategorie" columns="1">
              <c:MultiselectPicklist leftLabel="Subcategorii" 
                leftOptions="{!subcategory}"
                rightLabel="Subcategorii selectate"
                rightOptions="{!selectedSubcategory}"
                size="15"
                width="300px" onchange="navigate();"
              />
           </apex:pageBlockSection>
         <apex:pageBlockSection title="Subsubcategorie">
            <c:MultiselectPicklist leftLabel="Subsubcategorii" 
                 leftOptions="{!subsubcategory}"
                 rightLabel="Subsubcategorii selectate"
                 rightOptions="{!selectedSubSubCategory}"
                 size="15"
                 width="300px"
                 id="results"
            />  
        </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

Can anyone help me? 
Hi,
I have 2 multiselect picklist component in a visualforce page and when the user modifies the first multiselect picklist I want to change the value from the second multiselect picklist. I want to make a dependency between those 2 picklist multiselect, but my code doesn't work...

Here is my code:
<apex:page standardStylesheets="true" controller="NewAccountAPVController2"  tabStyle="Account">
  <apex:param id="accountID" name="accountID" value=""/>
  <apex:pageMessages />
  <apex:form >
      <script type="text/javascript">  
          function navigate(){ 
              searchServer();  
          }
      </script>
      <apex:actionFunction name="searchServer" action="{!RefreshMultiSelect}" rerender="results"> </apex:actionFunction>
      <apex:pageBlock title="New Account">
          <apex:pageBlockButtons >
              <apex:commandButton action="{!cancel}" value="Cancel" styleClass="btn"/>
              <apex:commandButton action="{!savePage21}" value="Save" styleClass="btn"/>
          </apex:pageBlockButtons>
          <apex:pageBlockSection title="Subcategorie" columns="1">
              <c:MultiselectPicklist leftLabel="Subcategorii" 
                leftOptions="{!subcategory}"
                rightLabel="Subcategorii selectate"
                rightOptions="{!selectedSubcategory}"
                size="15"
                width="300px" onchange="navigate();"
              />
           </apex:pageBlockSection>
         <apex:pageBlockSection title="Subsubcategorie">
            <c:MultiselectPicklist leftLabel="Subsubcategorii" 
                 leftOptions="{!subsubcategory}"
                 rightLabel="Subsubcategorii selectate"
                 rightOptions="{!selectedSubSubCategory}"
                 size="15"
                 width="300px"
                 id="results"
            />  
        </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

Can anyone help me?