• Mike @ Partners
  • NEWBIE
  • 30 Points
  • Member since 2006

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 43
    Replies
If from salesforce.com portal we make an activity history and in it an event schedule is more than one day (that a event starts on a day and ends on another) then event is not fetched by using the api for Java

if we query with any of the dates of that event it is not fetched

e.g.

Select Id,Subject,ActivityDate,ActivityDateTime,CreatedDate,IsAllDayEvent,Location,Description from Event where (ActivityDate>=2008-09-11 and ActivityDate<=2008-09-13 and OwnerId = '00530000000va5aAAA') Order by ActivityDate, ActivityDateTime


we have tried different dates for (ActivityDate>=2008-09-11 and ActivityDate<=2008-09-13 ) but still result is not shown.

Even when for testing we removed the date check that record did'nt come up

e.g. Select Id,Subject,ActivityDate,ActivityDateTime,CreatedDate,IsAllDayEvent,Location,Description from Event where (OwnerId = '00530000000va5aAAA') Order by ActivityDate, ActivityDateTime

with this query also that record did'nt come up

So, we require support regarding it issue that, how such a record will be fetched where an activity history is made and in it an event schedule is more than one day (that a event starts on a day and ends on another)
Im having trouble with Events that are scheduled on Multiple Days (One event spanning several days, all day or not all day). I query for events and no events that are scheduled on multiple days show up. I have even had the API query for the direct Event Id number of a multi day event and it cant find it. Are these events saved in a different object? If so where. Any thoughts, or ideas would be greatly appreciated. I can get the API to pull all other events fine, just not Multiple Day Events.
Thanks,
Mike
I need to create an Apex page that incorporates information from and external website. I need to be able to make calls to the website. From what i have read there are two ways of doing this. 1- using the Ajax remoteFunction feature. I tried this method, but could only get it to work with Firefox. The other method i read about seems to work using Apex classes and a WSDL from the website you are making the calls to. I dont know where to go to find out how to make a WSDL for our website. Also, to make Apex Class you need a developers account. Im a little confused on how this works.

If you can point me in the right direction on how to make a WSDL for my server so i can upload it to salesforce so the two systems can talk that would be great. And also if you show me where to find info on the Apex classes and how to get a developers account and how to move the class between the two different salesforce accounts that would be great as well. Thank you for your help, and sorry for being such a newbie to Apex.

Mike
I have a custom object with record types. When i try and query for the record type id it give me the error:
"Uncaught SoapFault exception: [ns1:INVALID_FIELD] INVALID_FIELD"..."No such column 'RecordTypeId' on entity 'Certification__c'"

I don't know why it started doing this all of the sudden. The script has worked great for months. Also the RecordTypeId shows up in the WSDL.

Here is the code:

////////
$query = "SELECT Id, RecordTypeId from Certification__c where Contact__c = '".$ContactID."'";
$response = $sforce->query(($query), $queryOptions);
$Info = $response->records;

if ($Info){
try {
foreach ($Info as $r) {
$r = new SObject($r);
$RecordTypeId = $r->fields->RecordTypeId;
echo $RecordTypeId."
";
}
}
}
///////

I have this happening with two different scripts looking at two different custom objects. I was thinking that there is something on my server causing this, but the other thing is i can query another information no problem.
Any help or ideas would be greatly appreciated.
Thank you,
mike
Im trying to figure out how to pass the current Session Id and API server threw a s-control to my php web app. And then have the php web app make salesforce calls using that current Session Id.

The goal is to not have to re-login, but use the current users session.

I have looked all over but cant find any samples, or documentation on how to do this. Any help would be appreciated.

Thanks,
Mike
we just got macs for our management team and I'm trying to figure out a way to get entourage as my teams defalt mail/calander app. iCal and apples Mail are not very good in a production/sales aspect. I know that SfCubed syncs with iCal and that Entourage can sync with iCal was well, But each on must sync with a different folder (SfCubed to a salesforce calander in iCal and entourage to a Entourage folder in iCal). I realize you must know this already. My questions is... do you think this feature might be added soon, and if not is there a way i can help with this. Im good with applescript and web languages, and am currently learning cocoa with Xcode.

