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

Updating RemoteProxy with Tooling API fails with deserialization error #72

Closed
mrichmon12 opened this issue Apr 8, 2019 · 4 comments
Closed
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@mrichmon12
Copy link

Summary

Receive an error when trying to update RemoteProxy object through force:data:record:update

Steps To Reproduce:

  1. Attempt to update a RemoteProxy through the force:data:record:update
sfdx force:data:record:update \
    --targetusername DEV \
    --sobjecttype RemoteProxy \
    --sobjectid 0rpf2000000EJMtAAO \
    --usetoolingapi \
    -v "Metadata='{\"disableProtocolSecurity\": false,\"isActive\": true,\"url\": \"https://www.example.com\",\"urls\": null,\"description\": null}'" 

Expected result

RemoteProxy is updated in the target org.

Actual result

ERROR: Cannot deserialize instance of complexvalue from null value null or request may be missing a required field.

Additional information

The Metadata format used above matches the format that is output from a query of the RemoteProxy object, and it does work fine via the Tooling API directly outside of the field-value-pair formatting change specified in the CLI reference.

Salesforce DX Trailblazer Community post

SFDX CLI Version
sfdx-cli/7.2.0-179c9078fc linux-x64 node-v10.15.3

SFDX plugin Version
@oclif/plugin-commands 1.2.2 (core)
@oclif/plugin-help 2.1.6 (core)
@oclif/plugin-not-found 1.2.2 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.2 (core)
analytics 1.1.2 (core)
generator 1.1.0 (core)
salesforcedx 45.9.1 (core)
├─ force-language-services 45.9.0 (core)
└─ salesforce-alm 45.12.0 (core)

OS and version:
Windows 10 Enterprise

@danielepiccone
Copy link

danielepiccone commented Dec 10, 2019

I am getting the same issue when trying to toggle a flow with

sfdx force:data:record:update -u sandbox -t -s FlowDefinition -i 300b000000008ohAAA -v "Metadata='{\"activeVersionNumber\": 2, \"description\": null, \"masterLabel\": null, \"urls\": null}'"

I figured out this call ends up not sending the correct payload.

Apparently the JSON is sent as a plain string instead of being properly parsed.

I managed to get it to work by patching /node_modules/salesforce-alm/dist/lib/data/dataRecordUpdateCommand.js but I cannot find the source code for this repository online to open a PR.

SFDX CLI Version
sfdx-cli/7.36.0-b1c4e9c7c8 darwin-x64 node-v10.15.3

SFDX plugin Version
no plugins

OS and version:
Darwin / OSX 10.14.6

@amphro amphro added the bug Issue or pull request that identifies or fixes a bug label Oct 31, 2020
@mshanemc mshanemc added bug Issue or pull request that identifies or fixes a bug and removed bug Issue or pull request that identifies or fixes a bug labels Dec 10, 2021
@mshanemc
Copy link
Contributor

@danielepiccone that code is OSS and lives here: https://github.com/salesforcecli/plugin-data if you would like to fix it.

@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-10290524

@iowillhoit
Copy link
Contributor

This issue has been fixed and included in today's stable release 7.138.1. Update to the latest sfdx to get these changes. Release notes can be viewed here. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

6 participants