Published on InterSystems Developer Community (https://community.intersystems.com)

Home > [SOLVED (KIND OF)] Missing something obvious trying to do a lookup in a method

Question
Scott Beeson · Jan 21, 2016

[SOLVED (KIND OF)] Missing something obvious trying to do a lookup in a method

So calling this lookup manually from the console works as expected:

PHR>set key = "WMMC_IMM"
PHR>w ##class(Ens.Util.FunctionSet).Lookup("BlockFeed",key)
1

 

However, calling it from a method with some concatination to build the key is giving me problems:

ClassMethod canSendToState(iParticipant As %String, iFeed As %String) As %Boolean
{
    set k = iParticipant _ "_" _ iFeed
    w "Looking up " _ k,!
    set x = ..Lookup("BlockFeed",k,"not found")
    w "x = " _ x,!
}

 

PHR>w ##class("Custom.MHC.Common.Functions").canSendToState("WMMC","IMM")
Looking up WMMC_IMM
x = not found

 

I really don't understand.  X should be 1 

#Beginner #Code Snippet #Ensemble #Unstructured Data

Source URL:https://community.intersystems.com/post/solved-kind-missing-something-obvious-trying-do-lookup-method