I have tried other options to sync iCal and entourage (e2Sync and Sync Entourage-iCal) but with no luck.
- 'Sync Entourage-iCal' has problems with understand which is the latest event from the different systems, because it works with out using apples iSync.
-'e2Sync' seems to work great at first but then there are time-zone issues. At least i think it is a time-zone issue. Events created in salesforce get synced to iCal with the correct time (When iCal pref 'Turn on time zone support' is turned off) but when synced to entourage the times get all messed up. And when the iCal pref 'Turn on time zone support' is turned on the time gets all messed up in iCal.

Any ideas on ether on these would be great. Thanks for your help.
Mike

Message Edited by Mike @ Partners on 09-05-2007 01:35 PM

Im trying to create a php login that only requires one php page. From all the code i can find you have to have one php page that logs you in, then it redirects the header to another page where all the calls/actions are done. Is there a way to have it all combined onto one page. So the page that logs-in doesn't have to redirect the header, but instead calls the function that will preform the actions?
Thanks for the help,
Mike
Im staring to develop an app that will need to log in to salesforce and create a record. The best way to do this would be using ajax. but i don't want my log in name and password just sitting out there because they would have to be hard coded into the app. Does saleforce have a solution to this problem? if not... is it possible to log in using php and then run ajax code. So have the php log in and the ajax code make all the calls?

Thanks for your help,

Mike

I have a custom tab that calls a page on my server. I need to resize the tabs iframe using javascript so i dont get two scroll bars. The problem is every code i try i get "Error: uncaught exception: Permission denied to get property ..." as an error. Is there any way to do this?
Thanks for the help,
Mike
Im trying to make a custom link that will take you to the edit page of a record and  then highlight (focus) a certain field. Is  there a way to do this? Also is there a list or documents that SF has put out saying what will work in the URL? (List of commands)
Thanks for your help.
Mike
Im trying to understand how to use the new 'Outbound Message' feature. Im not very familiar with how this system works. Is there somewhere i can go to read up on how to develop the recving side the the message, or do you have example code of what the receiving side may look like?
Thanks for your help,
Mike

Im trying to do a search on a objects created date, but only want ones after a certain time. It seems that the '<' or '>' symbols dont work. I keep getting 'unexpected char: 0xံFerror' when ever i use it. Any ideas on what i can use to have searches with 'greater then' or 'less then'?
Here is my code:

Code:
global $mySforceConnection;
  try{
  $xsdTime = strftime('%Y-%m-%dT%H:%M:%S',mktime(12, 0, 0, 1, 1, 2007));
  $SearchDate = $xsdTime;
  $query = "SELECT Id, CreatedDate, Account__c from BusinessDevelopment__c where CreatedDate < $SearchDate";
  $queryOptions = new QueryOptions(500);
  $response = $mySforceConnection->query(($query), $queryOptions);
  $response2 = $response->records;
  return $response2;
  }
  catch (Exception $e)
  {
$errors = $e->faultstring; echo $errors; }

Thanks,
Mike

Message Edited by Mike @ Partners on 02-05-2007 12:14 PM

I am trying to update a Date feild in accounts to blank but i cant get it to work. The 'fieldsToNull' doesnt seem to be working. I dont get any errors or faults. Any ideas? Here is my code.
Thanks,
Mike


Code:
global $mySforceConnection;
    $fieldsToUpdate = array('Id'=>$AccountID);
    $sObject = new SObject();
    $sObject->fields = $fieldsToUpdate;
$sObject->fieldsToNull = array('Latest_PW_Date__c'); $sObject->type = 'Account'; $updateRespons = $mySforceConnection->update(array($sObject));
var_dump($updateRespons); return;

 

I am trying to make calls to the API but keep getting this error about 75% of the time i run the code. here is the error:


Warning: SoapClient::__construct() [function.--construct]: I/O warning : failed to load external entity "partner.wsdl.xml" in ....../salesforce/soapclient/SforceBaseClient.php on line 57
There was a problem with your login: SOAP-ERROR: Parsing WSDL: Couldn't load from 'partner.wsdl.xml'

Any ideas on what this error is saying. The other strange thing is I took the exact code I used for other web app and put it into this app. The other app works fine, no problems ever. The only thing different between the two web apps is there location under the root folder. I made the correct adjustments to the files so they point to where they need to, but I still get this error. It seems as if it can't find the wsdl file on my server. The strange thing about that is the page before this error is my log-in page, I don't get any errors on that page then the moment I get to this page I get this error.

Any ideas would be helpful.
Thank you,
Mike

I have created a online app that works with salesforce. I got everything working perfectly, but when I add the SSL "https:" onto the url I get errors. But i only get errors when it is trying to interact with salesforce. The first part, where it is logging into salesforce it doesn’t like any of the 'Try' commands I have. That error looks like this:

Code:
Parse error: parse error, unexpected '{' in ourwebsite/PW-loginRegister.php on line 8

 
 So I deleted all of the '{' or '}' that weren’t need, they happened to be the 'TRY' commands, and then I get this error:
Code:
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in ourwebsite/soapclient/SforcePartnerClient.php on line 39

 

Any ideas on where i am going wrong would be very helpful.

 

Here is the code for the login page:

Code:
<—php
require_once ('../../salesforce/soapclient/SforcePartnerClient.php');
include ('header.inc');
session_start();
function login($username, $password) {
   $wsdl = '../../salesforce/partner.wsdl.xml';
   $loginResult = null;
   try {
     $mySforceConnection = new SforcePartnerClient();
     $mySforceConnection->createConnection($wsdl);
     $loginResult = $mySforceConnection->login($username, $password);

     $_SESSION['location'] = $mySforceConnection->getLocation();
     $_SESSION['sessionId'] = $mySforceConnection->getSessionId();
     $_SESSION['wsdl'] = $wsdl;

   } catch (Exception $e) {
     global $errors;
     $errors = $e->faultstring;
    print($errors);
   }
   return $loginResult;
}
 try {
$result = login('username', 'userpass'); if (isset($result)) {
         session_write_close();

$Campign_Num = $_GET['Campign_Num'];
$Monthname = $_GET['Monthname'];
$Monthnum = $_GET['Monthnum'];
$daynum = $_GET['daynum'];
$year = $_GET['year'];
$City = $_GET['City'];
$State = $_GET['State'];

header('Location: PW_Agreement.php–Campign_Num='. 
$Campign_Num.'&Monthname='.$Monthname.'&Monthnum='. 
$Monthnum.'&daynum='.$daynum.'&year='.$year.'&City='.$City.'&State='. 
$State);
         exit();
       }}
  catch (Exception $e) {
       print_r($e);    }

include ('footer.inc');
˜>

 

Also if I skip this page and have the SSL start on a page after this everything works find till I try and make a call to salesforce. It gives me the error the i have an extra '{'

 

Any ideas would be very helpful, thank you for your help,

Mike

 
 
 

Message Edited by Mike @ Partners on 09-13-2006 01:29 PM

I am trying to adda product to an opportunit that was just created. I came up with this code:

Code:
$fieldsToCreate = array('Name'=>$OpName,'Type'=> $OpType,'LeadSource'=>$OpSource,'CloseDate'=>$PWDate,'StageName'=>$OpStage,'CampaignId'=>$CampaignId,'Amount'=>$BillAmount,'AccountId'=>$AccountId,'Public_Workshop__c'=>$POWid,'RecordTypeId'=>$RecordTypedID,'AccountId'=>$AccountId);
$sObject1 = new SObject();
$sObject1->fields = $fieldsToCreate;
$sObject1->type = 'Opportunity';
$updateRespons = $mySforceConnection->create(array($sObject1));
var_dump($updateRespons);
$updateResponsid = $updateRespons->id;

