• Arek S.
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I have an application that accesses a few SalesForce objects via the REST API, however, I don't seem to be able to retrieve or set any fields that are lookup fields.  For example, I have a Form__c object that has a Campaign lookup field as well as a Record Type field.  If I run the following query via REST:

 

SELECT Id, Campaign__c FROM Form__c

 

I receive an error stating that there is no column called Campaign__c.

 

Likewise if I try creating a new Form__c object and I set the RecordTypeId field to a specific record type ID, that value is never actually saved in SalesForce.

 

Is this a limitation of the REST API?  Is it unable to work with lookup fields?  Or am I doing something wrong?

Any help is highly appreciated.

I'm sending a query to SalesForce (using the SOAP API) that includes an IN clause, however, I keep getting a MALFORMED_QUERY error.  Could someone point me in the right direction of what the query syntax is when using the IN clause?  I've tried the following without success (the ids are made up in these examples):

 

SELECT Id FROM Lead WHERE Id IN {'000000000000000','111111111111111'}

SELECT Id FROM Lead WHERE Id IN '0000000000000','111111111111111'

 

Thanks.

I'm running a query on LeadHistory that looks like this:

 

      leadHistories = new List<LeadHistory>(
                      [SELECT LeadId, CreatedDate, Field, NewValue
                       FROM LeadHistory
                       WHERE CreatedDate >= :mFromDate 
                       AND CreatedDate <= :mToDate 
                       AND LeadId IN (SELECT Id
                                      FROM Lead
                                      WHERE Primary_Campaign_Source__c = NULL)
                       ORDER BY CreatedDate DESC]);

 I need it to exclude objects that have the same value for LeadId and NewValue.  So for example take the following three objects:

 

LeadHistory - ID: 0000000001, LeadId: 1000000000, CreatedDate: Jan 1, 2012, Field: Status, NewValue: Closed

LeadHistory - ID: 0000000002, LeadId: 2000000000, CreatedDate: Jan 2, 2012, Field: Status, NewValue: Closed

LeadHistory - ID: 0000000003, LeadId: 2000000000, CreatedDate: Jan 3, 2012, Field: Status, NewValue: Unclosed

LeadHistory - ID: 0000000004, LeadId: 2000000000, CreatedDate: Jan 4, 2012, Field: Status, NewValue: Closed

 

I want my query to only return the first, second, and thrid objects, but not the fourth one since it has the same value for LeadId and NewValue as the second object.

 

Any help with this is appreciated,

Thanks.

 

I have two fields on a VisualForce page

 

<apex:inputText id="fromDate" title="From Date" value="!mInputFromDate}"/>
<apex:inputText id="toDate" title="To Date" value="!mInputToDate}"/>

and I have a outputLink that needs to take the values from those two input text fields and pass them as parameters (also knows as the query string) to the next page.  The problem is that the values being passed are empty when I use the following code

 

<apex:outputLink value="/apex/Report" styleClass="btn" style="color: gray; padding: 2px 3px 2px 3px; text-decoration: none;">
  <apex:param name="from" value="{!mInputFromDate}" />
<apex:param name="to" value="{!mInputToDate}" /> Generate Report </apex:outputLink>

I'm guessing one of two things are the problem.  Either I'm not doing things correctly, or the query string for the link is created at the time of rendering of the page and isn't being updated to reflect values entered in the the From and To fields, which means that I would probably have to use JavaScript to create the query string based on what's in those two fields at the time the link is clicked.  If that's the case does anyone happen to have any examples handy?

 

Thanks

We're going to be putting together a website that allows clients to schedule appointements and we'd like these appointments to go directly into our SalesForce calendar.  We are in the exploratory stage of this project and I'm looking for feedback on what would be the best approach for this.

 

I'm assuming that SOAP (and/or REST) allows inserting an Event object into SalesForce.  Does either API also allow running SOQL queries to find Event objects that fall within a specific time slot (ie: check if a certain timeslot is available or already booked)?

 

If anyone has any examples on how to do this that would be much appreciated, but a quick answer to my questions will do too.  Btw, I've done lots of APEX development just haven't touched SOAP or REST before.

 

Thanks.

We're going to be putting together a website that allows clients to schedule appointements and we'd like these appointments to go directly into our SalesForce calendar.  We are in the exploratory stage of this project and I'm looking for feedback on what would be the best approach for this.

 

I'm assuming that REST (and/or SOAP) allows inserting an Event object into SalesForce.  Does either API also allow running SOQL queries to find Event objects that fall within a specific time slot (ie: check if a certain timeslot is available or already booked)?

 

If anyone has any examples on how to do this that would be much appreciated, but a quick answer to my questions will do too.  Btw, I've done lots of APEX development just haven't touched REST or SOAP before.

 

Thanks.

I'd like to create a datatable where each cell is clickable.  I'm assuming that I can probably fill each cell with apex:outputlink and that takes care of the clickable part as well as calling my controller for each click.  The big question I need an answer for is how do I pass information to my apex controller about which cell (ie: which row and which column) was actually clicked.

 

Any help for this is highly appreciated.

 

Thanks.

I'm working with a VisualForce page (SalesForce related) and I need to write a piece of JavaScript that will replace some text on the page after everything is loaded.

I've tried the following (I'm using jQuery on other parts of the page so I've used jQuery for this also):

 

