• niti_sfdc
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

How are unpopulated fields handled in the PHP/WSDL framework?

 

I'm querying all records in a custom object.  The records with unpopulated fields return:

 

PHP Notice:  Undefined property: SObject::$Project_Manager__c in /var/www/testing/test.php on line 25

 

It ends up with some records being read correctly, but others have 1 error message like the above for every field that is blank (or null).

In this case, it's not possible to check if a field (or property) is null, because the property is not "in the record"(or object) if it is null.  This is like having variant records:  If an object has 20 fields, then there are potentially 18 factorial layouts.

 

Are we supposed to check for the existence of a field property before we access the value?  This doesn't make sense when the property is specified in the query string.

 

I just verifiied that - that is exactly how it is working.  If I edit the SalesForce record and populate the field.  The error goes away, but if I delete the value after that and re-submit, the error returns.

 

This appears to be a bug - the very least is incorrect error message.  The error message should be: "NULL Value processising not supported" or something to that effect - not "Undefined Property".

 

Here are 3 records from the same object.  Note the missing fields from 52 and 54.

 

[52] => SObject Object
(
[type] =>
[fields] =>
[Name] => Stonson Plaid
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a1D3433d0008dznMAA
)

[53] => SObject Object
(
[type] =>
[fields] =>
[Account_List__c] => 27628
[Account__c] => 003434343434338VhqIAF
[Job_Location__c] => 232323
[Location__c] => a10454343430L2nEIAS
[Name] => Ring Filler
[Order_List__c] => 1
[Salesman__c] => Jonman
[Id] => a1DE00000008bCvMAI
)

[54] => SObject Object
(
[type] =>
[fields] =>
[Name] => Bill Thompson
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a3DE00000008345MAI
)