Friday, December 18, 2015

How to find the API port number within LCM

a) Start LCM and navigate to the Grid Management Pages





b) Choose the Topology View




c) Expand the M3Router



d) 16205 is the HTTP port number, 16206 is the HTTPS port number



Event DB changes

It is also possible to create events that can monitor for field changes.  This is not as comprehensive as the full audit trail functionality, but is easy to setup and may be sufficient in some cases.

Setup for database logging


a) Change the existing record in CMS045



b) Check the box for event DB changes (CMS912)



c) Open the related program CMS048 to define the fields



d) Create a new field you are interested in




e) Mark the field as active



f) Stop auto job CMS912





g) Start the auto job





View the log entries


a) Start from CMS045




b) In CMS048 display the Event Log



c) Display the details of the entry



d) Below shows the old and new values and who made the change



e) This data is stored in csylog and can be retrieved by the sql statement below



Thursday, December 17, 2015

Viewing the Event - Events Part 6 of 6

You have several options for viewing the event.  Mingle is an additional option but I don't have this installed yet.

a) Application Message Open



b) Inbox Widget




Make sure your settings for the widget has M3 Application Messages enabled.




Note the neither option A or B automatically refresh, in my view this makes them more pull than push.

c) Email


In my opinion this is the best option.  In this case it is truly a push event.  You receive an email when the event occurs.  Clicking on the link will launch Smart Office if it is not already started, otherwise it will launch the program on the correct panel, in the correct mode and positioned to the correct field.

Define the Event Based Alert - Events Part 5 of 6

If you have been following along up until now you should now have all the background pieces in place. The next step is to create the subscription and event(s) associated with it.

a) Subscriptions are defined in program CMS045



For an M3 event, the Event Name should be the M3 table name.


The 'Ev name op' should be the database operation you are trying to capture.  I have selected an update transaction.



The 'Event publ' should be M3.




In summary, we are subscribed to events published by M3 when an Update to the table OCUSMA occurs.


b) Mark the status as preliminary until it is configured




c) With the subscription in place, next step is to define the alert.  This is done in CMS047 which you launch from a related option in CMS045





d) Create a new record in CMS047



It is possible to have more than one alert for a subscription, I am using 1 for the RID above.




e) On the E panel you define the event


I have defined the logical formula such that the event is processed when the customer name is changed.

I have hard coded a receiver for the event.

When the 'receiver' opens the event, smart office will open the program in change mode (option 2) on the E panel, positioned to field CUNM (Customer Name)


f) When you are done, remember to set the subscription status to 20






g) It is not enough to just change the status.  The auto job needed to be stopped.



h) And of course, started again.





All that remains is to wait until someone changes a customer name.



Wednesday, December 16, 2015

Testing the new transaction - MDBREADMI Part 3 of 3

Find the Transaction


a) Run Program MRS001 from SmartOffice and position to Program MDBREADMI




b) Right click for transactions then position to LstOOLINE71


I created a Lst transaction, over OOLINE71





Test the Transaction


a) Run MITEST




b) Enter the customer number you wish to search for.




c) You may get the error below





d) Only if you get the error above do you need to Clear Metadata Cache





e) The results are displayed below





Now all that remains is to add this new API transaction to the Mashup.






Create the new transaction - MDBREADMI Part 2 of 3

It is possible to create the transaction manually in smart office using MRS001 programs and transactions.  I think it is much easier though to use the process below.

a) From your API tools folder, run the MdbRead.exe program




b) You will need the Host, Port, User and Password values to start the tool.


These are the same parameters needed for the more common MITEST program.




c) Enter the name of the file then click the define new transaction button


This will populate all the inbound (key fields).  These are all required for a GET transaction, For a LST transaction you delete the ones you don't need.



d) You need to remove the Inbound fields one at a time by pressing the Remove last field button





e) Keep removing the fields until you have ONE more than the value you are going to use to select


I am going to be passing in a Customer Number value, so I need to keep Customer Number and Item Number.  The Customer Number is treated as the key field which I will be passing.  The Item Number is treated as a positional field.


f) Next add the output fields you need




g) Continue until you have all the fields you need




h) When you have all the output fields you need, press the Create Lst Trans button.




The Create Lst trans button does not provide a message box similar to "LstOOLINE71 Created", so if you are sure you pressed the button, don't press it again otherwise you will get another "LstOOLINE7101" which will need to be manually deleted using MRS001






Research the file you want to use - MDBREADMI Part 1 of 3

MDBREADMI is a new API which performs SQL like select statements against M3 tables.  After you create the new API transaction you can easily use this in for example a Mashup.

a) Find the table you are looking for in MDP


I am going to use OOLINE


b) Review the available indexes for the table you wish to select over


You need to find an index in the order you need.



c) Take note of the Keys


If you are going to create a GET transaction you will need all the keys, I'm going to create a LST transaction.


d) Take note of the output fields you wish to be returned from the transaction you are about to create.