Comments (5)
Some things to note first:
- You do not need to include
use ... SOQLBuilder;
- this is already part of the model. - You should not need to include
use App\SalesforceModels...
when used in a model that already exists there. - Your opportunity model is referencing
Opportunity__c
- assuming you are trying to access the standard SFDC Opportunity table, you do not need to use__c
and thats probably why you're getting the "resource not found error"
from eloquentsalesforce.
@roblesterjr04 1 and 2 I'll remove the extra code
3. Opportunity__c
is the correct model. It is a custom table not the standard table
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 $columns
variable. but it does not work using belongsTo
belongsToMany
from eloquentsalesforce.
Thats really weird, i use relationships all over the place in my own use, haven't experienced this.
from eloquentsalesforce.
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 AccountId
is the column on AccountTeamMember
that references the Id
on the Account
object.
This is standard Eloquent relationship practice if the column IDs can't be assumed by the framework, which rarely works on Salesforce tables.
from eloquentsalesforce.
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 $columns
array.
from eloquentsalesforce.
Related Issues (20)
- Issue implement in Laravel 10 HOT 1
- prepare() on null when massive update HOT 2
- Date Columns Auto-Inclusion Issue in EloquentSalesForce 2.15 - 'No Such Column 'CreatedDate' on Entity HOT 4
- Sync Existing Records to Local Salesforce Table? HOT 5
- pull token from DB and use it HOT 1
- doing Local Sync is there away to name the local Table HOT 1
- Issue with onlyTrashed method and the resulting query parameters HOT 6
- Eloquent cursor method not jiving with the onlyTrashed and withTrashed method calls
- "whereHas" feature HOT 2
- Please add Laravel 9 support HOT 8
- Can't implement "webserver" connection from within an Iframe
- Updating a record throws an exception HOT 4
- How to create shift
- List alternative packages in the documentation
- Errors when running Model::save() in a scheduled job Omniphx\Forrest\Exceptions\MissingVersionException and Illuminate\Contracts\Encryption\DecryptException The payload is invalid. HOT 1
- Support Laravel 10 HOT 2
- Bug when concatenating timestamp fields HOT 1
- Problem with (unescaped) single quotes in query HOT 5
- How can I contribute? Contribution guide does not exist (404) HOT 1
- How to set the "Sforce-Auto-Assign" header. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquentsalesforce.