• SrBlanco
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 13
    Replies
All,

I cant seem to reference Contact.AccountId as a merge field in a s-control.  When I do I get the errror:  "Field Contact.AccountId does not exist. Check spelling."

I also noticed that it isnt available from the merge field insert dropdown although I can definately see this field in Apex Explorer. 

I am basically trying to use it in a query like so:

Code:
qry += "AND Account__c = '{!Contact.AccountId}' AND Account__c <> null    ";

 


Any help is appreciated.
Hi All,

Have written a s-control that returns a formatted list of assets for the account associated with a case.  I have hit a problem where no results are displayed if there is only one result returned.  >1 results render fine. 


Code:
<html>

<head>
<script src="/soap/ajax/10.0/connection.js"></script>

<script>

function initPage() {
var result = sforce.connection.query("Select Id, Name, Quantity, Support_Level__c, UsageEndDate from Asset Where AccountId = '{!Case.AccountId}' and UsageEndDate > today ");
var sb = new sforce.StringBuffer();
sb.append("<b>Current Assets for {!Account.Name}</b><br>");
sb.append("<hr>");
sb.append("<center><table width=90%><tr><td>Name</td><td>Qty</td><td>Support Level</td><td>End Date</td></tr>");

while (true) {
if (result.size > 0) {
for (i = 0; i < result.records.length; i++) {
var account = result.records[i];
sb.append("<tr>"); //<td>").append(i).append("</td>");
sb.append("</td><td> ").append(account.Name);
sb.append("</td><td> ").append(account.Quantity);
sb.append("</td><td><center> ").append(account.Support_Level__c);
sb.append("</td><td> ").append(account.UsageEndDate);
sb.append("</td></tr>");
}
}
if (result.done == "true") {
break;
} else {
result = sforce.connection.queryMore(result.queryLocator);
}
}
sb.append("</table>");
document.body.innerHTML = sb.toString();
}

</script>
</head>

<body onload="initPage();">
</body>

</html>

 Any and all help is appreciated.

-Michael

ARGH!!

So using the example from the wiki as my guide:

Code:
http://wiki.apexdevnet.com/index.php/Members:PHP_Toolkit_1.1_Update_Sample_%28Enterprise%29

 
I am able to update standard fileds in cases wihtout issue.  I cannot, however get custom fields to update.

When I do a getLastRequest I cannot even see my custom fields referenced in the SOAP call.  Someone please point me in the right direction on updating custom fields through the Enterprise 1.1 api.

My code below:

Code:
require_once ('soapclient/SforceEnterpriseClient.php');
require_once ('soapclient/SforceHeaderOptions.php');

try {
  $sfc_connection = new SforceEnterpriseClient();
  $mySoapClient = $sfc_connection->createConnection("enterprise.wsdl.xml");
  $sfc_login = $sfc_connection->login("SFC_USR", "SFC_PWD");

  $userResult = $sfc_login->userInfo;
  echo $userResult->userFullName . ', your session id is ' . $sfc_login->sessionId;
    
  $sObject1             = new stdClass;
  $sObject1->Subject    = 'Test issue 1';
  $sObject1->zzTest__c  = 'text';
  $sObject1->Id         = '50020000000hl5kAAA';
 
  print_r($sObject1);
 
  $response = $sfc_connection->update(array ($sObject1), "Case");

  print_r($response);
  print_r($sfc_connection->getLastRequest());
  print_r($sfc_connection->getLastResponse());
} catch (Exception $e) {
  echo $e->faultstring;
}

 

Hi All,

I am quite sure I am doing something stupid but i cant seem to get past this error.  I am using the Enterprise SOAP client of the new 1.1 toolkit for PHP and am trying to update this object:

Array (    
    [Id] => 50020000000hl5kAAA    
    [Maint_Account__c] => 00120000002jpViAAI    
    [Maint_On_Open__c] => false    
    [Maint_Current__c] => false
)


With this code:
    $casefieldsToUpdate   = array('Id'=>$case->Id,
                                  'Maint_Account__c'=>$case->AccountId,
                                  'Maint_On_Open__c'=>$caseassetcheck,
                                  'Maint_Current__c'=>$caseassetcheck
                                  );
    
    $sObject                = new SObject();
    $sObject->fields        = $casefieldsToUpdate;
    $sObject->type          = 'Case';
    $caseupdate          = $sfc_connection->update(array ($sObject));
When I execute my script I get this error:

    Fatal error: Class 'SObject' not found in [myscript].php on line 77

 Line 77 is the "$sObject = new SObject();" line.   


I have been pulling my hair out for half a day on this so if anyone can help I would really appreciate it.

All,

I cant seem to reference Contact.AccountId as a merge field in a s-control.  When I do I get the errror:  "Field Contact.AccountId does not exist. Check spelling."

I also noticed that it isnt available from the merge field insert dropdown although I can definately see this field in Apex Explorer. 

I am basically trying to use it in a query like so:

