• ptepper
  • NEWBIE
  • 235 Points
  • Member since 2008

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 85
    Replies

Hi All,

 

Salesforce API newbie here.

 

Using Perl I can do basics on Accounts, Cases, Opportnuities, but when I try to access custom objects I run into trouble. For example trying to look up a custom object returns an error like:

 

INVALID_TYPE:
select id from Bugzilla__c where BZ_Number__c like '1234'
^
ERROR at Row:1:Column:16
sObject type 'Bugzilla__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. at update-keywords-for-bug.pl line 185

 

I assume I need to reference my enterprise WSDL instead of the default (in my script I reference https://test.salesforce.com/services/Soap/u/23.0)

 

How do I do this in Perl? I have searched the forums here and find threads that touch on the topic but can't find any answers,

 

Help appreciated!

 

Thanks - James

I am running into a problem with the PHP SDK and aggregate functions.  We are trying to do a very simple calculation that counts the number of records by each MailingState.  Our query is as follows:

 

$query = "SELECT MailingState, count(Contact.Id) from Contact WHERE MailingState != '' GROUP BY MailingState";
$response = $mySforceConnection->query($query);

 

When I run the PHP code on my local MAMP stack the $response array returns back properly with MailingState and the expr0 count.  However when I run the same code on our remote webserver (Rackspace Cloud Sites), the $response array only shows the MailingState and does not return the aggregate calculation.  

 

Has anyone run into this problem before?  is there something that we should be looking for in the PHP config?

 

Thanks,

-Matt

I'm trying to log into a production edition and keep getting this error:

 

Login failed: INVALID_LOGIN: Invalid username, password, security token; or user locked out.

 

I know my username, password and security token are all working because I'm logging in with the IDE and I'm not locked out. The login attempts are not showing up in the Login History at all. 

 

Anyone know what the issue is?

 

I'm using v0.58A with Adobe Air v3.1.0.4880.

 

Using the SOQL commander I am able to query and retrieve values from fields within custom objects without issue. 

 

When I try to use the same exact query from PHP I get "Notice: Undefined property: SObject::$Date_Requested__c in /var/www/........"

 

..... where date_requested__c is one of the custom fields I'm trying to pull.

 

How come I cannot retrieve values from the API like I can using the SOQL commander SQL dashboard? 

 

 

Is querying custom fields from the API not allowed?

 

Thanks in advance,

Ryan

 

Hi,

 

I have some code that gets some JSON data from a web service callout, then parses it into a collection (map) or object. I'm wondering if there's a best practice or method people are using to then cache this data for some amount of time so that it's not being retrieved and parsed everytime it is needed.

 

I'm thinking I can create an custom object for this and store the data there, either in a structured format, or serialize it to a JSON string and then store the whole string. I'd store it with a timestamp so that I know when to refresh it.

 

Is there a better way to do this? And by better I mean recommended or faster?

 

thanks

Hi everyone

 

I need to push data from salesforce (on an event) to a website.... if anyone of you have done some work like this, juss let me know....

 

 

 

Thanx in advance

 

If we have a field that is a drop down in Salesforce is it possible to retrieve a list fo all of the available values through the API?

Using the PHP API code...

$theQuery = "Select s.TranscriptGrade__c, s.SystemModstamp, s.StudentID__c, 
            s.StudentCourseID__c, s.SignatureGrade__c, s.ReceiptNumber__c, s.Project_ID__c, 
            s.OwnerId, s.Name, s.Multi_Class_Project_id__c, s.LastModifiedDate, s.LastModifiedById, 
            s.IsDeleted, s.Id, s.GradeDate__c, s.EvalPosted__c, s.CreditStatus__c, s.CreatedDate, 
            s.CreatedById, s.ClientID__c From STUDENT_COURSE__c s Where s.ClientID__c='" . $theContactID . "'";
 
$result = $theSFConnection->query($theQuery); 

I am getting the error:

Unexpected exception of type [SoapFault] with message [INVALID_TYPE: 
s.CreatedById, s.ClientID__c From STUDENT_COURSE__C s Where s.ClientID__c=''
                                  ^
ERROR at Row:5:Column:47
sObject type 'STUDENT_COURSE__C' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names

Tried the same call using the Java Eclipse schema tool and the query succeeds so there seems to be an issue with the PHP API.  We are developing our application with the requirement of using PHP so we would like to figure out a work around to this issue.

Thanks,
-Laura 

I got a "List has no rows for assignment to SObject An unexpected error has occurred. Your development organization has been notified." error message. I know what this error message generally means, but I don't know what the offending line(s) are. It's happening in my production environment, but not in my Sandbox, and I think it has something to do with some fields being populated in the Sandbox, but they're not in the Production so a query is failing somewhere.

 

Is there a way to determine what lines of what class are causing the problem (line numbers)?

 

thanks

I have a search page for my custom object and in the result display the Member field (linked to Contact) is automatically clickable. I don't want this to be the case. Can I disable this?

 

The code for the section is:

 

<apex:column >               

<apex:facet name="header">                   

<apex:commandLink value="Member" action="{!toggleSort}" rerender="results,debug">                       

<apex:param name="sortField" value="member" assignTo="{!sortField}"/>                   

</apex:commandLink>               

</apex:facet>               

<apex:outputField value="{!counselling_practice.Member__c}"/>           

</apex:column>

 

Thanks in advance

 

Justyn

I know my question is going to be pretty simple for you veterans but can someone explain to me how relationships work in SOQL. I have looked at the documentation and the discussion boards but can not seem to understand it.

 

I want to get the following fields from the following tables:

 

Contact.FirstName,

Contact.LastName,

Account.Name,

Opportunity.Name

 

I have tried the following but it does not seem to work:

 

SELECT Contact__c.FirstName, Contact__c.LastName, Contact__c.Account__r.Name, Contact__c.Account__r.Opportunity__c.Name From Contact

 

The more I read the more confused I get.

 

I need to understand the basic concept. If someone could help I would appreciate it.

 

Robert

I have a simple custom exception class.  Since it's referenced from more than one class, I did not make it an inner class.  It is in a class all by itself that reads as below--

 

public class OppSyncException extends Exception {
	
}

 

I have Apex tests that instantiate this exception.  But when I look at the code coverate for that module it says 0%.  Now it has 0 executable lines so technically coverage is undfined (0/0). 

 

What I want to know is will I have a problem trying to deploy this module where it will complain that the coverage is < 75%?

 

 

 

<b>12. Purchase Order #: </b><apex:outputfield value="{!Contract.Purchase_Order_Number__c}"/>

 How would I make this line show up only if something is typed in the purchase order field?

 

And then if null it would skip that line completely and go to the next part of the page.

 

Thanks!

When working in the Force.com IDE, the contents of my Outline view keep disappearing, with nothing inside the window. It's a pretty important feature of an IDE, so it's pretty annoying.

 

I've been trying to use Bookmarks as a workaround, but regularly after a I save, my booksmarks all get cleared!

 

So there's a clearly bugs with both the Outline and Bookmarks in eclipse, at least with the Force.com IDE.

 

Has anyone else had this problem?  Anyone know how to solve it? 

 

It's a pain to navigate code using line numbers and 'Find' alone.

 

thanks

 

 

 

Hi,

 

How do I create a Closed task using Apex?

 

I have the following code, but it creates an Open task.

I've also tried to replace Task with ActivityHistory, but it seems to have had the effect of making all fields read only.

 

Task act = new Task();
act.Subject = 'SMS: '+message;
act.Description = message+'\n'+'Sent to: '+toPhone+'\n'+'Sent From: '+FromPhone;
act.whoId = recipient_id;
act.ownerId = user_id;
act.Status = 'Closed';
act.whatId = what_id;

act.IsClosed = true; //this line doesn't compile.

Database.SaveResult sr = Database.insert (act);

 

 

Thank you.


 

Non essential Background:

For an SMS system I'm trying to create a "Log an SMS" button. (It actually sends the text, but that's besides the point).

 

I'm trying to have something along the lines of "Log a Call" button in the  "Activity History" section of a contact's detail page.