I'm new to scripting and have some questions on the coding examples below:
EXAMPLE ONE
**This function runs using the 'before submit' event on the task form, it's getting an error relating to the nlapiGetFieldText function - the error is "nlapiGetFieldText" is not defined - I'm trying to work out why.**
function task() { var primary_meeting = nlapiGetFieldText('custevent5'); nlapiSetFieldValue('custevent20', "YN"); if (1+1 == 2){nlapiSetFieldValue('custevent23', 160);} } EXAMPLE TWO**I need this function to see if either of 2 checkboxes are ticked - custevent 5 and 17 and put a 1 in the field custevent20. The error I get is "missing ) after condition (samplePageInit#4)" - I can't see which bracket is missing, also does the #4 refer to line that the error occurs in as I've notice the number changes.**function samplePageInit() { if ('custevent5' == 'T' or 'custevent17' == 'T'){nlapiSetFieldValue('custevent20', 1);} }EXAMPLE THREE**should this code work if placed in a function I create where it basically takes the value of the checkbox and writes it to another field?**nlapiSetFieldValue('custevent20', nlapiGetFieldText('custevent5'));Your help would be much appreciated.[QUOTE]
[/QUOTE]**edit - all the above are being run on 'before submit' - not before load as I originally stated.