Code:
qry += "AND Account__c = '{!Contact.AccountId}' AND Account__c <> null    ";

 


Any help is appreciated.
Hi,
 
Ours is an emterprise edition of salesforce.com. Is there any limit/restrictions on how many workflows we could set up?
 
Your response is greatly appreciated.
 
Thanks and regards,
Ambili
  • December 17, 2007
  • Like
  • 0
Hi All,

Have written a s-control that returns a formatted list of assets for the account associated with a case.  I have hit a problem where no results are displayed if there is only one result returned.  >1 results render fine. 


Code:
<html>

<head>
<script src="/soap/ajax/10.0/connection.js"></script>

<script>

function initPage() {
var result = sforce.connection.query("Select Id, Name, Quantity, Support_Level__c, UsageEndDate from Asset Where AccountId = '{!Case.AccountId}' and UsageEndDate > today ");
var sb = new sforce.StringBuffer();
sb.append("<b>Current Assets for {!Account.Name}</b><br>");
sb.append("<hr>");
sb.append("<center><table width=90%><tr><td>Name</td><td>Qty</td><td>Support Level</td><td>End Date</td></tr>");

while (true) {
if (result.size > 0) {
for (i = 0; i < result.records.length; i++) {
var account = result.records[i];
sb.append("<tr>"); //<td>").append(i).append("</td>");
sb.append("</td><td> ").append(account.Name);
sb.append("</td><td> ").append(account.Quantity);
sb.append("</td><td><center> ").append(account.Support_Level__c);
sb.append("</td><td> ").append(account.UsageEndDate);
sb.append("</td></tr>");
}
}
if (result.done == "true") {
break;
} else {
result = sforce.connection.queryMore(result.queryLocator);
}
}
sb.append("</table>");
document.body.innerHTML = sb.toString();
}

</script>
</head>

<body onload="initPage();">
</body>

</html>

 Any and all help is appreciated.

-Michael

ARGH!!

So using the example from the wiki as my guide:

Code:
http://wiki.apexdevnet.com/index.php/Members:PHP_Toolkit_1.1_Update_Sample_%28Enterprise%29

 
I am able to update standard fileds in cases wihtout issue.  I cannot, however get custom fields to update.

When I do a getLastRequest I cannot even see my custom fields referenced in the SOAP call.  Someone please point me in the right direction on updating custom fields through the Enterprise 1.1 api.

My code below:

Code:
require_once ('soapclient/SforceEnterpriseClient.php');
require_once ('soapclient/SforceHeaderOptions.php');

try {
  $sfc_connection = new SforceEnterpriseClient();
  $mySoapClient = $sfc_connection->createConnection("enterprise.wsdl.xml");
  $sfc_login = $sfc_connection->login("SFC_USR", "SFC_PWD");

  $userResult = $sfc_login->userInfo;
  echo $userResult->userFullName . ', your session id is ' . $sfc_login->sessionId;
    
  $sObject1             = new stdClass;
  $sObject1->Subject    = 'Test issue 1';
  $sObject1->zzTest__c  = 'text';
  $sObject1->Id         = '50020000000hl5kAAA';
 
  print_r($sObject1);
 
  $response = $sfc_connection->update(array ($sObject1), "Case");

  print_r($response);
  print_r($sfc_connection->getLastRequest());
  print_r($sfc_connection->getLastResponse());
} catch (Exception $e) {
  echo $e->faultstring;
}

 

Hi All,

I am quite sure I am doing something stupid but i cant seem to get past this error.  I am using the Enterprise SOAP client of the new 1.1 toolkit for PHP and am trying to update this object:

Array (    
    [Id] => 50020000000hl5kAAA    
    [Maint_Account__c] => 00120000002jpViAAI    
    [Maint_On_Open__c] => false    
    [Maint_Current__c] => false
)


With this code:
    $casefieldsToUpdate   = array('Id'=>$case->Id,
                                  'Maint_Account__c'=>$case->AccountId,
                                  'Maint_On_Open__c'=>$caseassetcheck,
                                  'Maint_Current__c'=>$caseassetcheck
                                  );
    
    $sObject                = new SObject();
    $sObject->fields        = $casefieldsToUpdate;
    $sObject->type          = 'Case';
    $caseupdate          = $sfc_connection->update(array ($sObject));
When I execute my script I get this error:

    Fatal error: Class 'SObject' not found in [myscript].php on line 77

 Line 77 is the "$sObject = new SObject();" line.   


I have been pulling my hair out for half a day on this so if anyone can help I would really appreciate it.

Just wondering about support for the new v8 API in PHP...  Is there a pre-release of the new PHP toolkit, or indeed, is Salesforce even writing one? Any timeline on it's release?

Currently we're using Person Accounts to co-ordinate our B2I records. All of our support scripts are written in PHP and I'm not overly keen on having to create a sub-set of these in JSP (or whatever).

-
Vaughan Crole


  • January 19, 2007
  • Like
  • 0