I think based on your question it's more how to invoke your logic on an asset spec being set rather than how to validate that it is an IP address. If you can do it on the Maximo side (with an inbound object structure processing automation script) it would be easier to maintain but you wouldn't have offline support and the user gets stuck typically undoing changes which isn't great.
I haven't tried to do this personally, but taking a quick glance I don't see why this wouldn't work. If you modify the text item with the id id="AssetDataManager.SpecificationsView_listItemTemplate_groupitem_uivalue", you can expand it to provide an event handler to call your custom logic. For example:
<text editable="true" id="AssetDataManager.SpecificationsView_listItemTemplate_groupitem_uivalue" label="Value" layoutInsertAt="val2" resourceAttribute="uivalue">
<eventHandlers id="EMXAssetDataManager.SpecificationsView_listItemTemplate_groupitem_uivalue_eventHandlers">
<eventHandler class="custom.handlers.EMXDataManagerHandler" event="validate" id="EMXAssetDataManager.SpecificationsView_listItemTemplate_groupitem_uivalue_eventHandlers_validate" method="validateSpec"/>
</eventHandlers>
</text>
Then if in the custom/handlers folder you created a custom handler (if you copy above it would be EMXDataManagerHandler) with a validateSpec function, your logic would fire as users change it. You would have to analyze the spec to ensure it's one that you should be handling, and make sure to reference the uivalue attribute (not alnvalue) when doing your validation.
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
------------------------------
Original Message:
Sent: Tue August 25, 2020 09:18 AM
From: Steve Lee
Subject: Maximo Anywhere formatting validation
Hi, Has anyone added some field formatting validation to a Maximo Anywhere field.
We need to add a formatting check to an asset attribute field contains a valid IP Address.
We have added a new assetattribute datatype of IPADDR which is a synonym of ALN for us to use to identify when to check the formatting but cannot see where to add the js code to perform the validation.
We want to implement this on the AssetDataManager application as a starting point.
Any help will be appreciated
regards
Steve
------------------------------
Steve Lee
Maximo Technical Sales Specialist
IBM
Leeds
------------------------------
#AssetandFacilitiesManagement
#Maximo
#MaximoAnywhere