Virtual Fields and Time

I’ve been working on a project recently where we create a relationship between records in MWS070 and other data without code. One of the key fields is the RGTM, the record time. If you look at RGTM in MWS070 then you’ll notice it is rather helpfully formatted to HH:mm, in the database however it is formatted as HHmmss – this creates a problem when we want to create that relationship.

This is really a post to illustrate that you can do some really funky stuff with virtual fields – very easily.

If we look at editing the field, it’s already formatted to 8 places.

Taking a look at the XML response, we can see we don’t have the seconds.

Then I remembered skimming a post a while ago about virtual fields:

And I wondered if we could use a virtual field to provide the unformatted raw data to the ListView – it turns out we can…

We can go to CMS005, set the used program to MWS070

Right click, Open Related -> Virtual Fields

In the V fld enter &TIME and click Create

Fill in the details as follows and click Next

&Time should be at status 20

Go to our MWS070 view and click on the edit pencil

Click on the dropdown

Enter &time to filter the list

Put a tick beside time, click Save and now we should see the raw time column

Pretty kewl stuff! 🙂

This entry was posted in M3 / MoveX. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s