var j$ = jQuery.noConflict();
j$(document).ready(function()
{
  var replaced = $find("body").html().replace('Test','1234');
  $("body").html(replaced);
});

 

Unfortunately it doesn't seem to do anything. It's like I can't get the page HTML code. I'm assuming it's because this is a VisualForce page running on the Force platform, so if anyone can offer any help with this that would be much appreciated.

 

Thanks.

 

P.S. In case anyone is wondering why I'm doing this is because I can't do this through VisualForce or Apex since I'm trying to unescape some HTML characters provided by a variable and being used in a dataTable header. Unfortunately everything in a dataTable header is automatically escaped.

I'm wondering if it's possible to populate a dataTable from a 2d array.  For example would this work:

 

<apex:datatable value="{!DataList}" var="Data">
  <apex:column value="{!Data[0]}" headerValue="Data 1"/>
  <apex:column value="{!Data[1]}" headerValue="Data 2"/>
  <apex:column value="{!Data[2]}" headerValue="Data 3"/>
</apex:datatable>

 where DataList is defined as List<List<String>>.

 

If this isn't possible, is there another way I can convert a two dimensional array of strings into a table?

 

Thanks.

How do I go about passing the value from an InputText field to my apex controller?  I know I'm supposed to use apex:param, but I can't figure out what to specify for the value of the apex:param in order to reference my InputText field.  Any help is highly appreciated.

 

Thanks.

 

P.S.  Here's some sample code to illustrate what I'm trying to figure out ... what do I replace ????? with in order to reference the InputText field with the "date" ID?

 

<apex:page controller="test">
  <apex:form>
    <apex:inputText id="date"/>
    <apex:commandButton value="button" action="{!controlleraction}">
      <apex:param name="testdate" value="?????"/>
    </apex:commandButton>
  </apex:form>
</apex:page>

 

I'm creating a DataTable but I will be feeding it data from a created object in my controller but I will not be using the SELECT SQL command.  What kind of object do I have to create in my controller to work with the DataTable?  I'm assuming it's going to be a List, but a list of what?  A list of class objects with just variables?

 

Thanks.

 

P.S.  I'm quite new to Visualforce ... hence this question.

I have added the jQuery datepicker to one of my visualforce pages, however, after the datepicker appears, I can't interact with it in any way.  Can't change months, can select a date, nothing.  The only thing I can do is click somewhere else to make it go away.  Here's my page code:

 

<apex:page controller="MarketingReports">
  <apex:includeScript value="{!URLFOR($Resource.jQueryUI, 'js/jquery-1.7.2.min.js')}"/>
  <apex:includeScript value="{!URLFOR($Resource.jQueryUI, 'js/jquery-ui-1.8.22.custom.min.js')}"/>
  <apex:stylesheet value="{!URLFOR($Resource.jQueryUI, 'css/smoothness/jquery-ui-1.8.22.custom.css')}"/>

  <script type="text/javascript">
    var j$ = jQuery.noConflict();
    j$(document).ready(
      function()
      {
        j$('input[id$="fromDate"]').datepicker({ dateFormat: 'dd-mm-yyyy', changeMonth: true,
                                    changeYear: true });
        j$('input[id$="toDate"]').datepicker({ dateFormat: 'dd-mm-yyyy', changeMonth: true,
                                  changeYear: true });
      });
  </script>

  <apex:form >
    <apex:pageBlock title="Marketing Reports">
      <apex:pageMessages >
      </apex:pageMessages>
      <apex:pageBlockButtons >
        <apex:commandButton value="Generate Report" action="{!generateReport}">
        </apex:commandButton>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
        <apex:outputLabel value="From Date - Inclusive (dd-mm-yyyy)" for="fromDate">
        </apex:outputLabel>
        <apex:inputText id="fromDate">
        </apex:inputText>
        <apex:outputLabel value="To Date - Inclusive (dd-mm-yyyy)" for="toDate">
        </apex:outputLabel>
        <apex:inputText id="toDate">
        </apex:inputText>  
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 I quite new to visualforce pages and most of the above code is based on tutorials, etc. so any help anyone can offer would be much appreciated.

 

Thanks.

I'd like to create a datatable where each cell is clickable.  I'm assuming that I can probably fill each cell with apex:outputlink and that takes care of the clickable part as well as calling my controller for each click.  The big question I need an answer for is how do I pass information to my apex controller about which cell (ie: which row and which column) was actually clicked.

 

Any help for this is highly appreciated.

 

Thanks.

How do I go about passing the value from an InputText field to my apex controller?  I know I'm supposed to use apex:param, but I can't figure out what to specify for the value of the apex:param in order to reference my InputText field.  Any help is highly appreciated.

 

Thanks.

 

P.S.  Here's some sample code to illustrate what I'm trying to figure out ... what do I replace ????? with in order to reference the InputText field with the "date" ID?

 

<apex:page controller="test">
  <apex:form>
    <apex:inputText id="date"/>
    <apex:commandButton value="button" action="{!controlleraction}">
      <apex:param name="testdate" value="?????"/>
    </apex:commandButton>
  </apex:form>
</apex:page>

 

I'm creating a DataTable but I will be feeding it data from a created object in my controller but I will not be using the SELECT SQL command.  What kind of object do I have to create in my controller to work with the DataTable?  I'm assuming it's going to be a List, but a list of what?  A list of class objects with just variables?

 

Thanks.

 

P.S.  I'm quite new to Visualforce ... hence this question.