Wrong parameter type: filters is expected as Array

I have created suitelet script. In first suitelet I have added select type fields. I am getting select fields data and passing that to second suitlet through redirect parameters. I get parameters in second sutelet. Now I am passing those parameters to saved search filters. But I am getting error as:  “Wrong parameter type: filters is expected as Array” Please help!

My parameters in second suitelet are,

subsidiaryParameter 2
localGroupParameter 10
periodParameter 11
frequencyParameter 3
batchParameter 3
yearParameter 3

 

Below is my saved search–>

var customrecord_cpa_annual_salary_calculatiSearchObj = search.create({
type: “customrecord_cpa_annual_salary_calculati”,
filters:
[
[“custrecord_cpa_pay_paycode.custrecord_apd_pcm_sequence”,”anyof”,”100″,”63″,”104″,”65″,”101″,”61″],
“AND”
[“custrecord_cpa_sub”,”anyof”,subsidiaryParameter],
“AND”,
[“custrecord_cpa_lg”,”anyof”,logicalgroupParameter],
“AND”,
[“custrecord_cpa_period_no”,”anyof”,periodParameter],
“AND”,
[“custrecord_cpa_paycheck_occ”,”anyof”,frequencyParameter],
“AND”,
[“custrecord_store_cal_batch”,”anyof”,batchParameter],
“AND”,
[“custrecord_cpa_pp_year”,”anyof”,yearParameter],
“AND”,
[“custrecord_cpa_emp_in_annual.custentity_cpa_pay_mode”,”anyof”,”1″]
],
columns:
[
search.createColumn({
name: “custrecord_apd_pcm_sequence”,
join: “CUSTRECORD_CPA_PAY_PAYCODE”,
summary: “GROUP”,
label: “Sequence”
}),
search.createColumn({
name: “custrecord_cpa_amount”,
summary: “SUM”,
sort: search.Sort.ASC,
label: “Amount”
}),

]
});
resultObj = [];
var saveSearchResult = customrecord_cpa_annual_salary_calculatiSearchObj.run()
saveSearchResult.each(function (item) {
obj = {}
obj.sequence= item.getValue({ name: “custrecord_apd_pcm_sequence”,
join: “CUSTRECORD_CPA_PAY_PAYCODE”,
summary: “GROUP”,
label: “Sequence”});
obj.amounts= item.getValue({name: “custrecord_cpa_amount”,
summary: “SUM”,
sort: search.Sort.ASC,
label: “Amount”});
resultObj.push(obj)
return true
})
return resultObj;
}

 

Beginner Asked on March 4, 2023 in SuiteScript.
Add Comment
2 Answer(s)

Hi,

You are missing a comma after your first “AND”.

Thanks,

Chris

Intermediate Answered on March 6, 2023.
Add Comment

oops! Thanks Chris 🙂

Beginner Answered on March 6, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor