Hello, I was wondering if someone could tell me why my function is not working. Here is my function that I have:
- String Bar_Code(String X)
- {
- //remove serial
- if(X.contains("--"))
- {
- sku4 = X.getPrefix("--");
- }
- else
- {
- sku4 = X;
- }
- //Find Book
- if(sku4.contains("97816804") == true)
- {
- Book3 = Books[Barcode == sku4];
- }
- else if(sku4.contains("9781942") == true)
- {
- Book3 = Books[Barcode == sku4];
- }
- else if(sku4.contains("9780934") == true)
- {
- Book3 = Books[Barcode == sku4];
- }
- else
- {
- Book3 = Books[Book == sku4];
- }
- return Book3;
- }
But when I try to call it with this
- Book3 = thisapp.Bar_Code(input.SKU);
I am getting an error that says invalid collection variable.