SalesforceQuerySet update is failing
See original GitHub issueI’m trying to use the SalesforceQueryset.update
method to set a Picklist value and I’m getting a TypeError, stating that what should be a str
is in fact a Query
…
...
account_queryset.update(status=new_status)
...
TypeError at /bulk/
must be str, not Query
Request Method: | POST
these are the variables values when invoking salesforce.backend.query.CursorWrapper.execute_update
headers | {'Content-Type': 'application/json'}
pk | <django.db.models.sql.query.Query object at 0x7f10347774a8>
post_data | {'Status__c': 'NEW_STATUS'}
query | <django.db.models.sql.subqueries.UpdateQuery object at 0x7f103a63da20>
self | <salesforce.backend.query.CursorWrapper object at 0x7f1034777128>
table | 'Account'
and this is what gets through to the rest_api_url
method itself
args | ('Account', <django.db.models.sql.query.Query object at 0x7f10347774a8>)
service | 'sobjects'
sf_session | <requests.sessions.Session object at 0x7f1034844d30>
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Update failed error - Salesforce Developer Community
When I try to modify a field in an object I get this error(which is actually in a trigger). Update failed. First exception...
Read more >Database.update is not working as expected
1 Answer 1 · According to the docs a QueryException is thrown after 10 seconds when an exclusive lock cannot be obtained. ·...
Read more >Salesforce Connector OAuth JWT - {"error":"invalid_grant ...
CAUSE. This is usually caused by an invalid Audience Url value specified in Salesforce Connector config. SOLUTION. To solve this, please try ...
Read more >Update using OpenQuery and Salesforce driver hangs with ...
Run Update OpenQuery(LinkserverName,Query) set Fieldname = value where "TextFieldName" = <value> Observed Results: The query hangs and never ...
Read more >Salesforce: Scheduled SOQL Recipe won't Trigger When ...
I have a new recipe with a scheduled SOQL Query, set to trigger hourly. Whenever I click Test, the recipe says there is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I should note, that you don’t need the filter condition
is_deleted=False
with a normal query set. The “trash bin” can be searched only afterquery_all()
method.@hynekcer just to be completely clear: my custom managers on
SalesforceModel
models are actually subclasses ofSalesforceManager
.this is my actual code there:
and then on the objects (e.g: Account)