This topic is locked
[SOLVED]

 Lookup Field - JavaScript Onload Event

1/17/2018 1:22:46 PM
ASPRunner.NET General questions
I
i.NoLim author

I have a lookup field called "Activities" that is dependent on a different lookup field called "Department." When a department and an activity are selected, the fields "Regular Fee," "Discount," and "Final Fee" are auto-populated. These values reside within table as "Activities." "EPAS." This is working perfectly fine. The issue I'm having is after saving the new entry and trying to update it, the values for "Regular Fee," "Discount," and "Final Fee" are do not get updated.
I've done JavaScript OnLoad events in the past but the value is usually fixed like so,

ctrlREGULARFEE.setValue('100');


How do I set it up so it looks for the value in the lookup table? Do I have to have an if statement for each different "Activity?"

var ctrlACTIVITIES = Runner.getControl(pageid,'ACTIVITIES');

var ctrlREGFEE = Runner.getControl(pageid,'REG_FEE');

var ctrlDISCOUNT = Runner.getControl(pageid,'DISCOUNT');

var ctrlFINALFEE = Runner.getControl(pageid,'FINAL_FEE');
ctrlACTIVITIES.on('change', function(e)

{

ctrlREGFEE.setvalue (' ');

ctrlDISCOUNT.setvalue (' ');

ctrlFINALFEE.setvalue (' ');

});
I
i.NoLim author 1/17/2018



I have a lookup field called "Activities" that is dependent on a different lookup field called "Department." When a department and an activity are selected, the fields "Regular Fee," "Discount," and "Final Fee" are auto-populated. These values reside within table as "Activities." "EPAS." This is working perfectly fine. The issue I'm having is after saving the new entry and trying to update it, the values for "Regular Fee," "Discount," and "Final Fee" are do not get updated.
I've done JavaScript OnLoad events in the past but the value is usually fixed like so,

ctrlREGULARFEE.setValue('100');


How do I set it up so it looks for the value in the lookup table? Do I have to have an if statement for each different "Activity?"

var ctrlACTIVITIES = Runner.getControl(pageid,'ACTIVITIES');

var ctrlREGFEE = Runner.getControl(pageid,'REG_FEE');

var ctrlDISCOUNT = Runner.getControl(pageid,'DISCOUNT');

var ctrlFINALFEE = Runner.getControl(pageid,'FINAL_FEE');
ctrlACTIVITIES.on('change', function(e)

{

ctrlREGFEE.setvalue (' ');

ctrlDISCOUNT.setvalue (' ');

ctrlFINALFEE.setvalue (' ');

});




Well, this is embarrassing.... There's a "Apply on the Edit page as well" checkbox in the "Auto-fill settings" window.