The following code:
xp:this.afterPageLoad<![CDATA[#{javascript:
viewScope.org=@DbLookup(@DbName(), “vAllByForm”, “MasterDbInfo”, “mdiOrgAbbrev”);
if(!viewScope.org || viewScope.org==“”) viewScope.org=“DOE”;
}]]></xp:this.afterPageLoad>
causes the server to NSD if the @DbLookup is run, and it works fine (producing “DOE” in viewScope.org) if that line is commented out.
-
Sometimes it actually does work, producing the expected Organization name, but then the next page load causes it to crash and generate an NSD. I have two such, one where it crashed straight away and one where it pulled the org and crashed next page load.
-
When I say it “always” happens, I mean the two times I tried it, it crashed. The numerous times I tried it either without the line, or with the line commented out, it did not crash.
-
I’m going to fiddle with doing this using the global JS objects…
EDIT:
- The global JS objects work fine.