Pass values from Method to form fields

Hello, I would like to pass a value to a field of an itemtype by code. I have put it in the "onBlur" event of another field
The case is that I pass the value and it shows it on the screen, but when I click on save (lock), it deletes the data.

What am I doing wrong?

My code:

var input = getFieldByName("mp_dni");
input.getElementsByTagName("input")[0].value = "AAAAAAAAAA";

After passing the value to it:

when i lock:

Too many thanks!!!.

Parents
  • You code just change the visible value in the form, but doesn´t update the property in the DOM.

    Try to use something like this: window.handleItemChange("myproperty", "123");

  • Thank you very much Angela for your help, you are always there to help!!

    The truth is that I am a bit overwhelmed with ARAS and Javascript, every little step is a leap into the void.
    I'm thinking of taking a Javascript course, because I'm afraid that many of the things that are hard for me to do are basic things, and I should know them.

    Now, Google and this forum are my best "friends", hahaha.

    Thank you so much!!!

  • Don´t worry, PLM will always be hard, but the level you rate as "hard" will change. 

    I needed 3 months to understand how relationships work und 3 years to feel comfortable enough with very basic coding (first action with copied Method...). 

    If you have a subscription, check out the developers guide. "window.handleItemChange" is not classic JS, but a Aras specific function. The developers and programmers guide cover most of the basics you need for Aras specific coding.

    Best regards

    Angela

    P.S.: Do you want to know MY new best friend regarding generic JavaScript questions? -> ChatGDP !
    It´s sucks regarding specific Aras Innovator questions, but is a game change for literally everything else!

  • Hello, yes im suscriber, i downloaded this PDF:

    And many others too, that I did not have. hehe.

    Yes, chapgpt is our new very best friend, that when it lets in and it works!!!!

Reply Children
  • Hi,

    the programmers guide is more an appendix to the developers guide. 

    The developers guide is on the Aras ftp and only available for subscribers. There should be a folder "training" on level 1. Click through all the folders until you find the English guides. There are no guides for every Aras version, so don´t be confused if you need a few minutes until find something.

    Or even better: Attend the Aras developers course. When you have a subscription, it should be free for you to join. This one will definitely help you a lot!

    Angela