SAP Knowledge Base Article - Public

2773219 - Error While Activating the Script File: Identifier is typed. Collection type is expected.

Symptom

You have created a script and during the save/ activation, below error occured:-

Identifier is typed as 'Node(X.Root)'. Collection type is expected, where X is the custom business object name.

Environment

SAP Cloud Application Studio

SAP Business ByDesign

SAP Cloud for Customer

Reproducing the Issue

  1. Login to SDK.
  2. Open the solution.
  3. Navigate to the script which you have created.
  4. Click on Activate.
  5. Error occured.

Cause

You are using Foreach loop in the script, but the type of the variable which you have declared is not of collection type.

Resolution

For using Foreach loop, the type of the field which you are trying to loop should be of collection/ structure type. For example, Node name which you have declared in your custom BO can used as the type for the field Z, and you can use foreach with this field.

Keywords

Error while activating the script error in action script error while using foreach loop Identifier is typed 'Node(BO.Root)' , KBA , collection type is expected , identifier is typed , identifier error when activating script , AP-RC-BDS-BO , ByDesign Studio BO definition/generation , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , Problem

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions