Virtual property expression - Virtual property inverse expression

Steps

Virtual property expression

Specifying an expression in the property "Virtual property expression" for a newly added property will make that property a virtual property and results of the expression will be displayed.

A virtual property expression is specified from either New Property Definition dialog or "Virtual property expression" property (General tab) in the property definitions.


Example of adding a new property and specifying the property as a virtual property

Here we will add a new property in the operation class and make it a virtual property that refers to spec 1 of orders. Now the added property becomes a virtual property that refers to Spec1 of orders.

Open the Operation table and select [Column Settings...] from the top part popup menu to display the Column Settings dialog.


Click the [New Property...] button of the Column Settings dialog to display the "New Property Definition" dialog.


Assign any name for the new property you want to add in the "New Property Definition" dialog.
Then, click the [Virtual Property Setting] button.


Assign any name for the new property you want to add in the "New Property Definition" dialog. Then, click the [Virtual Property Setting] button.
Click the [ ... ] button next to the text box for "Virtual property expression" to display the expression editing dialog. Specify the expression as "ME.Order.Spec1.Code" so as to refer to Spec1 of orders.


If you click [OK] in the expression editing dialog, the specified expression will be reflected to the text box for "Virtual property expression."
Now the newly added property has become a virtual property that refers to Spec1 of orders. Click the [OK] button to close all dialogs.


If you check the Operation table, you can see that the newly added property refers to and displays Spec1 of orders.


The newly added property will be displayed in the User tab of the properties window. Again, it refers to and displays Spec1 of orders.


Virtual property inverse expression

When specifying an expression in the "Virtual property expression" property of a user-added property, you will not be able to write in that property; however, the property will become writable by specifying a virtual property inverse expression, and the input value will be specified in accordance with the expression specified for the virtual property inverse expression.

Suppose, for example, that a property is added to the order, and the virtual property expression was specified as follows:

ME.Qty + 'pcs'


If the quantity of the order is 100, this property will display "100 pcs."
By specifying a virtual property inverse expression, you may enter "200 pcs" in that property and have "200" entered for the quantity of the order.


How to specify a virtual property inverse expression

You may specify a virtual property inverse expression from the "Virtual property inverse expression" text box on the "New property definition" dialog.
Or you may specify it in the "Virtual property inverse expression" property in the General tab of the "Edit property definition" dialog.

A virtual property inverse expression specifies the expression to be assigned in the HOLDER object by using the INPUT keyword.


INPUT

INPUT displays the string input in the virtual property expression.


Examples of how to specify an expression

Example 1

Virtual property expression and virtual property inverse expression for an additional property to the operation displaying the order quantity of "100 pcs."

 Virtual property expression E.Order.Qty+'pcs'
 Virtual property inverse expression  HOLDER.Order.Qty=FindNumberL( INPUT, 1 )

Example 2

Virtual property expression and virtual property inverse expression for an additional property to the order displaying the due date of "January 1."

 Virtual property expression GetMonthPart(ME.LET)+'Month'+GetDayPart(ME.LET)+'Day'
 Virtual property inverse expression HOLDER.LET=DateF(GetYearPart(HOLDER.LET),FindNumberL(INPUT,1),FindNumberL(INPUT,2),GetHourPart(HOLDER.LET),GetMinutePart(HOLDER.LET),GetSecondPart(HOLDER.LET))

Example 3

Virtual property expression and virtual property inverse expression for an additional property to the order displaying the customer of the rightmost pegged order

 Virtual property expression ME.RightmostOrder[1].Customer
 Virtual property inverse expression HOLDER.RightmostOrder[1].Customer=INPUT

* If you put a non-existing customer, it will be automatically generated where possible. If not, that code cannot be input.


Since "INPUT" used in a virtual property inverse expression will be in the string format, there are several functions for converting it to a different format.
Please click here for further information on internal functions.

FindNumberL( string , N )

Returns in value the characters that signify the nth value from the left in the string of the first parameter. FindNumberL( '10pcs', 1 ) -> 10

FindNumberR( string , N )

Returns in value the characters that signify the nth value from the right in the string of the first parameter FindNumberL( '10pcs', 1 ) -> 10

DateS( Year , Month , Day )

Returns in the time format when provided with the year / month / day in values.

DateF( Year , Month , Day , Hour , Minute , Second )

Returns in the time format when provided with the year / month / day / hour / minute / second in values.



HelpNo.:741100
© Since 2018 Asprova Corporation, All rights reserved.