mrc logo mrc logo
  • m-Power m-Power
    What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • Solutions Solutions
    What does m-Power build?
    Overview Database Front-Ends Reporting Business Intelligence Dashboards Mobile Apps ERP Enhancements Modernization Spreadsheets to the web MS Access to the web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs and Web Services
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Services Services
    Overview Training Project Consulting Staff Consulting Mentoring
  • About About
    Overview Partners Press Releases Careers Events Contact Blog
  • Support Support
    Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Form Validation
  • Validating via an RPG External Object
Back to Manual

Validating via an RPG External Object

 

This document will explain how to call an external object RPG program for validity checking. For basic information regarding validity checking please see this document.

The source code for this RPG can be found here. For the sake of this documentation, the RPG code will be located in MRCWORKLIB/RPGLESRC and the file will be named VALIDDATES.

First, we will define this external object to our data dictionary.

Click "Admin Menu" -> "Custom Code" -> "External Objects" -> "Create New Object."

Be sure that the Program and Object name match.

Now that your external object has been created, we need to map the matching parameters to the object.

Since this object contains three parameters, we must map the same parameters, in the correct order, to this object that are listed in the RPG code.

The first parameter must be the error message, and is noted as such:

Note: The "Selected Field Required" option is set to "No" because this parameter must not be mapped at runtime.

Note: *VALID must be included in the Object Parameter Description.

Click "Accept". Create the remainder of your parameters.

After all the parameters are created, click the "Create Stored Procedures" link for the specific object on the "Manage External Objects" screen.

This will pull up the Create Stored Procedure screen where you can view the code used to create the stored procedure, or actually create the stored procedure.

In this case, we want to click the Create button to create the stored procedure for this object. After clicking the Create button, you will see the screen displayed below.

Click Accept to return to the Manage External Objects screen. Now that the external object has been created, all that is left to do is to include this object into your maintenance application.

Create your Maintenance application as you normally would. After including all of your specifications within Application Menu, click the "External Objects" link.

Select the newly created object off of the "Select an Object" drop-down. Select the *FLDVALID location. Map all parameters, except for the Error Message Parameter (as it must be left blank, i.e. no field mapped to it).

Click "Accept". Build your application.

Based upon the RPG logic provided, if a user forgets to enter a starting and ending date, forgets either the starting or ending date, or enters an ending date that is before the starting date, the external object will stop the record from being written to the database:

Note: The text of the error message is controlled within your RPG logic.

There are a few specific rules that must be followed for this methodology to work correctly.

  • The first parameter must be specified for the error message, and must not be mapped to any field within your application.
  • The first parameter must contain the text *VALID in the description.
  • As a general rule for external objects, if you are chaining out to any tables, in your RPG you must include their libraries within the mrc-spring-context.xml file on the "libraries=" line to specify the run-time library list.

Created: May 27, 2008 | Modified: June 12, 2017

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Advanced Retrievals Tomcat Build Process Retrieval Popular Data Dictionary Administration Bootstrap Templates External Objects Video Prompt Screens Maintainers Application Properties Dropdowns App Properties Compiling Graph Properties Database Excel SQL Maintainer mrc-Productivity Series Parameters Report Performance Calculations Java Production DB2 Graphs Freemarker Getting Started m-Painter Bar Graphs RPG Admin Summaries Reports Form Validation Dates Email Graphing Security Record Selections

See all tags »

michaels, ross & cole, ltd. (mrc)
Privacy Settings Privacy Policy Cookie Policy Employee Intranet
© 2018 mrc. All rights reserved.
mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566