• Daniel Wray
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
Hi,
 
Please can someone see where this query is going wrong.  I can't seem to return anything although the code is not complaining either.
 
var test = sforceClient.search("FIND {447787502823} IN ALL FIELDS RETURNING Contact (FirstName, Id, LastName)")
         FirstName = "";
        //password = "";
        if (test.className == "SearchResult")
        {
                FirstName = test.records[0].get("FirstName__c");
        }
       alert(FirstName);
  
 
Also tried this on IN PHONE FIELDS BUT neither query returned anything or complained about the code????
 
HELP??? thanks
07-12-2006 02:21 AM
Hi,
 
I have tried various forms of this code ( shown below), but with no sucess,  sometimes it is not complaining but also not retrieving any records.  note: dest is a mobile number
 
Many Thanks
 
Anita
 
// not working but not complaining!!! First attempt
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = ' " + dest + " ' ", bindToForm);
 
// Or second go not working but not complaining!!!
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = '{!Contact_MobilePhone}' ", bindToForm);
 
function bindToForm(queryResult)
{
var obj;
alert("im here in the bindToForm method!!");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
firstName = queryResult.records[0].get("FirstName");
lastName = queryResult.records[0].get("LastName");
alert(firstName);
alert(lastName);
}
 
// code complaining object doesn't support this query
 
var contact = new sforceClient.Query("FirstName_c, LastName_c From Contact_c Where Mobile = '{!Contact_MobilePhone}' ");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
if (contact.className == "QueryResult")
{
 firstName = contact.records[0].get("username__c");
 password = qr.records[0].get("password__c");
}
alert(firstname);
alert(lastName);
 
Hi,
 
I am able using the AJAX toolkit and Javascript, to create a task against its owner, but ideally I want to get the current contacts info to which the task relates.  Also, I am struggling to find an outline of what tables exist I can query.
 
Any point in the right direction would be appreciated, basically I haven't been given the time to read all the documentation and need to sort this asap.
 
Many Thanks Anita
Hi, I am recieving a " FIELD_INTEGRITY_EXCEPTION CONTACT\LEAD ID: id of incorrect type 0053*********fmAAA" exception when trying to create a task for the person logged in.  I am passing a 18 digit character/number string of the person logged in.
 
Here's the code:
 
//create activity on account to record update
var newActivity = new Sforce.Dynabean("Task");
newActivity.set("Subject", "message " + variable);
newActivity.set("WhoId", accId);
newActivity.set("Status", "Completed");
newActivity.set("Priority", "Normal");
newActivity.set("Description", variable);
var today = new Date();
newActivity.set("ActivityDate", today);
 
// no brackets!! hasnt worked
var saveResult = sforceClient.Create(newActivity)[0];
 
// no brackets no [0] hasnt worked 
var saveResult = sforceClient.Create(newActivity);
 
// original code not working
var saveResult = sforceClient.Create([newActivity])[0];
alert(saveResult);
 
I would really apreciate if someone could help, thanks!!  Anita
I have some customer reports already created, and I want to create a Reports tab for my application which only lists the reports I wish to package into the application.

Can anyone point me to any documentation that will help me?

Thanks.
I'm looking for a good way to allow parameters (a proprietary un/pass pair) to be passed through to an applet embedded within an S-Control. I'd like to store these settings at perhaps user/role level, or failing that a company wide admin setting would be acceptable.
 
My only approach so far has been to implement a custom object with username and password fields, which I can see is then referencable within the code for the S-Control for example
 
<PARAM
           name="username"
           value="{!SmsAccountDetails_Username}"/>
<PARAM
           name="password"
           value="{!SmsAccountDetails_Password}"/>

 
However this is clearly the wrong approach to take for a couple of reasons. Firstly, this control is meant to be referenced (say, as a custom link?) on contact/lead pages (it's a messaging addon). There appears to be no way to provide the hook between one of these records and a record in my custom object area containing the user supplied details. Secondly, a user would seemingly be able to edit/create as many SmsAccountDetails records as they would want. There's no way to elect a record to be used within the current user context/session. Custom objects does not seem to be the logical place for these values.
 
I'm now wondering whether it's possible to implement custom fields against the current user/role record which could ideally be edited by the site administrator. I can't see where I'd start with this approach, if it's even possible.
 
Finally, I'm constrained by the fact that whichever solution I do implement, must be exportable as an application to other users.
 
Can anyone offer any advice as to how I might go about solving this problem? Perhaps I'm barking up the wrong tree with a few things (my experience with salesforce.com reaches as far back as five days I'm afraid).
 
