天天看點

微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

Wechat development series 1 – setup your development environment

Wechat development series 2 – development Q&A service using nodejs

Wechat development series 3 – Trigger C4C Account creation in Wechat app

Wechat development series 4 – Send C4C Data change notification to Wechat app

Wechat development series 5 – embedded your UI5 application to Wechat app

Wechat development series 6 – Retrieve Wechat User info via oAuth2 and display it in UI5 application

Wechat development series 7 – use Redis to store Wechat conversation history

Wechat development series 8 – Map integration

Wechat development series 9 – Create C4C Social Media Message and Service within Wechat app

Wechat development series 10 – Use Wechat app to receive Service Request reply made from C4C

In previous blog when a Wechat user subscribes the subscription Wechat account, a new individual customer is automatically created in C4C system.

微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

So technically Wechat is the source(sender) of dataflow and our C4C system is the dataflow target ( receiver ), and the nodejs server acts as a middleware.

In this blog, let’s try the other way around: suppose any one has made changes on this automatically created account in C4C system, the corresponding Wechat user will receive a notification in his/her Wechat app. Such notification is sent by C4C and Wechat app is the receiver.

Implementation detail

(1) Since in the third blog of this series, I use the standard field “LastName” of Customer BO to store the Wechat ID of the user who has performed the subscription,

微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

Test this OData Service via url:

https:///sap/c4c/odata/cust/v1/zindividualcustomer/CustomerCommonCollection?$filter=ParentObjectID%20eq%20%2700163E20C9511EE7B8975BD4AB3F60C0%27

Make sure it can return the correct value of three fields as expected:

微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

(3) Once the account is changed in C4C, a notification should be sent from C4C to our nodejs server. This automatic notification mechanism could be achieved via C4C OData event notification. See another of my blog Leverage C4C Odata notification to monitor C4C Opportunity change in CRM system for detail.

The setting below means whenever a change on Customer BO occurs in C4C, a change notification will be sent to the endpoint automatically:

https://wechatjerry.herokuapp.com/c4c So far all development / configuration in C4C side is done.
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

{“businessObject”:”CUSTOMER”,”businessObjectId”:”00163E20C9511EE7B8975BD4AB3F60C0″,”event”:””,”odataServiceEndpoint”:”https://<your tenant>/sap/byd/odata/v1/zindividualcustomer/CustomerCommonCollection(‘00163E20C9511EE7B8975BD4AB3F60C0’)”}
      
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

Final achievement

As soon as I subscribe the test Wechat account by scanning QRCode, a new account 1000443 is created in C4C system.

微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement
微信開發系列之四 - 将SAP C4C的資料更改通知發送到微信公衆号上Final achievement

繼續閱讀