Skip to content
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

[show-all-data] Customise header of REST call #198

Closed
SfdxDieter opened this issue Nov 3, 2023 · 9 comments
Closed

[show-all-data] Customise header of REST call #198

SfdxDieter opened this issue Nov 3, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@SfdxDieter
Copy link

Salesforce changed default behavior of REST call if Cases are changed. If changes are done in Inspector there is not send the Sforce-Auto-Assign Value in the header of the REST-Call. So Assigement Rules are executed every time. But normaly before the assignement rules where not firered every time.
So the Inspector should send Sforce-Auto-Assign with value FALSE or be configure able to switch it on/off.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_autoassign.htm
https://help.salesforce.com/s/articleView?id=000390059&type=1

@SfdxDieter SfdxDieter added the enhancement New feature or request label Nov 3, 2023
@SfdxDieter
Copy link
Author

In inspect.js line 150 it would be
sfConn.rest(recordUrl, { method: "PATCH", body: record, headers: {"Sforce-Auto-Assign" : false} }).then(() => {

@tprouvot
Copy link
Owner

tprouvot commented Nov 3, 2023

Hi @SfdxDieter ,

Good catch 👏 !
I'll probably implement a variable in localStorage to let users define custom headers in create and update rest callout from show all data view.
I'll post updates here !

@tprouvot
Copy link
Owner

tprouvot commented Nov 3, 2023

Hi @SfdxDieter ,

You can test the header customisation by checking out this branch locally and follow this how to.

I'll test this does not bring regressions on the create updates for a while locally, if everything is good I'll merge it into releaseCandidate (next release branch).

Let me know if you need assistance !

@SfdxDieter
Copy link
Author

SfdxDieter commented Nov 3, 2023

Currently I see a lot off errors. I can see that the parameter is used. But it does not work as exspected. I will check it.
image

@tprouvot
Copy link
Owner

tprouvot commented Nov 3, 2023

@SfdxDieter
Have you disabled the extension from the chrome web store after installing the local version ?

@SfdxDieter
Copy link
Author

SfdxDieter commented Nov 6, 2023

Please change line 36 to
this.headerCallout = JSON.parse( localStorage.getItem("createUpdateRestCalloutHeaders") ? localStorage.getItem("createUpdateRestCalloutHeaders") : "{}");
then it works. (I can't push to git)

I get 2 kind of errors in the plugin (I removed all other plugins)
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of AllDataSelection. See https://fb.me/react-warning-keys for more information. in div (created by AllDataSelection) in AllDataSelection (created by AllDataBoxSObject) in div (created by AllDataBoxSObject) in AllDataBoxSObject (created by AllDataBox) in div (created by AllDataBox) in AllDataBox (created by App) in div (created by App) in div (created by App) in App
and
Uncaught SyntaxError: Unexpected token 'export'

@SfdxDieter
Copy link
Author

When using npm run chrome-dev-build the manifest.json is changed. The links.js is added
image

if I remove after the build the links.js again and upload it to chrome the token export error does not appear

@tprouvot tprouvot changed the title Sforce-Auto-Assign in Header of REST [show-all-data] Customise header of REST call Dec 28, 2023
@tprouvot
Copy link
Owner

tprouvot commented Jan 5, 2024

Adding a new option to set the custom header
image

@tprouvot
Copy link
Owner

tprouvot commented Jan 5, 2024

Will be available in beta version probably next week

@tprouvot tprouvot closed this as completed Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants