Created
July 16, 2013 21:45
-
-
Save mhulse/6015438 to your computer and use it in GitHub Desktop.
Caché 2009.1 - DTI Lightning 7.7.x: Get the latest entry from the SEOStoryLookup table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> | |
<script language="cache" method="lookup" arguments='story:dt.cms.schema.CMSStory=-1' returntype="%String" procedureblock="1"> | |
; Initialize result value: | |
set result = "" | |
; dt.cms.schema.CMSStory? | |
set:($isobject(story)) story = story.%Id() // Get its ID. | |
; Do we have a valid CMSStory ID? | |
if ($isvalidnum(story)) { | |
; Run the query: | |
try { | |
; Embedded SQL statement: | |
&sql(SELECT TOP 1 SEOStoryLookup.seoURL INTO :result FROM dt_cms_schema.SEOStoryLookup WHERE CMSStoryId = :story ORDER BY SEOStoryLookup.created DESC) | |
} catch(e) { | |
; What to log and where? | |
} | |
} | |
; Return result or empty string: | |
quit result | |
</script> | |
<csp:comment> | |
<csp:object name="gStory" classname="dt.cms.schema.CMSStory" objid="29615001"> | |
#(##class(csp.rg.assets.methods.story).lookup(gStory))# | |
</csp:comment> | |
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment