• aezell
  • NEWBIE
  • 5 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 26
    Replies
I have an application that uses the API to allow our users to import data from a Salesforce campaign into our system (mostly the campaign member data). We are an ESP (Email Service Provider) and would like to pull in the HasOptedOutOfEmail value for the campaign members which we import, or at the very least, not allow a user to import those campaign members who have an opted out status.

However, I have noticed in testing that this field is not always available to the user which is logged in via our system. It can be made accessible, but is not so by default.

Currently, our system does a select SOQL statement, like so (in Python):
qry = "SELECT Id, %s FROM CampaignMember WHERE CampaignId = '%s' AND IsDeleted = False %s" % (fields, str(campaign_id), query_limit)

where 'fields' is a string of the field names to select. I can include Contact.HasOptedOutOfEmail in this string but that breaks if the logged in user doesn't have access to that field. Right now, I am getting this list of fields programmatically via the API.

Can I include Contact.HasOptedOutOfEmail in the WHERE clause of the query if the user doesn't have access to the field? That way, I could simply not return those members who are opted out.

I guess, the larger question is, if I know my application absolutely must have access to a field via the API that may or may not be available to the logged in user, what's the best way to handle that programmatically and also inform the user?
  • April 22, 2008
  • Like
  • 0
If I create a web service connection with a user's login information and then request the fields on a particular object, say Contacts. Would that describe() call show me only the fields of that object to which the logged in user has access?

I want to be sure that when I show the user a list of fields available, they see only fields to which they have access.

Again, this all being done through the web service. This is not Apex Code running on SF.
  • February 25, 2008
  • Like
  • 0
I have some Python code that logs in to the API and now it returns this error:

LOGIN_MUST_USE_SECURITY_TOKEN

This also happens when I try to use SoqlExplorer on my Mac.

All of this code used to work. We did move offices since then and I'm sure IPs changed and that sort of thing. Would that cause this problem?

I also noticed that I had to go through some "activation" thing when logging in via the browser.

Has something changed in the login method?

Edit:
I just read this in the docs:
Salesforce checks the IP address from which the client application is logging in, and blocks logins from unknown IP addresses. For a blocked login via the API, Salesforce returns a login fault. Then, the user must add their security token to the end of their password in order to log in. A security token is an automatically-generated key from Salesforce. For example, if a user's password is mypassword, and their security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in. Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user's Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset. When the security token is invalid, the user must repeat the login process to log in. To avoid this, the administrator can make sure the client's IP address is added to the organization's list of trusted IP addresses. For more information, see Security Token.

That must be the answer.

Message Edited by aezell on 01-16-2008 11:39 AM
  • January 16, 2008
  • Like
  • 0
We are looking at doing some integration here and are anticipating an issue with API access. Here's the setup: Each of our clients is a Salesforce user, they provide our system with their credentials and we sync some data between our system and theirs.

Here's the potential issue: Even if we are batching these updates, we are still potentially logging in and out of the API for each client. So, if a batch of records is 100 updates, but it's 10 updates for 10 different clients, then we would be logging in and out of the API 10 times.

Is there anyway to avoid this? Can a Salesforce user grant our system access somehow, so that our system could make a single connection and update several Salesforce accounts?

Maybe this whole design is wrong. I am open to ideas. :)
  • October 01, 2007
  • Like
  • 0
First, is it possible to send an email from a trigger? If so, is there an example or documentation somewhere.

Further, is it possible, in general, to access the Apex Web Services API from within a trigger? Maybe I'm just getting my terminology all mixed up, but I'm losing a little of the separation between the Web Services API and the Apex methods to which my trigger has access.
  • September 28, 2007
  • Like
  • 0
The new callout functionality is really great. However, there seems to be a rather gaping hole.

Many web services return XML in their responses, yet, Apex seems to have no way to deal with this XML. There seems to be no variable type in which to store the XML and no methods for parsing that XML.

I must be missing something. My use case here is a callout to the Zipcode Info service at webservicex.net. It returns XML which contains information about that zipcode, including city and state.

I've generated the Apex class from the WSDL and it's compiled fine. What I can't seem to do is write any code that will compile because the return value from the class calling the service is always expected to be XML.

The WSDL location is here: http://www.webservicex.net/uszip.asmx?wsdl

I edited it to use only the SOAP ports and bindings. Would I be better off using one of the other bindings/ports?

Essentially, I'm just lost here finding out any details on consuming a third-party web service past the basic, and seemingly incomplete, examples in the Apex Language Reference.

Thanks for reading all that!
  • September 24, 2007
  • Like
  • 0
Is it possible to access Report objects via the API?

That is, I have saved several reports to the Unfiled Public Reports and I would like to be able to get them via the Apex API.
  • August 31, 2007
  • Like
  • 0
This is a bit of a structure question, as I am trying to wrap my head around all the various moving parts of the Salesforce platform.

Let's say I wanted to save the latitude and longitude of a lead's location when that lead is created or modified.

