Skip to Content mrc logo mrc logo
  • 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
  • What does m-Power build?
    Solutions by Industry
    Overview Database Front-Ends AI Reporting CRM Systems Business Intelligence Dashboards Inventory Management 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 & Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Development Services Training Mentoring
  • Overview Partners Press Releases Careers Events Contact Blog
  • 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

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

See all tags »

mrc

Build the custom apps and AI tools your business needs with m-Power, or have our Chicago-based team build them with you. One platform, one team that makes sure you succeed.

Since 1981 · 1,500+ customers · 4.7/5 on G2

m-Power
Overview Demos Build Process Licensing Specs Get a Demo
Solutions
Database Front-Ends Reporting AI Tools Dashboards ERP Enhancements Modernization See all solutions
Company
Case Studies Services About Blog Careers Contact Support

Privacy Policy Cookie Policy Cookie Settings

michaels, ross & cole, ltd. (mrc)
US: 2001 Midwest Road, Suite 310, Oak Brook, IL 60523 · 630-916-0662
UK: Mortlake Business Centre, 20 Mortlake High Street, London, SW14 8JN · +44-20-335-59566
© mrc. All rights reserved.