ERROR MESSAGE:- TypeError: Cannot call method "get...
# suitescript
s
ERROR MESSAGE:- TypeError: Cannot call method "getFieldValue" of undefined what exactly does this mean wether the value is not or im trying to access a field that doesnot exists?
n
What does your code look like?
s
o_mnth_end_effrt_prev_mnth.getFieldValue('custrecord_json_mnth_end_effrt');
n
What is the type of o_mnth_end_effrt_prev_mnth? Is it record?
h
before o_mnth_end_effrt_prev_mnth this is case of error, clear your record object
s
yes o_mnth_end_effrt_prev_mnth is a custom record load variable
h
use .getValue or may you need .getField
n
can you share more code? This isn't helpful much.
@Habib Salman Habib.getValue is 2.x function. getFieldValue() is 1.0 function
s
but im asking getFieldValue from null means im trying to access a field which dosent have any value but what does getFieldValue from undefined mean
n
It means that "o_mnth_end_effrt_prev_mnth" is undefined.
s
my code is in 1.0 so im using this getFieldValue()
im getting this error only few times so o_mnth_end_effrt_prev_mnth is not a problem
n
it is.
s
yes
n
share the code
s
var s_effrt_json_2_prev_mnth = o_mnth_end_effrt_prev_mnth.getFieldValue('custrecord_json_mnth_end_effrt2'); var s_effrt_json_3_prev_mnth = o_mnth_end_effrt_prev_mnth.getFieldValue('custrecord_json_mnth_end_effrt3'); var s_effrt_json_4_prev_mnth = o_mnth_end_effrt_prev_mnth.getFieldValue('custrecord_json_mnth_end_effrt4');
and after this if(s_effrt_json_1_prev_mnth) if(s_effrt_json_2_prev_mnth) if(s_effrt_json_3_prev_mnth)
im checking wether the value exists or not
n
add the log after each of those .getFieldValue() statement to know where your code is crashing.
s
ok