$fieldsToCreate2 = array('OpportunityId'=> $updateResponsid,'UnitPrice'=> $salesprice,'ProductId'=>'00j30000000mflNAAQ','PricebookEntryId'=>'01u30000000BCVIAA4','Quantity'=>$numAtten,'ServiceDate'=>$PWDate,'Location__c'=>$PWLocation,'Description'=>$lineDisc);
$sObject2 = new SObject();
$sObject2->fields = $fieldsToCreate2;
$sObject2->type = 'OpportunityLineItem';
$updateRespons2 = $mySforceConnection->create(array($sObject2));
var_dump($updateRespons2);
return $updateResponsid;

}


This code creats the opportunit then it is supose to add the correct product to the opportunit that was just created. The opportunit  gets create but i get this error when it trys to add the product:

object(stdClass)#11 (3) { ["errors"]=> object(stdClass)#12 (3) { ["fields"]=> NULL ["message"]=> string(16) "assertion failed" ["statusCode"]=> string(17) "UNKNOWN_EXCEPTION" } ["id"]=> NULL ["success"]=> bool(false) }

Any ideas on where im going wrong?
thanks for the help.
Mike
 

I am trying to understand how s-controls work and notice you can upload a file to the s-control. Why would you wont to do this, can you have the fields from salesforce populate the file that is being upload. Do you know of any examples i can go look at to see why it would be beneficial to have a file in a s-control?
Thank you for your help,
Mike

I am trying to add a Campaign to a contact using the API. im a little lost on where to begin. Do i need to run a query to update the Campaign with the contact ID number i would like add to it, or do i update the contact with the Campaign id. Any ideas would be very helpful.

Thank you,

mike

I am trying to run a query for leads that equal a certin E-mail and is not converted. I came up with this code:

function DgetreciverleadQ2() {
global $mySforceConnection;
$ReciverEmail = $_GET['ReciverEmail'];
$query = "SELECT Id from Lead where Lead.Email='$ReciverEmail' ,ConvertedDate=''";
$queryOptions = new QueryOptions(25);
$response = $mySforceConnection->query(($query), $queryOptions);
return $response->records;
}

the proublem is it the query doesnt pull any information. I dont get a error ether.
Any ideas wher i am going wrong?
Thank you for your help,
mike

I am trying to update more then one lead at a time. I am pulling the lead ID numbers and then i need to update all the ID numbers with a cretin field. I have gotten the php5 toolkit to pull the ID no problem, and i can get it to update no problem. The problem is I can only get it to update one ID. And ideas on where I am going wrong?

 

Thank you for your help,

Mike

Is there a way to mass e-mail to contacts or leads using a template and a custom object? I know i can mass e-mail using the leads object. But that only works if the e-mail has no variables in it (it doesn’t pull info from the object)

I have a custom object i have created call e-mail generator. I fill in the dates the e-mail needs to reflect and other info that it needs, then send a e-mail using a template that puts the info in the correct place. The problem with this is i can only do a look up for one person and i want to send it to more then one person i have to type the persons e-mail address in the additional to box.

Any ideas on the best way to handle this?

Thank you,
mike

I need to create an Apex page that incorporates information from and external website. I need to be able to make calls to the website. From what i have read there are two ways of doing this. 1- using the Ajax remoteFunction feature. I tried this method, but could only get it to work with Firefox. The other method i read about seems to work using Apex classes and a WSDL from the website you are making the calls to. I dont know where to go to find out how to make a WSDL for our website. Also, to make Apex Class you need a developers account. Im a little confused on how this works.

If you can point me in the right direction on how to make a WSDL for my server so i can upload it to salesforce so the two systems can talk that would be great. And also if you show me where to find info on the Apex classes and how to get a developers account and how to move the class between the two different salesforce accounts that would be great as well. Thank you for your help, and sorry for being such a newbie to Apex.

Mike
If from salesforce.com portal we make an activity history and in it an event schedule is more than one day (that a event starts on a day and ends on another) then event is not fetched by using the api for Java

if we query with any of the dates of that event it is not fetched

e.g.

