Using CSV Loaders beyond only loading – Part 1

Imagine this scenario, a team goes out and targets a section of several routes on your network to update the information of few assets on that route.  To maintain history, your organization end dates all assets in this situation and creates new ones in their place.  Loading the data from the field is the easy part, you have CSV loaders for that, but it is time consuming to end date all the existing assets that are being updated.  However, there can be an easier way.

CSV Loaders can be custom built to do much more than just loading. They can be used for updating, end dating, deleting, emailing and much more.   With a basic understanding of writing PL/SQL and how to tie everything together in exor, the task of end dating the assets can take much less time. 

In this post, we will discover the main API call that can make this task possible.   Future posts will continue the creation of this end date loader.  If you ever browsed the exor API you are aware there are many packages with many functions in each package.   Since, we are interested in end dating the API call we are looking for is NM3API_INV. end_date_item.  This call works much like end dating an asset in the forms. Frist, we provide the function with the iit_ne_id of the asset we wish to end date.  Then we provide the date we wish to end date on, by default this date it the effective date in the current session.  If this date was not manually changed in the loader that would be today. 

Unfortunately, using this call by itself in a CVS Loader would not be too helpful since, it would require the User to have a list of all the assets’ iit_ne_id that needed to be end dated. To make this function useful, it needs to be wrapped in code to translate the interested sections of LRS into assets that we desire to be end dated. 

In the next post we will explore a simple way of achieving this task.