-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing SOQL relationship query with eloquent #34
Comments
Some things to note first:
|
@roblesterjr04 1 and 2 I'll remove the extra code I'm wondering how to access the relations. It works with an SOQL query and it works by using dot notation and nested selects inside the |
Thats really weird, i use relationships all over the place in my own use, haven't experienced this. |
My guess is you probably need to add the foreign keys to the relationships, and make sure any associated foreign/primary keys are included in your column selections. For example, here's a model I used. I had to specify which column i was using as the foreign key. <?php
namespace App\SalesForce;
use Lester\EloquentSalesForce\Model;
class AccountTeamMember extends Model
{
public function account()
{
return $this->belongsTo(Account::class, 'AccountId');
}
} Where This is standard Eloquent relationship practice if the column IDs can't be assumed by the framework, which rarely works on Salesforce tables. |
Oh I see whats happening now - you're specifying columns, and when you do that, you're basically causing the relationship columns not to be selected, and they are needed. Make sure you are adding those relationship ID columns to the |
I can get the relationships using the model's
columns
array using dot notation and nested selects. But I have not been able to refactor to using eloquent relationsThe following works
Mandate::first();
with the supporting code...
My attempt to use relations does not. Could you point out what I'm doing wrong here?
Omniphx\Forrest\Exceptions\SalesforceException [ { "errorCode": "NOT_FOUND", "message": "The requested resource does not exist" } ]
supporting code below
The text was updated successfully, but these errors were encountered: