前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >如何将SAP CRM里维护的Account图片显示到Fiori应用中

如何将SAP CRM里维护的Account图片显示到Fiori应用中

作者头像
Jerry Wang
发布2019-05-31 11:13:09
9600
发布2019-05-31 11:13:09
举报

We have to launch CRM WebUI, upload a new attachment for given account:

This attachment should meet the following criterias, to make sure it could be used as logo for the current account:

  1. it must be an image file ( type JPEG Graphic or other image format )
  2. in property maintenance window, it must be set as default document among all attachments and document type must be BDS_IMAGE.

In the runtime, when you open Fiori UI, it takes two steps to get the image rendered in UI finally. These two steps could just be observed in the Chrome network tab.

Step1 - Fiori UI asks for the image URL from backend.

Previously, I consider Fiori UI asked the binary content of image from backend, this is COMPLETELY WRONG! The complete url for the first step: https://jerry.sap.corp:4080/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AccountCollection(‘4031140’)?$expand=Logo

From url we know there is an expand operation on node Logo. Check response in Chrome, there is no image binary source contained in response.

the url contained in Logo node is used as the requested url for the second step, as could be observed in Chrome:

: The complete url returned by first step:

https://jerry.sap.corp:2030/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AttachmentCollection(documentID=‘FA163EEF573D1EE585804C8B6241ABA3’,documentClass=‘BDS_POC1’,businessPartnerID=‘4031140’)/$value

Although it contains an “Attachment” in url, it HAS NOTHING TO DO WITH the tab in Opportunity detail page! It just indicates that the technical storage of account logo is done via CRM Attachment model.

Step2 - bind the url to image field in application

Check the xml binding path for image field in Opportunity detail view: it is bound to ImgSrc in json model.

In application code, it just fills that json model field with url returned by step1:

And this operation will lead to a delayed re-render later to set the native html property “src” for image field, which is done by framework:

Conclusion: The http request sent in second step is not issued by My Opportunity application, but by browser itself, once an image element is filled with actual url on its “src” property. To simply prove this conclusion:

Create a simple html file as below, just paste the url for second step into src property:

代码语言:javascript
复制
<html>
<img src="https://jerry.sap.corp:2030/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AttachmentCollection(documentID='FA163EEF573D1EE585804C8B6241ABA3',documentClass='BDS_POC1',businessPartnerID='4031140')/$value"></img>
<html>

Open it in Chrome, and you can observe exactly the same network behavior as when you open the application with an image in Fiori ui:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年02月04日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Step1 - Fiori UI asks for the image URL from backend.
  • Step2 - bind the url to image field in application
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档