This 90-minute OBE shows you how to build an orchestration
that executes a report, emails the PDF output, and attaches the
PDF report to the JD Edwards EnterpriseOne Sales Order
application.
In this OBE, you will create an orchestration that contains
these steps:
Run the invoice report (R03B505) for a sales order.
Run a data request to get the customer’s Address Book
number.
Send a message to the customer with the invoice attached.
Attach the invoice report to the sales order.
Background
Starting with JD Edwards Tools Release 9.2.6.3, you can now
download report output to the orchestrator temporary directory.
This capability provides more flexibility to manage report
output within an orchestration flow. Not only can you include
report output in messages, send them to external REST services,
or upload reports to FTP sites, but you can now add reports to
EnterpriseOne attachments, access report output inside custom
scripts, and return report output as files in the orchestration
output.
What Do You Need?
Access to a JD Edwards EnterpriseOne environment with Tools
9.2.6.3 or later. JD Edwards EnterpriseOne Trial Edition
running on Oracle Cloud Infrastructure is suitable, but you
can use any environment at the proper Tools release.
Security access to use Orchestrator Studio.
You must have an email address configured in the Address
Book for the customer to whom the email message is to be sent.
Running
and Downloading the Invoice Report
This section shows how to build an orchestration that will
create the invoice for a sales order and download the report
output for later use.
Note: This task relies on EnterpriseOne demo
data. You can use other data available in your system to enter a
sales order to perform this task.
Creating the Report Step
This section shows how to add a step to call Invoice Print
Report (R03B505) for a specific order and download the PDF file
of the invoice report immediately after the report is processed.
Sign in to the EnterpriseOne Orchestrator Studio.
On the home page, click Reports.
Select New from the left navigation pane.
Verify that the Execute Report option is
selected.
In the Name field, enter SingleOrderInvoiceReport.
Note: This option is disabled if the report
is not secured for this user. Either change to a user who has
access to this report version or create a new version for this
user.
Expand the Data Selection section.
Click the Delete icons to remove any
existing selections.
Click the Add button and type the values
in the fields as shown in the below screenshot.
Disable the Fire and Forget option in the
top right corner.
Expand the Download Report section and
perform the following steps:
Enable the Download Immediately option.
Select the File Type as PDF.
Enable the Overwrite Existing File
option. The Keep Temp Files option is disabled by default.
Enter invoiceReportFileName in the File
Name Variable field.
Click Save.
Creating an Orchestration from the Report Step
On the SingleOrderInvoiceReport page, click the Manage
menu and select Create Orchestration.
A new orchestration with the name SingleOrderInvoiceReport
is created.
Replace the old values with the new values as shown below:
Name = SendAndAttachOrderInvoice
Description = Run a report to generate an invoice
and send a PDF of that invoice to the customer.
Verify the generated orchestration. The input,
transformation, and output values are automatically populated.
Set the default values for the orchestration inputs to make
testing easier. To do so:
Click Start and click Inputs and Outputs,
and then enter these values in the Orchestration Inputs tab:
docNum = 2615
doctype = SO
company = 00001
Click Save.
To test this step of the orchestration, double-click the
Start icon to open the Run Orchestrations window.
Click Run.
Verify your output. Notice that the response is returned
only after the report is processed. Also notice the file name.
The report output was downloaded to the temp directory with
this name.
Click Close to close the Run
Orchestrations window.
Sending
a Message with the Invoice Report
In this section, you will add two steps to the orchestration:
one to get the customer details and another to send a message
with the invoice report to the customer.
Adding the Data Request
This section shows how to add a data request to get the
customer number.
Access the Orchestrator Studio.
Click Orchestrations.
Click the SendAndAttachOrderInvoice orchestration.
Click Design Mode and click Add +
after the report step.
Click Data Request and click the New
button.
In the Name field, enter GetCustomerNumber.
In the Table/View Name field, enter F03B11.
Click the Load button.
Click the filter icon next to these data structure fields.
Notice that they are displayed in the Filter Criteria section.
SDOC, SDCT, SKCO
Note: You can type these names into the
Filter field to find them quickly.
Click the Return icon for Address Number
(AN8). Verify that Address Number is displayed in the Return
Fields and Variables Names section. Enable the Associated
Description option.
Click the GetCustomerNumber data request
and then click the Transformations icon.
Map the Input fields with the Available Values fields as shown
in this screenshot:
Before you proceed with the steps in this section, configure
the customer's Address Book record with your email address so
that you can receive the message. In the demo data for sales
order 2615 the customer's Address Book number is 3007, but it
may be different for the sales order you are using. Verify it;
then use Address Book and Who's Who to add your own email to the
customer Address Book record. Then proceed with the steps below.
Click Design Mode and click Add +
after the data request step.
Click Message, and click New.
In the Name field, enter SendInvoiceToCustomer.
From the To drop-down list, select Address Book.
In the Address Book field, enter the variable value as ${customer}.
In the Subject field, enter See Attached Invoice for Order #${docNum}.
Enable the Plain Text option (if this
option is available).
In the Body field, enter:
Hello ${customerName},
Please see attached invoice for order #${docNum}.
Expand the Attachments section and in the Reports
Attachments section, click Add.
Click the AttachFileToOrderHeader attachment
step and click the Transformations icon.
Map the Input fields and the Available Values fields as
shown in the screenshot below.
The key values are from the inputs, and the
invoiceReportFileName is from the report step.
Double-click the Start icon to open the
Run Orchestrations window.
Click Run. You should see this output,
with an address number value. You should receive an email with
the report attached. The output also should indicate the
report was saved with a sequence in attachments.