01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Creating a new Business Entity<br />

5. In the Business Entity source code, copy and paste the following code to the<br />

ReaddsCustomer method. This reads records from the Sports 2000 database.<br />

DEFINE DATA-SOURCE srcCustomer FOR Customer.<br />

EMPTY TEMP-TABLE eCustomer.<br />

BUFFER eCustomer:ATTACH-DATA-SOURCE(DATA-SOURCE srcCustomer:HANDLE).<br />

filter = "where custnum < 100".<br />

IF filter NE "" AND filter NE ? THEN<br />

DATA-SOURCE srcCustomer:FILL-WHERE-STRING = filter.<br />

DATASET dsCustomer:FILL().<br />

BUFFER eCustomer:DETACH-DATA-SOURCE().<br />

RETURN.<br />

6. Save and close the class file.<br />

To add the Business Entity to the <strong>Mobile</strong> Service:<br />

1. In the Project Explorer pane, expand Defined Services and right-click<br />

My<strong>Mobile</strong>Service. Click Edit.<br />

2. Click Next on the Edit a <strong>Mobile</strong> Service page.<br />

3. On the Modify a <strong>Mobile</strong> Service page, select the check box next to the<br />

dsCustomer.cls file. Click Finish.<br />

<strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong> 53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!