Updating from data using c#

Hi, I need help. I'm doing something that should be easy, but no!!!.

I want to schedule an event that when the data is saved, save option, make me a count and update the form. I have created the onAfterUpdate event on the ItemType i tried  too onBeforeUpdate and the same.

I have a display (ItemType), with a related table. In this table they choose the vacation days of the year and when saving, I put an event so that it makes the sum of the chosen days and updates the corresponding ItemType attribute.

I have tried it by AML code, but it gives me this error, I suppose that on the server side, it does not allow an edit to be made to a table in edition.

CodigoAML = "<Item type='AIT User' action='edit' where=\"id = \'"+sourceID+"\'\"><mp_dias_vac_restantes>"+vacDiasRestantes+"</mp_dias_vac_restantes><mp_dias_vac_apuntadas>"+vac_DiasApuntados+"</mp_dias_vac_apuntadas><mp_dias_vac_disfrutadas>"+vac_DiasDisfrutados+"</mp_dias_vac_disfrutadas></Item>";

var ResultadoEdit = innovator.applyAML("<AML>" + CodigoAML + "</AML>");

I get this error:

I have also tried it by code passing the values through:

var input = getFieldByName("mp_dias_vac_apuntadas");
input.getElementsByTagName("input")[0].value = vac_DiasApuntados;
window.handleItemChange("mp_dias_vac_apuntadas", vac_DiasApuntados);

This code was suggested to me by AngelaP and it works perfectly in forms, but it is Javascript and on the client side.

But it also gives an error, it does not recognize "getFieldByName", nor "getElementsByTagName".

We have Version: Aras Innovator Version 11.0 SP9  Build: 6549

Any suggestions?.

Too many thanks!!!

Parents Reply Children
No Data