我正在使用 SFDC 连接器使用 oauth 用户名和密码将记录更新到 Salesforce 中的对象。我为此操作使用外部 ID(比如 ext_Id__c)。将对象名称视为顺序。有一个字段说'merchant__c',它是一个引用帐户ID的关系字段(它有一个外部字段acc_ext_Id__c)。
现在我的要求是使用 acc_ext_Id__c 值更新 Mercer__c 字段。我需要使用 Mule Salesforce 连接器。
我尝试了工作台休息资源管理器,使用以下请求我能够更新记录
{
"merchant__r": {"acc_ext_Id__c" : "test"}
}
我尝试使用 dataweave 创建相同的
%dw 2.0
output application/java
---
[{
"merchant__r": {"acc_ext_Id__c" : "test"}
}]
但它抛出了一个错误
com.sforce.soap.partner.fault.InvalidSObjectFault: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_265]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_265]
at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_265]
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:721) ~[force-wsc-50.0.0.jar:?]
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:593) ~[force-wsc-50.0.0.jar:?]
at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:250) ~[force-wsc-50.0.0.jar:?]
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:224) ~[force-wsc-50.0.0.jar:?]
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:163) ~[force-wsc-50.0.0.jar:?]
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:108) ~[force-wsc-50.0.0.jar:?]
at com.sforce.soap.partner.PartnerConnection.update(PartnerConnection.java:865) ~[force-partner-api-50.0.0.jar:?]
at org.mule.extension.salesforce.internal.service.CoreServiceImpl.lambda$update$2(CoreServiceImpl.java:154) ~[mule-salesforce-connector-10.7.0-mule-plugin.jar:?]
at org.mule.extension.salesforce.internal.connection.ForceWSCConnection.executeOverPartnerClient(ForceWSCConnection.java:264) ~[mule-salesforce-connector-10.7.0-mule-plugin.jar:?]
at org.mule.extension.salesforce.internal.service.ForceWSCService.executeOverPartnerClient(ForceWSCService.java:24) ~[mule-salesforce-connector-10.7.0-mule-plugin.jar:?]
at org.mule.extension.salesforce.internal.service.CoreServiceImpl.update(CoreServiceImpl.java:154) ~[mule-salesforce-connector-10.7.0-mule-plugin.jar:?]
at org.mule.extension.salesforce.internal.operation.core.UpdateOperation.update(UpdateOperation.java:56) ~[mule-salesforce-connector-10.7.0-mule-plugin.jar:?]
at org.mule.extension.salesforce.internal.operation.core.UpdateOperation$update$MethodComponentExecutor.execute(Unknown Source) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.execution.GeneratedMethodComponentExecutor.execute(GeneratedMethodComponentExecutor.java:97) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.execution.CompletableMethodOperationExecutor.doExecute(CompletableMethodOperationExecutor.java:29) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.execution.AbstractCompletableMethodOperationExecutor.execute(AbstractCompletableMethodOperationExecutor.java:63) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeCommand(DefaultExecutionMediator.java:211) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithInterceptors(DefaultExecutionMediator.java:194) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$execute$1(DefaultExecutionMediator.java:113) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$new$0(DefaultExecutionMediator.java:61) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.execute(DefaultExecutionMediator.java:112) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.executeOperation(ComponentMessageProcessor.java:563) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.OAuthOperationMessageProcessor.executeOperation(OAuthOperationMessageProcessor.java:58) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.prepareAndExecuteOperation(ComponentMessageProcessor.java:765) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.lambda$onEventSynchronous$19(ComponentMessageProcessor.java:465) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.onEventSynchronous(ComponentMessageProcessor.java:472) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.lambda$null$9(ComponentMessageProcessor.java:380) ~[mule-module-extensions-support-4.3.0-20210119.jar:4.3.0-20210119]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:482) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:287) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:496) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$2.onNext(AbstractMessageProcessorChain.java:430) [mule-core-4.3.0-20210119.jar:4.3.0-20210119]
at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$2.onNext(AbstractMessageProcessorChain.java:425) [mule-core-4.3.0-20210119.jar:4.3.0-20210119]
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:127) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:204) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:345) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.publisher.FluxSubscribeOnValue$ScheduledScalar.run(FluxSubscribeOnValue.java:178) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:50) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:27) [reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]
at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111) [mule-service-scheduler-1.3.2/:?]
at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54) [mule-service-scheduler-1.3.2/:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
ERROR 2021-03-24 21:45:14,082 [[MuleRuntime].uber.20: [test].testFlow.BLOCKING @407540e] [processor: ; event: 193ef9f1-8cbc-11eb-a48f-8c04ba3265ac] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler:
如何将请求发送到 SFDC 以使其正确更新?