Thanks in advance,
 
Dan
Hi,
 
I have tried various forms of this code ( shown below), but with no sucess,  sometimes it is not complaining but also not retrieving any records.  note: dest is a mobile number
 
Many Thanks
 
Anita
 
// not working but not complaining!!! First attempt
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = ' " + dest + " ' ", bindToForm);
 
// Or second go not working but not complaining!!!
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = '{!Contact_MobilePhone}' ", bindToForm);
 
function bindToForm(queryResult)
{
var obj;
alert("im here in the bindToForm method!!");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
firstName = queryResult.records[0].get("FirstName");
lastName = queryResult.records[0].get("LastName");
alert(firstName);
alert(lastName);
}
 
// code complaining object doesn't support this query
 
var contact = new sforceClient.Query("FirstName_c, LastName_c From Contact_c Where Mobile = '{!Contact_MobilePhone}' ");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
if (contact.className == "QueryResult")
{
 firstName = contact.records[0].get("username__c");
 password = qr.records[0].get("password__c");
}
alert(firstname);
alert(lastName);
 
Hi, I am recieving a " FIELD_INTEGRITY_EXCEPTION CONTACT\LEAD ID: id of incorrect type 0053*********fmAAA" exception when trying to create a task for the person logged in.  I am passing a 18 digit character/number string of the person logged in.
 
Here's the code:
 
//create activity on account to record update
var newActivity = new Sforce.Dynabean("Task");
newActivity.set("Subject", "message " + variable);
newActivity.set("WhoId", accId);
newActivity.set("Status", "Completed");
newActivity.set("Priority", "Normal");
newActivity.set("Description", variable);
var today = new Date();
newActivity.set("ActivityDate", today);
 
// no brackets!! hasnt worked
var saveResult = sforceClient.Create(newActivity)[0];
 
// no brackets no [0] hasnt worked 
var saveResult = sforceClient.Create(newActivity);
 
// original code not working
var saveResult = sforceClient.Create([newActivity])[0];
alert(saveResult);
 
I would really apreciate if someone could help, thanks!!  Anita
I want to know what is the best way to call a web service from Salesforce.
The process involves
From an Contact SF page...
1.Call a webservice that I host in my webserver
2.Creating a task associated with the contact based on the webservice result

Also
What the best way to authenticate in my web service
1 - Should I create a UsernameWs/PasswordWs Field in the User Object and pass it
or
2 - pass the sessionId
I'm looking for a good way to allow parameters (a proprietary un/pass pair) to be passed through to an applet embedded within an S-Control. I'd like to store these settings at perhaps user/role level, or failing that a company wide admin setting would be acceptable.
 
My only approach so far has been to implement a custom object with username and password fields, which I can see is then referencable within the code for the S-Control for example
 
<PARAM
           name="username"
           value="{!SmsAccountDetails_Username}"/>
<PARAM
           name="password"
           value="{!SmsAccountDetails_Password}"/>

 
However this is clearly the wrong approach to take for a couple of reasons. Firstly, this control is meant to be referenced (say, as a custom link?) on contact/lead pages (it's a messaging addon). There appears to be no way to provide the hook between one of these records and a record in my custom object area containing the user supplied details. Secondly, a user would seemingly be able to edit/create as many SmsAccountDetails records as they would want. There's no way to elect a record to be used within the current user context/session. Custom objects does not seem to be the logical place for these values.
 
I'm now wondering whether it's possible to implement custom fields against the current user/role record which could ideally be edited by the site administrator. I can't see where I'd start with this approach, if it's even possible.
 
Finally, I'm constrained by the fact that whichever solution I do implement, must be exportable as an application to other users.
 
Can anyone offer any advice as to how I might go about solving this problem? Perhaps I'm barking up the wrong tree with a few things (my experience with salesforce.com reaches as far back as five days I'm afraid).
 
Thanks in advance,
 
Dan