Aras Innovator Platform

Want a Field to Either Be a Sequence or User Entered Value

You want to enable a field on the form to be a sequence value or allow the user to enter a value.

Technique

Use the classic Aras Innovator API top.aras.getNetSequence() method, which returns the next sequence value from the server.

Note
The classic API will eventually be eliminated, and this method will become available on the IOM Innovator object as Innovator.getNetSequence().

Using the Form Tool we add an HTML Field to the Form, which we use to insert the HTML and JavaScript code for to provide the button to get the next sequence value and update the Field value and client cache.

HTML Field Code

<a href="javascript:getNextNumber();">
<img src="../images/Sequence.svg” border="0" style="max-width: 20px; max-height: 20px;">
</a>
<script>
function getNextNumber() {
// Get the next sequence value.
var seq = top.aras.getNextSequence("","Default Part”);

// This will update the client cache with the new value.
handleItemChange(“item_number”, seq);
}
</script>