• Lawrence-CEC
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 17
    Replies
Does any one know how to access the Account.ParentId Value?  I keep getting an error with the code below but I can access the FirstName value fine.
 
Thanks!
 
$strSQL = "SELECT FirstName, LastName, Account.ParentId FROM Contact WHERE Memberships__c INCLUDES ('Fixed Income Directory') ";
$response = $mySforceConnection->query($strSQL);
$queryResult = new QueryResult($response);
foreach ($queryResult->records as $record) {
 
 
 echo $record->fields->FirstName;
 echo $record->Account->fields->ParentId;

}
  • January 13, 2009
  • Like
  • 0

We are working on migrating our business unit's data into a new org and have found that the data reported in the 'HTML Email Status Report' (on the Contacts page) isn't coming over. We've tracked down the source of the data and it appears to be stored in an 'EmailStatus' object (for example the '# Times Opened' column on that report is apparently stored in EmailStatus.TimesOpened field).

 

However, we haven't been able to figure out how to migrate this data/object. There is a reference to it in the web services API documentation, but there is no 'query()' function available for it -- only a few of the 'describe..()' functions. (We tried doing a query anyway and we do get an error.) This object is also not listed in Eclipse or in the data loader.

 

Is there any way to get this data migrated? Or will our staff just lose this information?

 

Thanks,

 

---Lawrence

 

Does anyone have a checklist of all the things you need to look for when copying an org to a new instance?

 

We are in the process of copying an existing org to a new org and unfortunately SFDC doesn't have a simple "copy org" function that goes from production org to production org like it does from production to sandbox. So we are having to do it manually, but we are finding that doing so is a *huge* mess as only certain things are available through the force.com IDE and exactly where you need to go to copy over a certain bit of functionality is not always obvious. (For example: field level security doesn't appear to come over and must be reconfigured manually; picklist values on custom objects and custom fields on standard objects *do* come over through the IDE, but custom values on standard fields for standard objects *do not*.)

 

So, does anyone have a checklist for all the things you need to account for during a migration like this? I.e. objects, triggers, email templates, customized picklist values, personal reports, etc. An indication of what can be copied over via the force.com IDE, the data loader, and what needs to be done manually would be a huge help too.

 

We think we have most of the items covered, but want to make sure we aren't missing some small bit that's important.

 

Thanks,

 

---Lawrence

 

I'm new to visualforce/apex so there's probably something fundamental I'm not getting about how VF pages work, but how do I access XML data from within a visualforce page? More specifically, how do I use XML data to generate tables and other elements on a page?

 

For example, I'm trying to query a remote site for a given person using an id stored in the salesforce database, this remote site returns XML data about this person, including activities this person performed on the remote site -- i.e.:

 

<xml...>
<Person>
<Id>123</Id>
<Name>John Doe</Name>
<Email>jdoe@example.com</Email>
<Activities>
<Activity>
<Title>Ate a pie</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/pie</Url>
</Activity>
<Activity>
<Title>Baked a cake</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/cake</Url>
</Activity>
</Activities>
</Person>

 

 I can load this fine in Apex and parse it with XMLDom, then access the various fields using getElementsByTagName(), getValue(), etc. But how do I display this data on a visualforce page? I've tried saving the 'Person' XMLDom.Element node as a property in a controller class, but can't seem to access any of the sub-elements... i.e.:

 

public class MyActivities {

public XMLDom.Element person { get; set; }

public MyActivities(...) {
String xml = GetRemoteXML();
String dom = new XMLDom(xml);

person = dom.getElementByName('Person');
}
}

 

Using:

 

<b>{!person}</b>

 

 Gets me ... "core.apexpages.el.adapters.ApexObjectValueELAdapter@226dc1" (displayed in the VF page) ... which I assume points to the XMLDom.Element object. (I don't get an error at least...)

 

 But if I try to do any of the following, I get errors:

 

<b>{!person.name}</b>

<b>{!person.Name}</b>
<b>{!person['name']}</b>
<b>{!person.getValue('name')}</b>
<b>{!person.attributes.name}</b>
<b>{!person.attributes['name']}</b>

 

 

I've also tried mapping the XML data to a Map<String,String> property in my controller class:

public Map<String,String> person_map { get; set;}

...

person_map.put('name', dom.getValue('Name'));

 

But again, in visualforce, I can't figure out how to traverse *into* the map (i.e. {!person_map.Name}, {!person_map['Name']}, {!person_map.get('Name')}, etc.)

 

Eventually I'd really like to be able to do an <apex: pageBlockTable> around the Activity entries, but if I can't even get to the Name entry, I'm not sure how I would get to something lower down in the XML structure.

 

 

I've looked around for examples like this... for examples on using XML data to populate a page and on accessing Maps and other compound elements but didn't find anything helpful.

 

Everything seems to be based on specific sObjects (Leads, Accounts, Some_Custom_Object__c, etc.) or on scalar controller class properties. Obviously, I don't want to go in and create a whole new '__c' custom object in salesforce just to map and hold this XML data.... I just want to read it from the remote site and display it, I don't need to store it in salesforce.

 

Have I missed the examples on how to do this?

 

Thanks,

 

---Lawrence

 

 

 

Any thoughts on how to handle UTF-8/Unicode characters in email addresses in Salesforce? That seems to be the one field (or one of the few fields) that doesn't allow UTF-8. I know international email addresses are still experimental but with the recent approval of international domain names (IDNs), it seems inevitable.

 

For now, we're thinking of just converting them to Punycode to get them down to the ascii character set and we can always convert them back to utf-8 if/when salesforce allows that.

 

This is primarily for Leads that are automatically pushed into Salesforce from the registration scripts on our external site. We're adding international support, so we're exploring what is needed to support users from other countries (non-english names, addresses, etc.).

 

And while we could restrict email addresses to ascii characters only, it seems a shame to have to limit our capabilities and our user base on the front end, just because Salesforce can't handle IDN email addresses (or, alternatively, to not push those registrations into Salesforce as Leads).

 

(I realize this could cause problems if people try to send email to these folks from within Salesforce, though.)

 

Thoughts?

 

---Lawrence

 

Any thoughts on how to handle UTF-8/Unicode characters in email addresses in Salesforce? That seems to be the one field (or one of the few fields) that doesn't allow UTF-8. I know international email addresses are still experimental but with the recent approval of international domain names (IDNs), it seems inevitable.

 

For now, we're thinking of just converting them to Punycode to get them down to the ascii character set and we can always convert them back to utf-8 if/when salesforce allows that.

 

This is primarily for Leads that are automatically pushed into Salesforce from the registration scripts on our external site. We're adding international support, so we're exploring what is needed to support users from other countries (non-english names, addresses, etc.).

 

And while we could restrict email addresses to ascii characters only, it seems a shame to have to limit our capabilities and our user base on the front end, just because Salesforce can't handle IDN email addresses (or, alternatively, to not push those registrations into Salesforce as Leads).

 

(I realize this could cause problems if people try to send email to these folks from within Salesforce, though.)

 

Thoughts?

 

---Lawrence

 

Does anyone have a checklist of all the things you need to look for when copying an org to a new instance?

 

We are in the process of copying an existing org to a new org and unfortunately SFDC doesn't have a simple "copy org" function that goes from production org to production org like it does from production to sandbox. So we are having to do it manually, but we are finding that doing so is a *huge* mess as only certain things are available through the force.com IDE and exactly where you need to go to copy over a certain bit of functionality is not always obvious. (For example: field level security doesn't appear to come over and must be reconfigured manually; picklist values on custom objects and custom fields on standard objects *do* come over through the IDE, but custom values on standard fields for standard objects *do not*.)

 

So, does anyone have a checklist for all the things you need to account for during a migration like this? I.e. objects, triggers, email templates, customized picklist values, personal reports, etc. An indication of what can be copied over via the force.com IDE, the data loader, and what needs to be done manually would be a huge help too.

 

We think we have most of the items covered, but want to make sure we aren't missing some small bit that's important.

 

Thanks,

 

---Lawrence

 

I have a reference to the Home Page layout itself in my manifest, but the resulting .profile file does not include the Home Page layout assignment.

 

I'm using the latest 18.0 version.

 

-Gino

I'm new to visualforce/apex so there's probably something fundamental I'm not getting about how VF pages work, but how do I access XML data from within a visualforce page? More specifically, how do I use XML data to generate tables and other elements on a page?

 

For example, I'm trying to query a remote site for a given person using an id stored in the salesforce database, this remote site returns XML data about this person, including activities this person performed on the remote site -- i.e.:

 

