Support > Implementation Guide
Document Builder
Document Builder

The CoreTRM comes with some default document that can be used. The main default document is Invoice. However, you are able to build custom document in Word or PDF format.

To access document builder go to System Admin and then to the Document Builder tab.

Creating a new document

It is common that there are a fair amount of document that are used by the trading company. Most of the document should be able to produce by the system since most of the trade data are inside the system.

Lets take an example of creating a new Trade Recap document. The Trade Recap will appear like below:

Implementation Document Builder Trade Recap

To start creating a document, in document view:

Implementation Document Builder Document List

  1. Navigate to System Admin then Document Builder.
  2. From the Document view, click on Panel New Button to create a new line.
  3. In Document Name, enter the name of the document. In our example, enter "Trade Recap".
  4. In Document Id, enter the unique id of the document. In our example, enter "trade-recap".
  5. In Document Group Name, select the applicable Document Group Name. The group can be created by the user. Go to Document Builders -> Document Groups to create new group. In our example, select "Transaction Docs".
  6. In Sort Order Num, enter the sort order number. This can be used to determine the sort order in which the document appear.
  7. In Orientation, select the orientation of the document. This can be either "Portrait" or "Landscape". In our example, select "Portrait".
  8. In Size, select the size of the document. This can be either "A4", "Letter" or "Legal". In our example, select "A4".
  9. In Font, select the font to be used in the document. This can be either "Arial Nova", "Courier", "Helvetica", "Roboto" or "Times-Roman". In our example, select "Arial Nova".
  10. In Output Type, select the output type of the document. This can be either "Word" or "PDF". In our example, select "Word".
  11. In Document Type,select applicable document type. In our example, this will be blank.
  12. In Booking Entity, select applicable booking entity. In our example, select "Singapore Trading Company".
  13. In Counterparty, select applicable counterparty. Counterparty is use for specific document such as LOI. Depending on counterparty, different LOI can be created. In our example, this will be blank.
  14. In Default?, tick the box if this document is use as default.
  15. In Active, tick the box if this document is active.
  16. Next, click on Save Button in to confirm the creation.
  17. To edit item document details after creation, Click Edit Button to edit.

To continue creating a document, in document view:

  1. Click on the document name to be redirected to the document details view.
  2. From the Sections, click on Add First Section Button and select "Document Root" to add a new section. All documents will have to start with "Document Root".
  3. From the section details on the right, enter a name for the section. In our example, enter "Trade Recap".
  4. From the section details on the right, select the starting object from where the document should retrieve the data. In our example, select "Contract".
  5. From the section details on the right, select enter any criteria relating to this section. Typically, for Document Root, we will need to link the parameter from screen select to object here. In this example, we are expecting the user to select a contract from the screen and then print the "Trade Recap". So we will be linking the contractseqnum from screen to the object in the section using {param}. The code to use is:
  6. contractseqnum.eq.{param:dataobjectuniquekeyseqnum}
  7. Next, below the new "Document Root: Trade Recap" , click on Panel New Button to add new section.
  8. Typically, in a document, you can use different type of section to layout how the data will be displayed in the document. Each type has some specific properties in the section details. The main section type are Stack Container, Column Container, Table, Image, Single Item Value, Static Text, Horizontal Line, Footer and Header.

    Stack Container: Allows you to stack the data inside the container.

    Column Container: Allows you to divide the document layout into columns. Typically, in 1,2,3 or 4 columns format. As a result, you can place the data in a structure manner.

    Table: Allows you to display multiple rows of table when the results has more than 1 row.

    Image: Allows you to display image in the document.

    Single Item Value: Allows you to display a single value in the document.

    Static Text: Allows you to display a single value in the document.

    Horizontal Line: Allows you to display a horizontal line in the document.

    Footer: Allows you to display data in the footer section of the document.

    Header: Allows you to display data in the Header section of the document.

  9. In our example, we will use a column container to create the Logo (on the left) and Company Name and Address (on the right).
  10. Next, in the Section Title of the Column Container, you can include a title to identify this section. In our example, enter "Booking Entity Header".
  11. Implementation Document Builder Trade Recap Booking Entity Header

  12. Next, click on the Panel New Button under the Column Container, to add new section. In our example, we can use a Stack Container and enter section title as "Left".
  13. Implementation Document Builder Trade Recap Left Section

  14. In the Stack Container: Left section details, we can set more properties of the container. In our example, we can set the width of the container to be fixed at 300.
  15. Implementation Document Builder Trade Recap Left Section Details

  16. Next, under the Stack Container: Left, we can include the logo. In our example, we will select "Image" as a new section. We can enter Section Title as "Booking Entity Logo".
  17. Implementation Document Builder Trade Recap Image Section

  18. In the Image:Booking Entity Logo section details, we can set more properties for the section. In our example, since we are displaying the logo. We use:
  19. Object Name: Attachment

    Parent Section: Trade Recap[11729]. This is to link the attachment object to the Trade Recap Document Root so that when the contract is selected, we will be able to get the booking entity from the contract.

    Section criteria: will be the code below. The criteria will link the dataobjectseqnum to 420 which is created when a logo image is attached to booking entity. Then also having the criteria that the file usage type is "EL"(Booking Entity Logo) and that the attachment is active.

    dataobjectseqnum.eq.420.and.dataobjectuniquekeyseqnum.eq.{11729:contract.core_settlement_bookingentity.bookingentityseqnum}.and.fileusagetypecode.eq.EL.and.activeind.eq.true

    Booking Entity Logo Attachment can be found in Reference Data-> Accounting-> Booking Entities-> Attachment Tab.

    Implementation Document Builder Booking Entity Logo Attachment

    Column Item Ref: as per the code below. A function fnGetFileAsDataUrl will have to be used to get the URL of the attachment and render the image back to the document.

    fnGetFileAsDataUrl(i:filestoreguid,i:filetypecode)

    In our example, we will also set the width and height of the image as Width:230 and Height:110 and Aligment:Left.

    Implementation Document Builder Trade Recap Image Section Details

  20. Next, we will create the right section for the Company Name and Address.
  21. Click on Panel New Button in the lower part of the Column Container to add a new section. In our example, select Stack Container and enter the section title as "Right". Notice that because we are using Column Container section earlier, the system will place the Stack Container next to Stack Container:Left.
  22. Implementation Document Builder Trade Recap Section Right

  23. Under the Stack Container: Right, click on Panel New Button to create a new section. In our example, we will select "Single Item Value" and enter the section title as "Company Name". This section will be use to retrieve the Booking Entity Name.
  24. Implementation Document Builder Trade Recap Single Value Company Name

  25. In the Single Item value: Company Name section details, we can set more properties for the section. In our example, we will use the following:
  26. Object Name: Contract

    Parent Section: Trade Recap[11729]. This is to link the contract object to the Trade Recap Document Root so that when the contract is selected, we will be able to get the booking entity name from the contract.

    Section criteria: will be the code below. This is to link the contract object to the Root Document Contract object.

    contractseqnum.eq.{11729:contractseqnum}

    Column Item Ref: will be the bookingentityname Item Ref.

    contract.core_settlement_bookingentity.bookingentityname

    In our example, we will also set Aligment:Left.

    Implementation Document Builder Trade Recap Single Value Company Name Detail

  27. Next, we will create the section for the Booking Entity Address.
  28. Click on Panel New Button under the Single Item Value:Company. In our example, select List and enter the section title as "Booking Entity Address". When "List" section is used, the system will list all the row from that object.
  29. Implementation Document Builder Trade Recap List Address

  30. In the List: Booking Entity Address section details, we can set more properties for the section. In our example, we will use the following:
  31. Object Name: Address

    Parent Section: Trade Recap[11729]. This is to link the address object to the Trade Recap Document Root so that when the contract is selected, we will be able to get the booking entity name from the contract.

    Section criteria: will be the code below. This is to link the Address object bookingentityseqnum to the Root Document Contract object bookingentityseqnum.

    bookingentityseqnum.eq.{11729:contract.core_settlement_bookingentity.bookingentityseqnum}.and.activeind.eq.TRUE

    Column Item Ref: will be the core_address_line.addressline Item Ref. Since we use "List" as section type, the system will display all the address line of the Booking Entity.

    Sort Item Ref: we will include a sort item ref using core_address_line.lineordernum to sort the address line before displaying in the document.

    In our example, we will also set Aligment:Left.

    Implementation Document Builder Trade Recap List Address Detail

  32. Next, we will create the remaining part of the trade recap. In order to create some spacing between the Entity Header Section with the next section, we can include a blank Static Text Section before starting the next section.
  33. Click on Panel New Button outside the Column Container Section to create a new section. In our example, we will select "Static Text" Section and name it as "Space". This will create some spacing with the next section.
  34. Implementation Document Builder Trade Recap Space Section

  35. For the Static Text:Space section detail, we will not include additional properties.
  36. Next, we will create the title of the document to be display at the center of the document.
  37. Click on Panel New Button after the Static Text:Space section to create a new section and enter "Trade Recap" as the section Title.
  38. Implementation Document Builder Trade Recap Title Section

    For the Static Text:Space section detail, we include a Static Text: "Trade Recap" and set Alignment:Center.

    Implementation Document Builder Trade Recap Title Section Detail

  39. Next, we will create a horizontal line.
  40. Click on Panel New Button after the Static Text:Trade Recap section to create a new section and enter "Line" as the section Title.
  41. Implementation Document Builder Trade Recap Horizontal Line

  42. For the Horizontal Line:Line section detail, we will not include additional properties.
  43. Next, we will create the section for the Seller.
  44. Click on Panel New Button under the Horizontal Line:Line. In our example, select Column Container and enter the section title as "Seller". We will use the Column Container to create a 2 Column display left side for the text and right side for the value.
  45. Implementation Document Builder Trade Recap Seller Section

  46. For the Column Container:Seller section detail, we will not include additional properties.
  47. Next, we will create the section to display the static text Seller on the left.
  48. Click on Panel New Button under the Column Container:Seller. In our example, select Static Text and enter the section title as "Seller".
  49. Implementation Document Builder Trade Recap Seller Text

  50. In the Static Text: Seller section details, we can set more properties for the section. In our example, we will use the following:
  51. We will set Static Text as "Seller:", Width:"100" and Aligment:Left.

    Implementation Document Builder Trade Recap Seller Text Details

  52. Next, we will create the section for the seller name value.
  53. Click on Panel New Button under the Static Text: Seller. In our example, select Single Item Value and enter the section title as "Seller Name". Since Seller Name will be a single value, we can use Single Item Value.
  54. Implementation Document Builder Trade Recap Seller Single Item Value

  55. In the Single Item Value: Seller Name section details, we can set more properties for the section. In our example, we will use the following:
  56. Object Name: Contract Item

    Parent Section: Trade Recap[11729]. This is to link the Contract Item object to the Trade Recap Document Root so that when the contract is selected, we will be able to get the related Contract Item data.

    Section criteria: will be the code below. This is to link the Contract Item object contractseqnum to the Root Document Contract object contractseqnum.

    contractseqnum.eq.{11729:contractseqnum}

    Column Item Ref: will be the bookingentityname Item Ref. Hoewever, to know if we are seller or buyer, we will need to use buysellcode. The function is below:

    fnIf(i:buysellcode,eq,S,i:contract.core_settlement_bookingentity.bookingentityname,i:contract.core_counterparty.counterpartyname)

    In our example, we will also set Aligment:Left.

    Implementation Document Builder Trade Recap Seller Single Item Value Detail

  57. Next, we can create a spacing between seller and buyer. We can Click on Panel New Button outside the Column Container Section to create a new section. In our example, we will select "Static Text" Section and name it as "Space". This will create some spacing with the next section.
  58. Implementation Document Builder Trade Recap Space Section after Seller

  59. Next, we can create the Buyer Section and Buyer Name Value similar to Seller. We can use step 29 to 37 again.
  60. Note: For Column Item Ref, the Function will be changed to check buysellcode equal to B.

    fnIf(i:buysellcode,eq,B,i:contract.core_settlement_bookingentity.bookingentityname,i:contract.core_counterparty.counterpartyname)

    Implementation Document Builder Trade Recap Buyer Single Item Value Detail

  61. Next, we can create a space section again after the Buyer Section.
  62. Next, we can create the commodity section.
  63. Click on Panel New Button under the Static Text:Space. In our example, select Column Container and enter the section title as "Commodity". We will use the Column Container to create a 2 Column display left side for the text and right side for the value.
  64. Implementation Document Builder Trade Recap Commodity Section

  65. For the Column Container:Commodity section detail, we will not include additional properties.
  66. Next, we will create the section to display the static text Commodity on the left.
  67. Click on Panel New Button under the Column Container:Commodity. In our example, select Static Text and enter the section title as "Commodity".
  68. Implementation Document Builder Trade Recap Commodity Text

  69. In the Static Text: Commodity section details, we can set more properties for the section. In our example, we will use the following:
  70. We will set Static Text as "Commodity:", Width:"100" and Aligment:Left.

    Implementation Document Builder Trade Recap Commodity Text Details

  71. Next, we will create the section for the seller name value.
  72. Click on Panel New Button under the Static Text: Commodity. In our example, select Table and enter the section title as "Commodity". Since Commodity Name can be more than 1 value, we can use Table to display more than 1 value if there are more than 1 contract item entered.
  73. Implementation Document Builder Trade Recap Commodity Table

  74. In the Table: Commodity section details, we can set more properties for the section. In our example, we will use the following:
  75. Object Name: Contract Item

    Parent Section: Trade Recap[11729]. This is to link the Contract Item object to the Trade Recap Document Root so that when the contract is selected, we will be able to get the related Contract Item data.

    Section criteria: will be the code below. This is to link the Contract Item object contractseqnum to the Root Document Contract object contractseqnum.

    contractseqnum.eq.{11729:contractseqnum}

    Column Item Ref: will be the contractcommodityname Item Ref.

    contractitem.core_contract_commodity.contractcommodityname

    In our example, we will also set Aligment:Left.

    Implementation Document Builder Trade Recap Commodity Table Detail

  76. Next, we can create a space section again after the Commodity Section.
  77. Next, we can create the Specification section.
  78. Click on Panel New Button under the Static Text:Space. In our example, select Column Container and enter the section title as "Specification". We will use the Column Container to create a 2 Column display left side for the text and right side for the value.
  79. Implementation Document Builder Trade Recap Specification Section

  80. For the Column Container:Specification section detail, we will not include additional properties.
  81. Next, we will create the section to display the static text Specification on the left.
  82. Click on Panel New Button under the Column Container:Specification. In our example, select Static Text and enter the section title as "Specification".
  83. Implementation Document Builder Trade Recap Specification Text

  84. In the Static Text: Specification section details, we can set more properties for the section. In our example, we will use the following:
  85. We will set Static Text as "Specification:", Width:"100" and Aligment:Left.

    Implementation Document Builder Trade Recap Specification Details

  86. Next, we will create the section for the seller name value.
  87. Click on Panel New Button under the Static Text: Specification. In our example, select Static Text and enter the section title as "Specification Details". Since we are displaying a group of static text, we can use Static Text section again.
  88. Implementation Document Builder Trade Recap Specification Group Text

  89. In the Static Text: Specification Details section details, we can set the static text, we will use the following:
  90. - Density: 0.950 (Max) - Viscosity: 380cst (Max) - CCR: 13 wt (Max) - Flash Point: 75( Min)

    Implementation Document Builder Trade Recap Specification Group Text Detail

  91. The remaining sections will be the same as above. For Delivery Range, Quantity and Range, a Table Section will be used so that if there are more than 1 contract item, the system will display the data correctly.
