Dates

Date/Time Formatting

Working with True Dates & True Timestamps   m-Power is proud to announce the new Date/Time enhancement. Now, m-Power is stronger than ever when using true dates and true timestamps within your applications by being able to handle any display format as well as work with any database date/timestamp format. What this means is m-Power […]

JDEDateConvert Source Code

JDEDateConvert Source Code   package com.abc_co.mrcextension; import java.math.BigDecimal; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.mrc.ext.FieldConvertAbstract; /**  *  Sample class to convert display value to db value and vice versa.  *  (cyynnn  mmddyy)  *  * (1) Custom class must extend com.mrc.ext.FieldConvertAbstract  *     (which is in mrcapps.jar)  * (2) Implement method dbValue(String s) to Convert display string to DB value  * (3) Implement method customNumber(BigDecimal value) to convert db value  *     to display value.  * (4) Implement editInput() to edit input value.  * (5) If you are converting a character field, Implement method  *     customString(String value) to convert db value to display value.  * (6) Make a jar file and put it in folder m-power/mrcjava/WEB-INF/lib.  * (7) Attach this class to the field you want to convert in  *     Update Dictionary Field screen.  *  */ public class JDEDateConvert extends  FieldConvertAbstract {     /** Default cyynnn value for incorrect input */     static String dftVal = "99999";     /*********************************************************************      * Convert display string mmddyy to DB value cyynnn      *********************************************************************/     public String dbValue(String dspstr) {         if (dspstr == null || dspstr.toUpperCase().indexOf("*BLANK")>=0) {             return "0";         }         //if passed as mm/dd/yy instead of mmddyy         if (dspstr.indexOf("/") > 0) {             String msg = check(dspstr);             if (msg != null) {                 return dftVal;             }             dspstr = dspstr.replaceAll("/", "");         }         String str = dspstr;         int year = 0;         String cyynnn = "";         if (str.length() == 6) { //mmddyy             String mm = str.substring(0,2);             String dd = str.substring(2,4); […]

Create Calendar Helper in m-Painter

Create Calendar Helper in m-Painter   To implement the Calendar Helper functionality in your application, open m-Painter. Click on the input field to which you would like the calendar functionality applied. Either select the "Calendar" button from the m-Painter toolbar or right-click on your input field, and select "Insert/Edit Calendar". If you see the below […]

Calculation Screen

Calculation Screen Calculation Features Calculation Types Creating Calculations Calculation Features Calculations as Sequence keys and Record Selection fields — Calculations have been designed to take full advantage of SQL. Nearly every calculation is available to use as a sequence field or record selection field. Sequence/Record Selection Availability — The Work-with Calculation screen shows which calculations […]

Add/Subtract Dates using the Java Date Translator

Add/Subtract Dates using the Java Date Translator **Note: This Feature Has Been Deprecated. Please use this link to find alternative features: http://www.mrc-productivity.com/techblog/?p=522     The Java Date Translator is a very powerful tool, commonly used to determine the difference between two dates (Most date conversion can now be accomplished with a UDF). However, there is […]

mrc Date Conversion UDFs

mrc Date Conversion UDFs (User-Defined Functions)   mrc supplies three date conversion routines specifically for AS/400 databases. These routines are SQL functions located in MRCAPPLLIB, and they are available for use in logical and calculated fields. All three UDFs take a numeric date as an input parameter. Function specifications are described below. UDF Name Description […]

Introduction to User Defined Functions (UDF)

UDF Introduction   All applications created with m-Power employ SQL to access the database. SQL, by itself, is a very powerful language. A database User Defined Function (UDF) allows users to extend the power of SQL. UDF's are a powerful yet simple way to perform routine data transformations, calculations, and complex SQL logic. Database vendors […]

Java Date Translator

Java Date Translator (External Object) **NOTE: This Functionality Has Been Deprecated. Please use this link to see alternative features: http://www.mrc-productivity.com/docs/external-objects-udf/mrc-date-conversion-udfs   mrc supplies a date translator specifically for use with generated Web/Servlet applications. This Java class is named mrc.servlet.MrcDateTranslator and resides in mrcextobj.jar. The object definition is shown below. If this object definition is not […]