Hello,
I’m trying to create a function called from WebLingo that take the Workspace Name as an input parameter and return the ID of that Workspace, I have succeeded in retrieving the ID but with additional text [A<1,?,'TotalNum'=17581>] while I want and I expect to see only 17581 (the IT Workspace ID).
1.Is there is something wrong with this function and why it is not reurning only one value i.e. 17581.
2.how can I get the 17581 out of A<1,?,'TotalNum'=17581> in WebLingo using the string function; in other words how I can always get the text between [=] and [>].
function Assoc GetNumberofObjectss( Object prgCtx, String objType )
Assoc retval
CAPICONNECT cnct
Dynamic recs
Integer totalRows
String errMsg
Boolean ok = TRUE
Object session = prgCtx
if !IsError( session )
cnct = session.fDbConnect.fConnection
recs = CAPI.Exec( cnct, Str.Format( 'select DataID from DTree where (ParentID = 2000) AND (Name=''' + objType + ''')' ) )
if Length( recs ) > 0
totalRows = recs[ 1 ][ 1 ]
else
totalRows = Length( recs )
end
else
totalRows = 100
end
if IsUndefined( retval.OK )
retval.TotalNum = totalRows
end
return retval
end
============Web Lingo===================
;String strProjectTitle = "IT Workspace" //Workspace Name
;Object uapiCtx = prgCtx.USession()
;String domainL
;domainL = Str.ValueToString( $Eforming.eUtils.GetWorkspaceID( uapiCtx , strProjectTitle ) )
<script language="JavaScript1.2">
alert("`domainL`");// return A<1,?,'TotalNum'=17581> while I want 17581
</script>
I’m trying to create a function called from WebLingo that take the Workspace Name as an input parameter and return the ID of that Workspace, I have succeeded in retrieving the ID but with additional text [A<1,?,'TotalNum'=17581>] while I want and I expect to see only 17581 (the IT Workspace ID).
1.Is there is something wrong with this function and why it is not reurning only one value i.e. 17581.
2.how can I get the 17581 out of A<1,?,'TotalNum'=17581> in WebLingo using the string function; in other words how I can always get the text between [=] and [>].
function Assoc GetNumberofObjectss( Object prgCtx, String objType )
Assoc retval
CAPICONNECT cnct
Dynamic recs
Integer totalRows
String errMsg
Boolean ok = TRUE
Object session = prgCtx
if !IsError( session )
cnct = session.fDbConnect.fConnection
recs = CAPI.Exec( cnct, Str.Format( 'select DataID from DTree where (ParentID = 2000) AND (Name=''' + objType + ''')' ) )
if Length( recs ) > 0
totalRows = recs[ 1 ][ 1 ]
else
totalRows = Length( recs )
end
else
totalRows = 100
end
if IsUndefined( retval.OK )
retval.TotalNum = totalRows
end
return retval
end
============Web Lingo===================
;String strProjectTitle = "IT Workspace" //Workspace Name
;Object uapiCtx = prgCtx.USession()
;String domainL
;domainL = Str.ValueToString( $Eforming.eUtils.GetWorkspaceID( uapiCtx , strProjectTitle ) )
<script language="JavaScript1.2">
alert("`domainL`");// return A<1,?,'TotalNum'=17581> while I want 17581
</script>