Hello Guys, Using a suitelet I’m setting up the su...
# suitescript
n
Hello Guys, Using a suitelet I’m setting up the sublist values as below from a Saved search but getting below error once the script is triggered!! Kindly help me here!!?
Copy code
Error:"type":"error.SuiteScriptError","name":"SSS_MISSING_REQD_ARGUMENT","message":"Sublist.setSublistValue: Missing a required argument: options.value
But when I comment the below code snippet the code works just I don’t get any value for these fields!! Code Snippet:
Copy code
subList1.setSublistValue({
                    id: 'sublist_subsi2',
                    line: cnt,
                    value: result.getValue({
				          	 name: "formulacurrency",
					         summary: "SUM",
					         formula: "CASE WHEN {subsidiary.internalid} = '8' THEN {amount} ELSE 0 END",
					         label: "Elimination subsidiary"
				      		})
                });
             
              

               subList1.setSublistValue({
                    id: 'sublist_subsi4',
                    line: cnt,
                    value: result.getValue({
				         name: "formulacurrency",
				         summary: "SUM",
				         formula: "CASE WHEN {subsidiary.internalid} IN ('1','3','4','5') THEN {amount} END",
				         label: "Subsidiary 1"
		      		})
                });

                  subList1.setSublistValue({
                    id: 'sublist_subsi3',
                    line: cnt,
                    value: result.getValue({
				        name: "formulacurrency",
				         summary: "SUM",
				         formula: "CASE WHEN {subsidiary.internalid} = '7' THEN {amount} END",
				         label: "subsidiary 2"
		      		})
                });

                    subList1.setSublistValue({
                    id: 'sublist_subsi1',
                    line: cnt,
                    value: result.getValue({
				        name: "formulacurrency",
				         summary: "SUM",
				         formula: "CASE WHEN {subsidiary.internalid} = '6' THEN {amount} END",
				         label: "Subsidiary 3"
		      		})
                });
n
Never seen a formula specified in a getValue for results, don't think that's valid. Also you have more than one formula column so I'm pretty sure you need to work differently to identify which one you're wanting to reference using the column index. I'd log what value you're getting from that getValue, I'm guessing that's not working at all/how you think. You may also need to accommodate columns with no value so that you can set the sublist value to an empty string or something.
n
Hi @NElliott I have adde ELSE part as 0 in the formula and not i’m not getting Error but I’m getting all the values in all the columns as 0!! I don’t understand why!! since the saved search is giving me Amounts for the same