Want a Field to Either Be a Sequence or User Entered Value
Copy
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.
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>