Custom Panel

After the document are built, you will need to decide on which view this document can be printed. For our example, the view that we are using is Physical -> Contract View. This is done via View Builder and custom tab.

Custom Tab allows you to add custom application into the view so that based on selection by the user, the custom application will be triggered.

Implementation Document Builder Trade Recap Custom Tab

To create a new custom button, in View Builder-> Customs Tab:

  1. Click on New Button to create a new line.
  2. In Order Num, enter an order num. In our example, we are using "500".
  3. In Custom Type, select the applicable custom type. The custom Type available are "Table Button", "Row Drag" and "Row Drag Target". Row Drag and Row Drag Target enable the row in a table to be dragged from one table to another. The example is Operation view matching of Buy Sell Trade. In our example, we are using "Table Button".
  4. In Button Text, enter the text to be display on the button. In our example, we are using "Create Document".
  5. In Icon Css Class, enter the css class to be used. Please check with CoreTRM support for available CCS Class. In our example, we are using "fas fa-6ile-alt".
  6. In Requires Row Selection Indicator, tick this box if Row Selection is required before clicking the button. In our example, we are ticking this. So that when a contract is selected, we will use its contractseq num to retrieve data.
  7. In Requires Insert Access Indicator, tick this box if Insert Access is required before clicking the button. In our example, we are not using it.
  8. In Requires Update Access Indicator, tick this box if Update Access is required before clicking the button. In our example, we are not using it.
  9. In Requires Delete Access Indicator, tick this box if Insert Access is required before clicking the button. In our example, we are not using it.
  10. In Function Id, enter the name of the function to trigger. In our example, we are using "CreateDocument" which is specifically for doccument creation.
  11. In Function Param Item Refs, enter the paramter item refs to used. In our example, we are using "contractseqnum".
  12. In Function Fixed Params, enter the fixed parameter to use. In our example, we are using "dataobjectseqnum.eq.90". This is to indicate that it is created from contract view.
  13. In Confirm Message, enter applicable confrim message. If a message text is entered, when the use click on the button, the system will prompt this message. In our example, we are not using it.
  14. Then, click on Save Button to confirm the creation.
  15. To edit custom details after creation, Click Edit Button to edit.