Select Id,Subject,ActivityDate,ActivityDateTime,CreatedDate,IsAllDayEvent,Location,Description from Event where (ActivityDate>=2008-09-11 and ActivityDate<=2008-09-13 and OwnerId = '00530000000va5aAAA') Order by ActivityDate, ActivityDateTime


we have tried different dates for (ActivityDate>=2008-09-11 and ActivityDate<=2008-09-13 ) but still result is not shown.

Even when for testing we removed the date check that record did'nt come up

e.g. Select Id,Subject,ActivityDate,ActivityDateTime,CreatedDate,IsAllDayEvent,Location,Description from Event where (OwnerId = '00530000000va5aAAA') Order by ActivityDate, ActivityDateTime

with this query also that record did'nt come up

So, we require support regarding it issue that, how such a record will be fetched where an activity history is made and in it an event schedule is more than one day (that a event starts on a day and ends on another)
Im trying to figure out how to pass the current Session Id and API server threw a s-control to my php web app. And then have the php web app make salesforce calls using that current Session Id.

The goal is to not have to re-login, but use the current users session.

I have looked all over but cant find any samples, or documentation on how to do this. Any help would be appreciated.

Thanks,
Mike
we just got macs for our management team and I'm trying to figure out a way to get entourage as my teams defalt mail/calander app. iCal and apples Mail are not very good in a production/sales aspect. I know that SfCubed syncs with iCal and that Entourage can sync with iCal was well, But each on must sync with a different folder (SfCubed to a salesforce calander in iCal and entourage to a Entourage folder in iCal). I realize you must know this already. My questions is... do you think this feature might be added soon, and if not is there a way i can help with this. Im good with applescript and web languages, and am currently learning cocoa with Xcode.

I have tried other options to sync iCal and entourage (e2Sync and Sync Entourage-iCal) but with no luck.
- 'Sync Entourage-iCal' has problems with understand which is the latest event from the different systems, because it works with out using apples iSync.
-'e2Sync' seems to work great at first but then there are time-zone issues. At least i think it is a time-zone issue. Events created in salesforce get synced to iCal with the correct time (When iCal pref 'Turn on time zone support' is turned off) but when synced to entourage the times get all messed up. And when the iCal pref 'Turn on time zone support' is turned on the time gets all messed up in iCal.

Any ideas on ether on these would be great. Thanks for your help.
Mike

Message Edited by Mike @ Partners on 09-05-2007 01:35 PM

Im trying to create a php login that only requires one php page. From all the code i can find you have to have one php page that logs you in, then it redirects the header to another page where all the calls/actions are done. Is there a way to have it all combined onto one page. So the page that logs-in doesn't have to redirect the header, but instead calls the function that will preform the actions?
Thanks for the help,
Mike
Im staring to develop an app that will need to log in to salesforce and create a record. The best way to do this would be using ajax. but i don't want my log in name and password just sitting out there because they would have to be hard coded into the app. Does saleforce have a solution to this problem? if not... is it possible to log in using php and then run ajax code. So have the php log in and the ajax code make all the calls?

Thanks for your help,

Mike

I have a custom tab that calls a page on my server. I need to resize the tabs iframe using javascript so i dont get two scroll bars. The problem is every code i try i get "Error: uncaught exception: Permission denied to get property ..." as an error. Is there any way to do this?
Thanks for the help,
Mike
Im trying to understand how to use the new 'Outbound Message' feature. Im not very familiar with how this system works. Is there somewhere i can go to read up on how to develop the recving side the the message, or do you have example code of what the receiving side may look like?
Thanks for your help,
Mike

I am trying to update a Date feild in accounts to blank but i cant get it to work. The 'fieldsToNull' doesnt seem to be working. I dont get any errors or faults. Any ideas? Here is my code.
Thanks,
Mike


Code:
global $mySforceConnection;
    $fieldsToUpdate = array('Id'=>$AccountID);
    $sObject = new SObject();
    $sObject->fields = $fieldsToUpdate;
