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 CRM Systems 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
  • External Objects & UDFs
  • Return Data External Object
Back to Manual

Return Data External Object

 

Beginning with the May 2013 update of m-Power, developers will have access to a Return Data Java external object for use within maintenance applications. This object takes in 1 parameter to find a row within a retrieval, and then returns that value(s) to your maintainer. A common example of using this is within the Email Upload template, where you might use the sender's email address to look up what customer information they are associated with and store that value(s) in the email table for future reference. This object is also very easy to configure and can be used with any existing maintenance application.

  1. First, create a lookup retrieval for use with this object. In this case, we are going to submit an email address, and return a customer number and a customer name. Therefore, our retrieval has at least these three fields. For the purposes of this document, the lookup retrieval will be MRCWORKLIB.I00010s.
  2. Next, we need to register the actual object before we can use it in our application. To do so, navigate to "Admin Menu" -> "Custom Code" -> "External Objects" -> "Create New Object." Give your object a name and description, and make sure that Java Method is selected for Object Type. Within class name, type:

    com.mrc.ext.MrcReturnData("MRCWORKLIB.I00010s", *REQ)

    Note: Be sure to substitute your lookup retrieval above.

    Also, set the method name to:

    get(pValue, pName, pName1)

    Once done, your screen should look similar to the screenshot below:



     
  3. After clicking Accept, you will be brought to the Manage External Objects screen. Now, you can add the needed parameters by clicking the Parms button.
  4. The first parameter must be the field you are using to lookup the proper record. You may make the description whatever value you would like, however the name must be the name of the field within your lookup retrieval. In our example, the field name is EMAIL so that is what we will use here. Set the length and decimal appropriately, and set Required Field to Yes.



     
  5. The rest of the parameters are the fields you will be returning. Again, the description is not important, while the name must be the name of the field from the lookup retrieval. In our example, we will be returning fields CUSNO and CNAME.



     
  6. Now that our object has been registered, we will add it to our maintenance application. To do so, navigate to Maintenance and click the Edit button next to your maintainer you wish to use. Once the application menu is open, click the External Object button.
  7. Select your object from the dropdown, and select a proper location such as *BEFOREACT, which will run this object before any action has taken place so that the fields are updated properly. Finally, map the fields properly here (EMAIL to EMAIL, CUSNO to CUSNO, CNAME to CNAME). Note: If you do not see your field in the parameter dropdown, you have set the length and/or decimal incorrectly. You must fix this before proceeding.
  8. Once done, click Accept, and compile/recompile. Note: It is not necessary to overwrite anything when only adding/modifying an external object.

This object will now use the value of the email field to lookup the associated customer number and name at runtime, with no additional intervention needed by the developers. This object can be reused as many times as needed.

Created: May 21, 2013 | 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

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

See all tags »

michaels, ross & cole, ltd. (mrc)
Privacy Settings Privacy Policy Cookie Policy Employee Intranet
© 2023 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