When can further specify some criteria for the table button using custom Item.

Implementation Document Builder Trade Recap Custom Tab Item

To create a new custom button, in View Builder-> Custom Items Tab:

  1. Click on New Button to create a new line.

  2. In Order Num, enter an order num. In our example, we are using "500".

  3. In Function Param Element, select the function param element. The available function element are Date, File Lookup and Text. In our example, we are using "lookup".

  4. In Function Param Element id, enter the parameter element id to use. In our example, we are using "documentseqnum" of the selected document.

  5. In Function Param Element Label, enter a label for the function param element. In our example, we are not using it.

  6. In Lookup Object Name, select the object name to use for this function. In our example, we are using "Document" as we would like to display list of document in the dropdown.

  7. In Lookup Display item Refs, enter the Item Refs to display in the dropdown/lookup. In our example, we are using "documentname" as the user will select the document to use.

  8. In Lookup Value Item Refs, enter the lookup value item refs to use to link to the object. In our example, we are using "documentseqnum".

  9. In Lookup Criteria, enter any applicable criteria for the Lookup. In our example, we are using "documentseqnum.in.118" since we want the dropdown list to display only the "Trade Recap" document.

  10. In Lookup Default Values, enter any default values for the Lookup. In our example, we are using "118". When there are lookup values in the dropdown, it is useful to default the most commonly use.

  11. Then, click on Save Button to confirm the creation.

  12. To edit custom details after creation, Click Edit Button to edit.

  13. Below is an example of how it looks like in the Physical -> Contract view.

    Implementation Document Builder Trade Recap Document Button

Back to top
Hi! Have questions about CoreTRM? Chat with our AI or connect with our reps – we’re here to assist you!

CoreTRM Assistant