$sObject->fieldsToNull = array('Latest_PW_Date__c'); $sObject->type = 'Account'; $updateRespons = $mySforceConnection->update(array($sObject));
var_dump($updateRespons); return;

 

    hi . i am trying to login into salesforce using new ajax toolkit.
 but i could not get login.

 this is the code i am tried.
<html>
<head>
<script src="https://na1.salesforce.com/soap/ajax/8.0/connection.js" type="text/javascript"></script>
<script>

 function login()
 {
    try
    {
    sforce.connection.login("username","password");
    result = sforce.connection.query("Select Name, Id from Account");
    records = result.getArray("records");
    for (var i=0; i<records.length; i++)
    {
    var record = records[i];
    alert(record.Name + " -- " + record.Id);
    }
    }
    catch(e)
    {
     alert(e);
    }

 }

</script>
</head>
29
<body onload="login()">
<div id="output"></div>
</body>
</html>

BUT i GET This Exception
 "NS_ERROR_FILE_UNRECOGNIZED_PATH"

 if i am using this url "<script src="/soap/ajax/8.0/connection.js" type="text/javascript"></script>"
 
i got error like sforce is not defined.

plz any one help me  out.
regards prasad.

Message Edited by DevAngel on 03-15-2007 01:05 PM

I am trying to make calls to the API but keep getting this error about 75% of the time i run the code. here is the error:


Warning: SoapClient::__construct() [function.--construct]: I/O warning : failed to load external entity "partner.wsdl.xml" in ....../salesforce/soapclient/SforceBaseClient.php on line 57
There was a problem with your login: SOAP-ERROR: Parsing WSDL: Couldn't load from 'partner.wsdl.xml'

Any ideas on what this error is saying. The other strange thing is I took the exact code I used for other web app and put it into this app. The other app works fine, no problems ever. The only thing different between the two web apps is there location under the root folder. I made the correct adjustments to the files so they point to where they need to, but I still get this error. It seems as if it can't find the wsdl file on my server. The strange thing about that is the page before this error is my log-in page, I don't get any errors on that page then the moment I get to this page I get this error.

Any ideas would be helpful.
Thank you,
Mike

I have created a online app that works with salesforce. I got everything working perfectly, but when I add the SSL "https:" onto the url I get errors. But i only get errors when it is trying to interact with salesforce. The first part, where it is logging into salesforce it doesn’t like any of the 'Try' commands I have. That error looks like this:

Code:
Parse error: parse error, unexpected '{' in ourwebsite/PW-loginRegister.php on line 8

 
 So I deleted all of the '{' or '}' that weren’t need, they happened to be the 'TRY' commands, and then I get this error:
Code:
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in ourwebsite/soapclient/SforcePartnerClient.php on line 39

 

Any ideas on where i am going wrong would be very helpful.

 

Here is the code for the login page:

Code:
<—php
require_once ('../../salesforce/soapclient/SforcePartnerClient.php');
include ('header.inc');
session_start();
function login($username, $password) {
   $wsdl = '../../salesforce/partner.wsdl.xml';
   $loginResult = null;
   try {
     $mySforceConnection = new SforcePartnerClient();
     $mySforceConnection->createConnection($wsdl);
     $loginResult = $mySforceConnection->login($username, $password);

     $_SESSION['location'] = $mySforceConnection->getLocation();
     $_SESSION['sessionId'] = $mySforceConnection->getSessionId();
     $_SESSION['wsdl'] = $wsdl;

   } catch (Exception $e) {
     global $errors;
     $errors = $e->faultstring;
    print($errors);
   }
   return $loginResult;
}
 try {
$result = login('username', 'userpass'); if (isset($result)) {
         session_write_close();

$Campign_Num = $_GET['Campign_Num'];
$Monthname = $_GET['Monthname'];
$Monthnum = $_GET['Monthnum'];
$daynum = $_GET['daynum'];
$year = $_GET['year'];
$City = $_GET['City'];
$State = $_GET['State'];

header('Location: PW_Agreement.php–Campign_Num='. 
$Campign_Num.'&Monthname='.$Monthname.'&Monthnum='. 
$Monthnum.'&daynum='.$daynum.'&year='.$year.'&City='.$City.'&State='. 
$State);
         exit();
       }}
  catch (Exception $e) {
       print_r($e);    }