What I can't figure out is if I should write code in a trigger, a custom SObject, or some other place. Also, if I do it in a trigger, does that code have the capability to access an external web service, like the Google Maps API? I know that a SObject can, but my problem there is I'm not sure how to "activate" on SObject each time a Lead is created or modified.

Maybe this has something to do with creating a custom button or something. I'm just a little lost with all of the options here.

Can someone please point me in the right direction?



Message Edited by aezell on 08-29-2007 09:02 AM

  • August 29, 2007
  • Like
  • 0
I have an application that uses the API to allow our users to import data from a Salesforce campaign into our system (mostly the campaign member data). We are an ESP (Email Service Provider) and would like to pull in the HasOptedOutOfEmail value for the campaign members which we import, or at the very least, not allow a user to import those campaign members who have an opted out status.

However, I have noticed in testing that this field is not always available to the user which is logged in via our system. It can be made accessible, but is not so by default.

Currently, our system does a select SOQL statement, like so (in Python):
qry = "SELECT Id, %s FROM CampaignMember WHERE CampaignId = '%s' AND IsDeleted = False %s" % (fields, str(campaign_id), query_limit)

where 'fields' is a string of the field names to select. I can include Contact.HasOptedOutOfEmail in this string but that breaks if the logged in user doesn't have access to that field. Right now, I am getting this list of fields programmatically via the API.

Can I include Contact.HasOptedOutOfEmail in the WHERE clause of the query if the user doesn't have access to the field? That way, I could simply not return those members who are opted out.

I guess, the larger question is, if I know my application absolutely must have access to a field via the API that may or may not be available to the logged in user, what's the best way to handle that programmatically and also inform the user?
  • April 22, 2008
  • Like
  • 0
I have some Python code that logs in to the API and now it returns this error:

LOGIN_MUST_USE_SECURITY_TOKEN

This also happens when I try to use SoqlExplorer on my Mac.

All of this code used to work. We did move offices since then and I'm sure IPs changed and that sort of thing. Would that cause this problem?

I also noticed that I had to go through some "activation" thing when logging in via the browser.

Has something changed in the login method?

Edit:
I just read this in the docs:
Salesforce checks the IP address from which the client application is logging in, and blocks logins from unknown IP addresses. For a blocked login via the API, Salesforce returns a login fault. Then, the user must add their security token to the end of their password in order to log in. A security token is an automatically-generated key from Salesforce. For example, if a user's password is mypassword, and their security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in. Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user's Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset. When the security token is invalid, the user must repeat the login process to log in. To avoid this, the administrator can make sure the client's IP address is added to the organization's list of trusted IP addresses. For more information, see Security Token.

That must be the answer.

Message Edited by aezell on 01-16-2008 11:39 AM
  • January 16, 2008
  • Like
  • 0
hi all
  I have wrote a s control to display something on the page... the only thing is it does not display anything and I know that it should Can someone please help me and tell me where am I going wrong
<html>
<head>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>

<script text="javascript">
var aid='0015000000KxU9SAAV';
function initPage()
//Get the account Number
{
var i,j;
result = sforce.connection.query("Select a.AS400_Account_Number__c, a.Id, " +
"(Select AccountId, CaseNumber From Cases) from Account a where a.Id='0015000000KxU9SAAV'");
records = result.getArray("records");

for (var i=0; i<records.length; i++) {
var record == records[i];
j ==(record.AS400_Account_Number__c);
}

};

/*****************************************************************************/

</script>
</head>
<body onload="initPage();">
</body>
</html>
Thanks
Zishan
I have a large file of 5,000 emails that I need to update and remove them from salesforce.com using the dataloader, however the Contact ID Field was deleted from the spreadsheet. I have the original file of 11,000 emails with contact IDs and the file of the 5,000 emails which are from the original 11,000 file. Is there a way to retrieve or look up contact IDs based on data from an excel file?
  • October 03, 2007
  • Like
  • 0
I guess my problem is a lack of knowledge on the API subject. My org rolled out SF to our employees about 4-5 months ago. We keep up tons of information for our members (500 companies give or take) We are looking for a way to get information about our members status to our members. Meaning our member could log in and potentially see where they are at in the process that we take care of for them. 
 
Think of it as a Mechanic having a log in for your car that you put in the shop. You could log in and check the status of your car and you could then tell that he is waiting on parts. Is this possible through API? or am i talking crazy? We have everystep of the process already in Salesforce, but a way to boost customer satisfaction would be for summary of the information to be availbe to our members.
 
Could this summary just be exported to our website and then we develop a member log in on our own website?
 
Is this possible? I apologize for not being very knowledgeable on the subject. Any way i could get this to work would be golden.
 
 
 
 

Message Edited by JMcLeodFEWA on 10-01-2007 10:24 AM

Message Edited by JMcLeodFEWA on 10-01-2007 10:24 AM

Message Edited by JMcLeodFEWA on 10-01-2007 10:26 AM

