We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Code in documentation not working

Accepted answer
5
Views
5
Comments
edited Jul 18, 2018 10:38AM in Customer Portal 5 comments

Content

Using the code below, I get an error:

Message: Invalid argument supplied for foreach()

Also when I try to use:

$contact = RNCPHP\Contact::first("Login = '".$agent."'");
print_r($contact);

It prints it out but at no point can I get any values to show. Doing a var_dump shows NULL values as well

What's happening?

Version

Version info Oracle Service Cloud 18A (Build 260 SP 3, CP 322)

Code Snippet

             $contact = RNCPHP\Contact::find("Name.Last = 'Smith'");
foreach ($contacts as $contact) {
	print($contact->ID);
}
			 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!