Skip to Content
Author's profile photo Jerry Wang

Step by step to enable your custom BO with attachment upload functionality

I began to learn how to use Cloud Application Studio today and I record what I have learned into this blog regarding how to enable attachment upload functionality for my custom BO.
1. Create a new BO for example TestBO by copying the following source code in Cloud studio and activate it. Here an association to depedent object AttachmentFolder is declared.
import AP.Common.GDT as apCommonGDT;
businessobject TestBO {
[Label("Agreement ID")] [AlternativeKey] element AgreementID:ID;
		[Label("Start Date")] element StartDate:Date;
		[Label("Close Date")] element CloseDate:Date;
		[DependentObject(AttachmentFolder)] node Attachment;
2. Create all necessary UI screens via wizard by right clicking the created BO and choose “Create Screens” from context menu. Once done you should have several automatically created artifacts as displayed below.
3. Assign your business user to the created work center floorplan and after you log on the system, you should see the below OWL with only one “Export” button existing in toolbar. Without New button it is not possible for us to create some test data. As a result we have to create the New button manually.
Open the OWL in UI Designer, select the toolbar in OWL and click “Configure” button in property tab:
Select “My Button” and click the triangle to move it to the right part.
Choose “QuickCreate” as Semantic, and for OnClick property, leave it as blank.
Under Thing Type section, bind the “Associated Thing Type container” to BO ID field.
And then bind this BO ID field to the automatically created Thing Type Object.
Now you could create new BO instance by pressing the New button, and quick create UI will be displayed:
Click the hyperlink and now you can reach the Thing inspector UI.
Remove unused tab and only keep Attachments tab. Locate the document reuse UI from path listed below, drag it from Configuration Explorer and drop to the area of Attachments tab.
Click Bind button, bind Controller root node to the NodeReference Binding under Interface in the right.
Now you could create new attachment file for a given test BO instance.
Once you have created an attachment and successfully saved it, next time you open the Thing inspector UI, you can observe there is a HTTP request which fetches the attachment data from backend.
In the response, the structure fields are exactly mapped to the corresponding fields in attachment DO. 

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Navaneeth Dundhigalla
      Navaneeth Dundhigalla

      Thanks Jerry Wang,

      You wrote very good blog its is very much clear with no hidden content and step by step process.

      Author's profile photo Srihari Teja Chaluvadi
      Srihari Teja Chaluvadi

      Hi Jerry,

      I have binded the COD_Documentlist but still the Attachment Workcenter is loading blank.

      please suggest what could be the issue.




      Author's profile photo ZH C
      ZH C

      Hi Jerry,

      May I ask if we can change the default attachment type?