We are looking at doing some integration here and are anticipating an issue with API access. Here's the setup: Each of our clients is a Salesforce user, they provide our system with their credentials and we sync some data between our system and theirs.

Here's the potential issue: Even if we are batching these updates, we are still potentially logging in and out of the API for each client. So, if a batch of records is 100 updates, but it's 10 updates for 10 different clients, then we would be logging in and out of the API 10 times.

Is there anyway to avoid this? Can a Salesforce user grant our system access somehow, so that our system could make a single connection and update several Salesforce accounts?

Maybe this whole design is wrong. I am open to ideas. :)
  • October 01, 2007
  • Like
  • 0
Is it somehow possible to log in using the API with an external script and then, using this session to redirect the user from this external script right into SF ?
 
I.e. can I pass the session Id using the requeststring somehow?
Something like
Now whenever I try to do the redirect it will send me straight to the log in screen.
 
 

Message Edited by Harmpie on 10-01-2007 05:44 AM

Hi

We are using a payment processing system (element 5) to handle our eCommerce payments however, the only integration element 5 offer to external systems is in the form of an email with XML attachment.

I was wondering, bit of a long shot, can Salesforce accept and parse inbound emails and attachments or am I going to have to use an intermediary server, parse the file myself and then use the API to update data within Salesforce.com??

Any help would be greatly appreciated!

Cheers

Paul
First, is it possible to send an email from a trigger? If so, is there an example or documentation somewhere.

Further, is it possible, in general, to access the Apex Web Services API from within a trigger? Maybe I'm just getting my terminology all mixed up, but I'm losing a little of the separation between the Web Services API and the Apex methods to which my trigger has access.
  • September 28, 2007
  • Like
  • 0
Does Salesforce generate a standard controller when you create a Custom Object? If yes, how do you reference it? For example, here is how you reference a standard one like Account:

<apex:page standardController="account" tabStyle="RPMProduct__c">

Although tabSytle supports the Custom Object named RPMProduct, standardController does not. The RPMProduct page is using some controller. What controller does a custom object use? How do I use it in VisualForce?

Also is there a list of standard objects/controllers/fields to reference while developing with VisualForce or Apex code for that matter? The only method I know is to view the standard object and fields through Setup -> Customize in the Salesforce subscription (time consuming).

Thanks,
Mark
Hi,

I have created a trigger that will fire on Opportunity after update, insert and delete events. It will determine how many Opportunities are outstanding and update the associated account with the outstanding count.

This is the WHERE clause of the query:

((Opportunity.StageName = '5 - Offer by Client (Conditional)' OR Opportunity.StageName = '6 - Offer by Client (Unconditional)' OR Opportunity.StageName = '7 - Preliminary Accept' OR Opportunity.StageName = 'Deferred by Applicant') AND Opportunity.Course_Start_Date__c <= TODAY AND Opportunity.PSR__c = false AND Opportunity.InstituitionAccount__c = :accountId)

The problem is the following exception gets thrown:
System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.

What does this mean? How can I avoid this problem?
Hi,

I'm new to Salesforce, so I was going through the Salesforce Creating On Demand Apps book.  Everything was working fine until I tried to implement the Yahoo Maps custom S-Control in chapter 10.  I copied and pasted the code from the downloaded Candidates Map file, so there are no typos on my part.  Then, I created my custom link (as instructed) and added it to the Position tab's page layout.  The custom link shows up on my Position details page fine.  However, when I click on it, the page simply blanks out.  The map doesn't show up. 

Is there anything else that I needed to do to get this to work?  Do I need to download any other tools or anything not mentioned in the Creating On Demand Apps book?

Any help is appreciated.

Thanks so much!
  • September 27, 2007
  • Like
  • 0
Hi,
 
I have a dev account now.  Another user has a production account.  The prod account uses custom objects.  I want to copy these objects from the prod to the dev accounts and test some code against these custom objects using the Enterprise API.  I know I could create the custom objects manually, but this would invalidate my testing.  How can I get the environment copied to my own account?  If I cannot do that, then how can I get just the custom object(s) copied over?
 
Thx,
Paul
The new callout functionality is really great. However, there seems to be a rather gaping hole.

Many web services return XML in their responses, yet, Apex seems to have no way to deal with this XML. There seems to be no variable type in which to store the XML and no methods for parsing that XML.

I must be missing something. My use case here is a callout to the Zipcode Info service at webservicex.net. It returns XML which contains information about that zipcode, including city and state.

I've generated the Apex class from the WSDL and it's compiled fine. What I can't seem to do is write any code that will compile because the return value from the class calling the service is always expected to be XML.

The WSDL location is here: http://www.webservicex.net/uszip.asmx?wsdl

I edited it to use only the SOAP ports and bindings. Would I be better off using one of the other bindings/ports?

Essentially, I'm just lost here finding out any details on consuming a third-party web service past the basic, and seemingly incomplete, examples in the Apex Language Reference.

Thanks for reading all that!
  • September 24, 2007
  • Like
  • 0