include ('footer.inc');
˜>

 

Also if I skip this page and have the SSL start on a page after this everything works find till I try and make a call to salesforce. It gives me the error the i have an extra '{'

 

Any ideas would be very helpful, thank you for your help,

Mike

 
 
 

Message Edited by Mike @ Partners on 09-13-2006 01:29 PM

I am trying to adda product to an opportunit that was just created. I came up with this code:

Code:
$fieldsToCreate = array('Name'=>$OpName,'Type'=> $OpType,'LeadSource'=>$OpSource,'CloseDate'=>$PWDate,'StageName'=>$OpStage,'CampaignId'=>$CampaignId,'Amount'=>$BillAmount,'AccountId'=>$AccountId,'Public_Workshop__c'=>$POWid,'RecordTypeId'=>$RecordTypedID,'AccountId'=>$AccountId);
$sObject1 = new SObject();
$sObject1->fields = $fieldsToCreate;
$sObject1->type = 'Opportunity';
$updateRespons = $mySforceConnection->create(array($sObject1));
var_dump($updateRespons);
$updateResponsid = $updateRespons->id;

$fieldsToCreate2 = array('OpportunityId'=> $updateResponsid,'UnitPrice'=> $salesprice,'ProductId'=>'00j30000000mflNAAQ','PricebookEntryId'=>'01u30000000BCVIAA4','Quantity'=>$numAtten,'ServiceDate'=>$PWDate,'Location__c'=>$PWLocation,'Description'=>$lineDisc);
$sObject2 = new SObject();
$sObject2->fields = $fieldsToCreate2;
$sObject2->type = 'OpportunityLineItem';
$updateRespons2 = $mySforceConnection->create(array($sObject2));
var_dump($updateRespons2);
return $updateResponsid;

}


This code creats the opportunit then it is supose to add the correct product to the opportunit that was just created. The opportunit  gets create but i get this error when it trys to add the product:

object(stdClass)#11 (3) { ["errors"]=> object(stdClass)#12 (3) { ["fields"]=> NULL ["message"]=> string(16) "assertion failed" ["statusCode"]=> string(17) "UNKNOWN_EXCEPTION" } ["id"]=> NULL ["success"]=> bool(false) }

Any ideas on where im going wrong?
thanks for the help.
Mike
 

I am trying to do an update a field to empty string using fieldsToNull, but it never works.

The following is the code:

  $fieldsToUpdate = array('Id'=>$ID,'Test__c'=>NULL);
  $sObject = new SObject();
  $sObject->fieldsToNull = $fieldsToUpdate;

  $rs = $mySforceConnection->update(array($sObject));

Please help...
 
Thanks
I am looking to use our salesforce data base as our websites data base as well. I am hoping to use it so clients can log-in at our website, and then access other pasts of the site. Does anyone have a sugetion on the best way to haddle this?

Thank you for your help
I realize this is unsupported currently, but is there any way to create a new template e-mail and have it send immediately from an scontrol? I'm already creating the new e-mail, but currently it just opens into a standard send e-mail window and I can't find any URL parameter to just have it send the e-mail without requiring a second click.

What I'm currently doing:

window.location.href = "/email/author/emailauthor.jsp?retURL=%2F{!Contact_ID}&rtype=003" + "&p2_lkid={!Contact_ID}&new_template=1&nosave=0&template_id=";

I could of course handle this outside an scontrol with an external web server and a custom link, but I'd prefer to handle everything within an scontrol to keep it contained within SFDC.

Is there any way to do what I want (supported or not) or am I stuck with manual intervention or an external solution?

BTW, adding &save=1 to that URL causes an internal server error, not sure if save=1 is supposed to work and is just currently broken or is just an unexpected URL parameter for this page that causes an error.

Thanks,
E.J.
  • January 31, 2006
  • Like
  • 0