<xml...>
<Person>
<Id>123</Id>
<Name>John Doe</Name>
<Email>jdoe@example.com</Email>
<Activities>
<Activity>
<Title>Ate a pie</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/pie</Url>
</Activity>
<Activity>
<Title>Baked a cake</Title>
<Date>2010-01-20 14:26:12 -05:00</Date>
<Url>http://www.example.com/cake</Url>
</Activity>
</Activities>
</Person>

 

 I can load this fine in Apex and parse it with XMLDom, then access the various fields using getElementsByTagName(), getValue(), etc. But how do I display this data on a visualforce page? I've tried saving the 'Person' XMLDom.Element node as a property in a controller class, but can't seem to access any of the sub-elements... i.e.:

 

public class MyActivities {

public XMLDom.Element person { get; set; }

public MyActivities(...) {
String xml = GetRemoteXML();
String dom = new XMLDom(xml);

person = dom.getElementByName('Person');
}
}

 

Using:

 

<b>{!person}</b>

 

 Gets me ... "core.apexpages.el.adapters.ApexObjectValueELAdapter@226dc1" (displayed in the VF page) ... which I assume points to the XMLDom.Element object. (I don't get an error at least...)

 

 But if I try to do any of the following, I get errors:

 

<b>{!person.name}</b>

<b>{!person.Name}</b>
<b>{!person['name']}</b>
<b>{!person.getValue('name')}</b>
<b>{!person.attributes.name}</b>
<b>{!person.attributes['name']}</b>

 

 

I've also tried mapping the XML data to a Map<String,String> property in my controller class:

public Map<String,String> person_map { get; set;}

...

person_map.put('name', dom.getValue('Name'));

 

But again, in visualforce, I can't figure out how to traverse *into* the map (i.e. {!person_map.Name}, {!person_map['Name']}, {!person_map.get('Name')}, etc.)

 

Eventually I'd really like to be able to do an <apex: pageBlockTable> around the Activity entries, but if I can't even get to the Name entry, I'm not sure how I would get to something lower down in the XML structure.

 

 

I've looked around for examples like this... for examples on using XML data to populate a page and on accessing Maps and other compound elements but didn't find anything helpful.

 

Everything seems to be based on specific sObjects (Leads, Accounts, Some_Custom_Object__c, etc.) or on scalar controller class properties. Obviously, I don't want to go in and create a whole new '__c' custom object in salesforce just to map and hold this XML data.... I just want to read it from the remote site and display it, I don't need to store it in salesforce.

 

Have I missed the examples on how to do this?

 

Thanks,

 

---Lawrence

 

 

 

I am making basic calls via soap but getting http 500 - timeout.Is anyone experiencing it? 
 
<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope
/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
><soap:Header><sh:QueryOptions xmlns:sh="SoapService" soap:mustUnderstand="0"><sh:batchSize xmlns:sh
="urn:enterprise.soap.sforce.com">200</sh:batchSize></sh:QueryOptions><sh:SessionHeader xmlns:sh="urn
:enterprise.soap.sforce.com"><sh:sessionId xsi:type="xsd:string">00D300000000NRG!ARgAQFTiQnwOlKGx.LBOA5KcYZpk8s1meB3_QFDiIHbekuI
.oOR9XpCTelPEULbDUcY08q_hzBAJu8rawGs5y5heELgCnHV3</sh:sessionId></sh:SessionHeader></soap:Header><soap
:Body><query xmlns="urn:enterprise.soap.sforce.com"><queryString xmlns="" xmlns:sh="urn:enterprise.soap
.sforce.com">Select t.Subject ,t.Status ,t.CreatedDate ,t.ActivityDate ,t.Id ,t.AccountId ,t.OwnerId
from Task t</queryString></query></soap:Body></soap:Envelope>

Hi,

I am trying to use HMACSHA256 algorithm to sign my key in order to invoke a remote REST webservice. I found that SF only supports HMACSHA1 encoding..Anyone knows any work around on that...

Any help on it will be appreciated..

 

 

Thanks

I'm using the PHP developer toolkit 13.0 Enterprise Edition trying to update a Contact to set the Email Opt Out. My code is as follows:

 

$objToUpdate = array();

foreach ($response->records as $record) 

{

$updObject = new stdclass();

        $updObject->HasOptedOutOfEmail = "0";

        $updObject->Id = strval($record->Id);

$objToUpdate[$updObject->Id] = $updObject;

}

foreach($objToUpdate as $toupdate)

{

print_r($toupdate->Id."<BR>");

print_r($toupdate->HasOptedOutOfEmail."<BR>");

}

$response = $mySforceConnection->update($objToUpdate, "Contact");

 

I get the "INVALID_TYPE: Must send a concrete entity type" exception on this. I took out the setting of the "HasOptedOutOfEmail" from the code so that the only thing that would be in the object would be the Id and that still failed.

 

In my WSDL I have tried both of the following SOAP Endpoints and both produce the same result.

            <soap:address location="https://www.salesforce.com/services/Soap/c/15.0"/>

            <soap:address location="https://na3-api.salesforce.com/services/Soap/c/15.0/"/>

 

 

I feel like I'm missing something obvious. What is it? 

 

Many thanks!

 

rjsjr 

  • February 27, 2009
  • Like
  • 0

Hi,

 

I am having  problem with a web to lead form not capturing leads in the system.  If I just simply generate the code from the web-to-lead generator it works with no problem, however when using an existing form and addeing the input type="hidden" name="sfga" value="OID",  it goes not seem to work.  I got this straight from the help section (Setting Up Lead Tracking - https://na1.salesforce.com/help/doc/user_ed.jsp?section=help&target=adwords_lead_conversion_tracking.htm&loc=help&hash=TestSetup-title)

 

Any help will be great on this.  Thank you.

 

Below is a snippet of what has been added.

 

<form onSubmit="saveHarvestPoints();chkfrm(this);" name="frm" method="post" action="/common/php/autodemo.php"> <input type="hidden" name="sfga" value="00D30000000XXXXX (the actualy org ID)"/> <input type="hidden" name="postpage" value="cpm_autodemo_request">

 

Ever since relationship fields came out, I've always had a hard time getting values from them in a SOQL query.  I've been able to write a reliable function to retrieve values for fields on the main object or in a relationship one level deep, but my function falls down (does not scale) when looking relationships further away. 

 

For example, the query select id, status, lead.company, contact.account.name from CampaignMember limit 5, I am able to grab Status off CampaignMember and Lead.Company, but my function has trouble getting contact.account.name.

 

Bottom line is that I wanted to ask the community if they've written a "get a value from an sObject" function that is capable of hanlding relationship fields no matter how many objects away they are.

 

 

  • February 23, 2009
  • Like
  • 0

Hello,

 

I am attempting to use the LeadConvert command and getting errors.

 

We are using the scripts SforceBaseClient.php, SforceHeaderOptions.php and SforcePartnerClient.php scripts, and I downloaded the partner wsdl file with the LeadConvert definition.

 

However, when making the call, I am getting an error:

 

Uncaught SoapFault exception: [soapenv:Client] '' is not valid for type xsd:boolean, should be '0', '1', 'true' or 'false'

 

The code looks like this:

 

        $leadConvert = new LeadConvert(
            $aId,
            $cId,
            $convertedStatus,
            $doNotCreateOpportunity,
            $leadId,
            $opportunityName,
            null,
            null,
            false
        );

        $result = $mySforceConnection->convertLead(array($leadConvert));
 

 

Am I missing something here?  Any thoughts.

 

Thank you 

 

 

Does any one know how to access the Account.ParentId Value?  I keep getting an error with the code below but I can access the FirstName value fine.
 
Thanks!
 
$strSQL = "SELECT FirstName, LastName, Account.ParentId FROM Contact WHERE Memberships__c INCLUDES ('Fixed Income Directory') ";
$response = $mySforceConnection->query($strSQL);
$queryResult = new QueryResult($response);
foreach ($queryResult->records as $record) {
 
 
 echo $record->fields->FirstName;
 echo $record->Account->fields->ParentId;

}
  • January 13, 2009
  • Like
  • 0
Hello,

I use salesforce Perl API and I can execute queries on
most saleforce tables (72 of them). However, there are 8
tables which I cannot query at all. These tables are: Name,
NoteAndAttachment, EmailStatus, OpenActivity,AdditionalNumber,
ProcessInstanceHistory, Approval and ActivityHistory.

When these same tables are queried with Perl API the following error
is generated:

INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting
  • December 11, 2007
  • Like
  • 0