2

Recently I upgraded my Guidewire studio from version 8 to 9. From that onwards the database Queries are throwing error while running in scratchpad. The same code works fine in version 8. Please find the code and the error below.

CODE

var object = gw.api.database.Query.make(Account).select()
print("Count : "+object.Count)

ERROR

gw.lang.parser.exceptions.ParseResultsException: Gosu Scratchpad.gsp

Errors:

Could not resolve symbol for : Account [line:3 col:41] in
line 2:
line 3: var object = gw.api.database.Query.make(Account).select()

Expected Type: Type<T>
Line Number: 3  Column: 41

Could not resolve symbol for : Account [line:3 col:41] in
line 2:
line 3: var object = gw.api.database.Query.make(Account).select()

Expected Type: Type<T>
Line Number: 3  Column: 41


    at gw.internal.gosu.parser.ParserBase.verifyParsedElement(ParserBase.java:283)
    at gw.internal.gosu.parser.ParserBase.verifyParsedElement(ParserBase.java:254)
    at gw.internal.gosu.parser.GosuClassParser.parseDefinitions(GosuClassParser.java:471)
    at gw.internal.gosu.parser.GosuClass.compileDefinitionsIfNeeded(GosuClass.java:1539)
    at gw.internal.gosu.parser.GosuClass.compileDefinitionsIfNeeded(GosuClass.java:1482)
    at gw.internal.gosu.parser.GosuClass.isValid(GosuClass.java:919)
    at gw.internal.gosu.parser.GosuProgram_Proxy.isValid(gw.internal.gosu.parser.GosuProgram_Proxy:2)
    at gw.internal.gosu.parser.GosuProgramParser.parseExpressionOrProgram(GosuProgramParser.java:190)
    at gw.lang.Gosu.runWithFile(Gosu.java:425)

Any Help will be greatly appreciated.

Aravind Pillai
  • 739
  • 7
  • 21
  • Is your environment aware of your 'Account' type/entity? It looks like it can't parse the name 'Account' any further, and is looking for any generic type. – ebwb Nov 07 '16 at 22:14
  • I didn't get that. Could u plz elaborate what to do? – Aravind Pillai Nov 08 '16 at 01:49
  • The error makes it sound like the parser doesn't understand what an 'Account' is. Perhaps you're missing a reference to the file where the declaration and definition of 'Account' lives? – ebwb Nov 08 '16 at 15:03

3 Answers3

4

In v9, you have to install DCEVM to run queries in scratch pad

1

i am not sure if this works. can you try the below and see it that works.

var object = gw.api.database.Query.make(entity.Account).select()

print("Count : "+object.Count)

Arun Kumar Mani
  • 337
  • 2
  • 7
1

V9 Gosu Scratch pad needs DCEVM. This is just a jar, that can be installed. You will get it form DCEVM

Naresh Hawk
  • 149
  • 3
  • 5