---
nav: wcp_docs
parent_url: /wcp_docs/
title: Get Started with Model Business Objects
layout: subsection
---

A business object enables you to create custom data structures to track information not natively available in Workday, such as project-specific details, equipment inventory, or custom survey responses.

In this activity, you’ll create and configure a business object that will enable users to submit data to change an employee’s work location and work designation (office, home, or hybrid).

When you’ve completed this activity, you’ll be able to:

-   Create a security domain and configure a security policy that grants permissions to specific security groups.
-   Create a model business object secured by the security domain.
-   Add and configure four fields to the business object, including a single-instance field that links to a Workday delivered object called Worker.
-   Configure an outbound REST endpoint that sends data submitted from a page to the business object.
-   Configure an inbound REST endpoint that retrieves data from the business object and displays it on a page.
-   Display records from a business object in a grid.


![](GUID-5fd0f158-4a57-44fe-8c9e-08676748d1e0.png)

## <a id="before-you-begin"></a>Before You Begin: Create an Account on the Workday Build Platform

To do this activity, you must have an account on the Workday Build platform and a development tenant. If you’ve already created an account and a tenant, you can go to the first task of this activity.

If you haven’t already created an account, you can do so now. It’s free!

1.  Go to the [Workday Build Platform](https://developer.workday.com) and create an account with your personal email address.
2.  Once you have created an account, sign in to the [Workday Build Platform](https://developer.workday.com).
3.  In the upper-left corner, select the hamburger menu, and under <b>Console</b>, select <b>Tenants</b>.
4.  On the <b>Tenants</b> page, select <b>Create Tenant</b>. It will take 1 to 2 minutes for the development tenant to be created.
5.  Check your personal email for a link to change your tenant password.

    <b>Note:</b> Remember the password. You’ll need to sign in to the tenant while you do this activity.

6.  Sign in to the tenant with the username <i>lmcneil</i> and the password that you just created.


<b>Note:</b> When you sign in to the development tenant with the username <i>lmcneil</i>, you’re signing in as the persona <i>Logan McNeil</i>. Logan is one of several user accounts that you can use to test the agents and app that you create and deploy to your development tenant.

## Task #1: Create an Extend App with Starter Code

To begin, create an Extend app from starter code that we’ve provided below. The starter code includes a model business object and security domain.

1.  Download the [modelbusinessobjectstartercode.zip](modelbusinessobjectstartercode.zip) file.
2.  On the [Developer Site](https://developer.workday.com) home page, select <b>Build an Extend App</b>.
3.  Select <b>Upload a Zip File</b>.
4.  In the Name field, give your app a name, such as <i>Change Work Location App</i>. The <b>Reference ID</b> will automatically populate based on the app's name.
5.  Click <b>Select a File</b>, navigate to your computer’s Download folder, and select the <i>ModelBusinessObjectStarterCode.zip</i> file.
6.  Select <b>Create and Edit</b>. This opens <b>App Builder</b>.


✅ <b>Expected result:</b>App Builder should be open with your newly created app.

![](GUID-39ed1efc-9ecb-466d-b874-b315eab919f4.png)

## Task #2: Add and Configure a Security Domain

A <b>security domain</b> enables you to extend Workday's native security framework to custom objects, pages, and business processes built within an Extend application—rather than creating a separate, bolt-on authorization system. This means that applications built on Workday Extend inherit the security protocols of Workday, ensuring the protection of data, and more broadly Workday Extend leverages the user interface, security, and business process framework of Workday, ensuring seamless integration.

In this task, you’ll add a security domain to your app and deploy the app to your development tenant. In the following task, you’ll create a security policy in the tenant that defines which user groups can use the app.

1.  In App Builder’s left-hand Components panel, select the <b>+ Add Component</b> icon.
2.  In the Type field, search and select <b>Security Domain</b>.
3.  In the Name field, enter <i>ChangeLocationSecurityDomain</i> and select <b>Done</b>.
4.  In the Components panel, under the Security Domains section, select the newly created <i>ChangeLocationSecurityDomain</i>.
5.  In the Enabled For: section, check the <b>Page Security</b> box. The Page Security box enables you to specify which security groups are allowed to view (and access) the specific custom pages built in that Extend app, so only authorized users can open them.


✅ <b>Expected result:</b>Your security domain should look like the one shown in the image below. In the next task, you’ll deploy the app and create a security policy in the development tenant.

![](GUID-e5d24617-fa32-4da7-b446-6515c77cbbdc.png)

## Task #3: Create a Security Policy in the Tenant

A <i>security policy</i> defines which security groups have view, modify, or integration (get/put) access to a specific custom object, page, or business process within an Extend app, applying Workday's standard domain-based access control to that custom item.

In this task, you’ll deploy your app to your development tenant and create the security policy.

1.  In App Build, select <b>Save and Deploy</b>.
2.  On the Deploy pop-up window, select your tenant’s alias and select <b>Deploy to Tenant</b>.
3.  If necessary, sign in to the tenant:

    -   User name: <i>lmcneil</i>
    -   Password: < enter the tenant password you created >.

4.  When the <b>Deploy Successful</b> pop-window appears, select <b>Manage in Tenant</b>. This will launch the tenant in another browser tab and display the App Manager report.
5.  Find your app, and in the Actions column, select <b>Configure</b>.
6.  On the <b>App Details</b> page, scroll down to the Security Domains table, where you’ll see the <i>Change Location Security Domain</i>.
7.  In the <b>Domain Security Policy</b> column, select <b>Create</b>.
8.  In the <b>Create Security Policy for Domain</b> pop-up window, verify that the security domain is correct, check the <b>Confirm</b> box, and select <b>OK</b>.
9.  On the <b>Edit Permissions</b> page, find the Report/Task Permissions table and select the <b>+ Add Row</b> icon.
10. In the Security Groups column, search and select <b>HR Administrator</b>. In the development tenant, you’re using Logan McNeil’s persona, and because she’s a member of the HR Administrator security group, you’re giving her (and yourself) permission to use the app.
11. Check the <b>Modify</b> box.
12. Select <b>OK</b> and then select <b>Done</b>. This will return you to the App Details screen.![](GUID-18738710-7f0b-4263-92c4-3174e119576d.png)
13. Scroll down to the Security Domains section and select <b>Activate Pending Security Changes</b>. You must do this step after you create or update the security policy or other security settings.
14. In the Description for Change field, enter <i>Create new security policy for Change Location App</i>.
15. Select <b>OK</b>.


✅ <b>Expected result:</b>You’ve created your app’s security policy, set the permissions, and activated the security changes.

![](GUID-3f2feefa-3b97-4823-840d-034515eb4d62.png)

## Task #4: Create a Business Object with Four Fields

A <i>model business object</i> is the data-model layer of an Extend app. It defines a new custom data structure (with its own fields, types, and relationships) that lives in the Workday platform. It enables you store application-specific data that has no corresponding delivered Workday object.

In this task, you’ll create a custom object with four fields: date, worker, workLocation, and workType.

1.  In App Builder’s left-hand Components panel, hover over the Business Object section and select the <b>+ Add Business Objects</b> icon.
2.  In the Name field, enter <i>WorkDesignation</i> and select <b>Done</b>. This will open the business object’s properties panel. You’ll see that the Name and Default Collection Name fields are automatically populated.
3.  In the Default Security Domains field, select <i>ChangeLocationSecurityDomain</i>.![](GUID-01adcbb0-f78c-4289-8d80-e89462459001.png)
4.  At the top of the properties panel, select the <b>Fields</b> tab.
5.  Select <b>Add Field</b>:

    1.  In the Name field, enter <i>date</i>.
    2.  From the Type dropdown list, select <b>DATE</b>.
    3.  From the Precision dropdown list, select <b>DAY</b>.
    4.  Select <b>Done</b>.

6.  Select <b>Add Field</b>:

    1.  In the Name field, enter <i>date</i>.
    2.  From the Type dropdown list, select <b>SINGLE_INSTANCE</b>. A SINGLE_INSTANCE type field restricts a custom object (or field) to hold only one value or record per parent instance, unlike a multi-instance field which allows multiple related records to be stored for the same parent. In this case, there can only be one instance of a worker.
    3.  Under Filter Targets, select <b>Workday Delivered Objects</b>. This will display a Target Business Object dropdown list, which will display Workday business objects that you can link to your business object’s worker field.
    4.  From the Target Business Object dropdown list, search and select <b>WORKER</b>.
    5.  Check the <b>Enable Security (By Target)</b> box. When checked, the Enable Security (By Target) option applies Workday's native security for the referenced Workday Delivered business object to that field, so a user can only view or access the field's value if they also have the appropriate security permissions on the specific target instance it points to (in addition to whatever security is defined on the custom object itself).
    6.  Select <b>Done</b>.

7.  Select <b>Add Field</b>:

    1.  In the Name field, enter <i>workLocation</i>.
    2.  From the Type dropdown list, select <b>TEXT</b>.
    3.  Select <b>Done</b>.

8.  Select <b>Add Field</b>:

    1.  In the Name field, enter <i>workType</i>.
    2.  From the Type dropdown list, select <b>TEXT</b>.
    3.  Check the <b>Enable as Display Name</b> box. When checked, the Enable as Display Name box on a TEXT field designates that field's value as the human-readable label used to represent instances of the custom business object throughout the UI — for example, in instance lists, prompts, and related-object references — instead of showing the object's internal ID.
    4.  Select <b>Done</b>.

9.  Select <b>Save to App Hub</b>.


✅ <b>Expected result:</b>You’ve created a business object, secured it with the <i>WorkDesignationSecurityDomain</i>, and added four fields.

![](GUID-30c8473d-45a2-4a03-87e0-dcf9bb600872.png)

## Task #5: Deploy the Business Object to the Tenant

So far, you’ve defined the model business objects’s structure (fields, data types, relationships) in your developer environment. However, you must deploy the business object so that the app’s pages, orchestrations, and business processes can store or query the business object’s instances.

Deploying also registers the CBO's security domains and permissions within the tenant's own security framework, so only authorized roles/users can access it.

In this task, you’ll deploy the app, view the business object in the tenant, and locate the REST API URL that will enable pages and other components of your app to access its data.

1.  In App Builder, select <b>Save and Deploy</b>.
2.  In the Deploy pop-up window, select your development tenant and select <b>Deploy to Tenant</b>.
3.  If necessary, sign in to the tenant:

    1.  Username: lmcneil
    2.  Password: < password you created >

4.  Select <b>Manage in Tenant</b>.
5.  In the App Manager report, find your app and select <b>Configure</b>.
6.  On the App Details page, select the <b>Business Objects</b> tab.
7.  Find the business object’s <b>REST URL</b>. You’ll need this when you configure the Outbound and Inbound API endpoints that will POST and GET data from the business object.


✅ <b>Expected result:</b>You can see the business object is created in the tenant, including its Web Service and WQL aliases, which enable it to interact with Workday web services (SOAP and REST APIs) and Workday Query Language statements.

![](GUID-f1007551-cab5-463b-9af1-857b49c714ce.png)

## Task #6: Create Outbound API Endpoint That Submits Form Data

An <b>Outbound API Endpoint</b> is a component configured to submit data from a page to a Workday business object or a custom business object. Its primary purpose is to enable users to submit form data, ensuring that the information is successfully persisted within Workday.

This is a good point to add the Outbound Endpoint because you’ll need to reference it when you configure the Value Out Binding attributes on the input fields that you’ll create in the following tasks.

1.  On the changeWorkLocation page, select the <b>Page Submit</b> tab.
2.  In the <b>Outbound Endpoints</b> section, select <b>+ Add Outbound Data</b> &gt; <b>Outbound REST Endpoint</b>.
3.  Name the outbound endpoint <i>createWorkDesignation</i>.
4.  In the HTTP Method field, select <b>Post (default)</b>.
5.  In the Base URL Type field, enter <i>app</i>. This is a key that references the business object’s REST API base URL (https://api.odp.wcp.workday.com/apps/changeWorkLocationApp_xydnlp/v1), which is declared in your app’s app metadata (AMD) component.
6.  In the URL field, enter <i>workDesignations</i>. This is the business object’s REST API endpoint. It’s the plural of the business object’s name.
7.  In the Auth Type field, enter <i>sso</i>.
8.  Select the <b>On Send</b> tab, and in the text field, enter:

    ```
    console.info(json:asJSON(self.data)); return self.data;
    ```

    ![](GUID-5fd5e414-9049-4620-988c-c997bca9c507.png)

9.  Select the <b>Error Handling</b> tab and select <b>+ Add Fail On Status Codes</b>:

    -   In the Code field, enter <i>400</i>, and in the Code Name field, enter <i>Bad request</i>.
    -   Select <b>+ Add Item</b>, and in the Code field, enter <i>403</i>, and in the Code Name field, enter <i>Forbidden</i>.

10. Select <b>Save to App Hub</b>.


✅ <b>Expected result:</b> The createWorkDesignation Outbound REST Endpoint is successfully configured with the correct method, URL, and error handling settings, making it ready to be referenced by your form's fields to persist user-submitted data to your business object.

![](GUID-2608a1c8-4132-4a11-8e1e-4abbeb0f3456.png)

## Task #7: Connect the Input Form Fields to the Outbound Endpoint

In this task, you’ll set the <b>Value Out Binding</b> attribute in the four input fields on the changeWorkLocation form. The Value Out Binding on a field (instance list, date, etc.) maps that field's current value to the specific parameter of an Outbound Endpoint. When the outbound endpoint is invoked, it passes the field’s data to the corresponding field in the business object.

The Value Out Binding uses a scripted value with this syntax: `<% outboundEndpointName.businessObjectField %>`.

1.  Select the changeWorkLocation page, select the <b>Presentation</b> tab.
2.  Scroll down to the Instance List with the name <b>workerSearch</b>. The app user will search and select the name of the employee whose work location will change.
3.  On the top left corner of the <b>workerSearch</b> Instance List, select the <b>Expand (>)</b> icon to show all attributes.
4.  In the Value Out Binding field, enter <i>createWorkDesignation.worker.id</i>. The Value Out Binding attribute maps the data entered by a user into a UI element (such as an Instance List or Date field) to the corresponding field defined in your Outbound API endpoint.
5.  Scroll down to the <b>effectiveDate</b> field, expand it to show all attributes, and in the Value Out Binding field, enter <i>createWorkDesignation.date</i>.
6.  Next, find the <b>proposedWorkDesignation</b> Instance List, and in the Value Out Binding field, enter <i>createWorkDesignation.workType</i>.
7.  Finally, expand the proposedLocation Instance List, and in the Value Out Binding field, enter <i>createWorkDesignation.workLocation</i>.
8.  Select <b>Save to App Hub</b>.


✅ <b>Expected result:</b> For each of the four input fields, you’ve configured a Value Out Binding that maps the data entered into the fields to the fields of the business object.

![](GUID-666fad27-bd2c-4c06-a932-bb34abe36a0c.png)

## Task #8: Submit Data to the Business Object

Let’s test the changes you’ve made so far to verify that the data entered on the changeWorkLocation page is being sent, via the outbound endpoint, to the Work Designation business object.

1.  Select the changeWorkLocation page, and in the upper-right corner, select the <b>App Preview</b> icon.
2.  Select the <b>Manage Tenant Connections</b> icon and sign in to your development tenant, if you’re not already.
3.  In the App Preview window, enter data in all the fields of the Change Work Designation Form:

    1.  Select an <b>Employee</b>.
    2.  Choose an <b>Effective Date</b>.
    3.  Pick the employee’s <b>Work Designation</b>.
    4.  Select the employee’s <b>Work Location</b>.

4.  Select <b>OK</b> to submit the form. Once you submit the form, the page will automatically route you to the home page. Notice that the grid on the home page is empty. This is because you haven’t yet configured it to display data retrieved from the business object. There is another way to verify that data was successfully submitted to the business object.
5.  Launch your development tenant, if it’s not already:

    1.  At the top-left corner of App Builder, select the <b>hamburger menu</b> &gt; <b>App Overview</b>. This will open the App Overview page in another browser tab.
    2.  On the left-hand navigation panel, select <b>Tenants</b>.
    3.  On the far right of your tenant alias, select the <b>Launch Tenant</b> icon.

6.  In the Workday tenant <b>Search</b> box, search and select the <b>App Manager</b> report.
7.  Next to your app, select Configure.
8.  Near the bottom of the App Details page, select the <b>Extend Business Object Instance Count</b> tab.
9.  In the Business Object / Attachment Object table, you should see a <b>1</b> in the Total Instances column.


✅ <b>Expected result:</b> For each instance that a Change Work Designation request was successfully submitted to the business object, you’ll see the total number of instances under the Extend Business Object Instance Count tab in App Details page in the tenant.

![](GUID-530b3d58-c06d-4673-82cf-26d3fddf8f52.png)

## Task #9: Create an Inbound Endpoint to Get Data from the Business Object

An <b>Inbound API Endpoint</b> is designed to retrieve data from an API or external source. Its primary purpose is to fetch this data so it can be used to dynamically populate UI components, such as Instance Lists, allowing users to view or select information directly within the app.

In this task, you’ll create an Inbound Endpoint from which you can get data from the business object and display it in a grid on the app’s home page.

1.  Return to App Builder, select the <b>home</b> page, and select the <b>Page Load</b> tab.
2.  In the Inbound Endpoints section, hover above locationValuesGet Endpoint, select <b>+ Add Inbound Endpoint</b> &gt; <b>REST Endpoint</b>.
3.  In the Enter Name field, enter <i>getWorkDesignationRecords</i>.
4.  In the HTTP Method field, select <b>Get (default)</b>.
5.  In the Base URL Type field, enter <i>app.</i> This references a dataProvider defined in your app’s App Metadata (AMD) component. The dataProvider is a key/value pair that specifies the Base URL to your app in the tenant.

    ```
    {
      "key": "app",
      "value": ""<% apiGatewayEndpoint + '/apps/' + site.applicationId + '/v1/' %>""
    }
    ```

6.  In the URL field, enter <i>workDesignations.</i> This is the endpoint of the WorkDesignation business object.
7.  In the Auth Type field, enter <i>sso.</i>
8.  Select the <b>Settings</b> tab and set the Is Collection attribute to <b>true</b>.


✅ <b>Expected result:</b> You’re inbound endpoint should look like the one shown in the image below.

![](GUID-f0c0701e-68de-42ee-86dc-31cf5917f54e.png)

## Task #10: Display Records in a Grid

To save time, the starter code for this activity included a Grid configured to display data that is retrieved from the WorkDesignation business object.

Let’s take a look at how this is done.

1.  Select the <b>home</b> page and select the <b>Presentation</b> tab.
2.  Scroll down to the Grid tag with the name <b>displayWorkDesignationRecords</b>.
3.  In the Rows attribute, notice the scripted value getWorkDesignationRecords.data. This references the name of getWorkDesignationRecords inbound endpoint that you created in the previous step. Chaining .data tells it to retrieve the values stored in all the fields in the root data structure.
4.  Notice the value of the Row Variable Name attribute: <b>displayRecords</b>. The Row Variable Name attribute defines the name of the variable of each grid row as the Grid iterates over it.

    1.  In the effectiveDate column, select <b>Show Cell Template</b> and you’ll see a Date object with a scripted value <b>displayRecords.date</b>. This enables the cell to use the Row Variable Name to access and display the data in the date field.
    2.  In the worker column, select <b>Show Cell Template</b> and notice the scripted value is the Row Variable Name chained to a field path: <b>displayRecords.worker.descriptor</b>. This retrieves and displays the workers name, which is stored in the nested descriptor field.
    3.  Show the workType column’s Cell Template and see that the scripted value should be <b>displayRecords.workType</b>.
    4.  The workLocation column Cell Template value should be <b>displayRecords.workLocation</b>.



✅ <b>Expected result:</b>In the App Preview window. You should see the Work Designation records displayed in the grid.

![](GUID-7ff4dbee-19c3-4458-9928-969b06a5277b.png)

