Forum Discussion
christopher_gillis
8 years agoCommunity Manager
Hello,
The data in the form is stored inside of an <iframe>, so you will not be able to access the fields on the form without first entering the context of that <iframe> like Eli did in his example where he first referenced the
Christopher Gillis Aras Labs Software Engineer
instanceFrame before calling the handleItemChange.
The code sample below should allow you to update the value of the field without writing the value to the cache or to the database.
var itemNumberElements = parent.frames["instance"].contentDocument.getElementsByName("item_number");
// Both the parent <div> of the field as well as the <input> we want share the same name,
// so we will loop through them and only update the value of the input
itemNumberElements.forEach(function(node) {
if (node.nodeName === "INPUT") {
node.value = "123";
}
});
Chris
Christopher Gillis Aras Labs Software Engineer