Custom Expression issue
In a custom expression,why is this allowed: "555-12"+Left(m_primaryExtension,1)+"-"+Right(m_primaryExtension,4) but this is not? IIF(IsPresent(m_primaryExtension),"555-12"+Left(m_primaryExtension,1)+"-"+Right(m_primaryExtension,4),m_nullstring) I get "Parameter of function IIF does not match". Thanks, Keith
October 4th, 2010 9:02pm

Hi There, Where is the parameter "m_nullstring" defined? Is there any reason why you've decided to use that instead of just ""? Thanks B
Free Windows Admin Tool Kit Click here and download it now
October 7th, 2010 1:04am

m_nullstring is a MV attribute that never has a value (always NULL). I flow that instead of the empty string "" because NULL deletes the value in the CS. Thanks, Keith
October 7th, 2010 9:25pm

Hi Keith, Have you tried building the expression using the function feature instead of the function evaluator and see if it has the same result? e.g -> IFF Function Definition Boolean = Custom Expression -> IsPresent(m_primaryExtension) True = "555-12"+Left(m_primaryExtension,1)+"-"+Right(m_primaryExtension,4) False = m_nullstring Just curious if this comes out with the same result.... Thanks B
Free Windows Admin Tool Kit Click here and download it now
October 7th, 2010 9:41pm

Keith, The problem is with the "555-12"+Left(m_primaryExtension,1)+"-"+Right(m_primaryExtension,4), if you alter it to include only one function, it seems to work fine. If I leave it in the form you specified I also get the error. This should not be its behaviour I think. On the other hand Blain's suggestion works fine. Odd, but it works... I've seen this behaviour with the EscapeDNcomponent function as well. It doesnt behave in Nested IIF's but works fine in a custom expression without IIF's Nice hint Blain.http://setspn.blogspot.com
October 7th, 2010 11:59pm

Yep, Blain's suggestions works fine. However, the function i supplied actually needs to be nested inside another IIF. Not sure if that will be possible. Would really be nice if we had an AND to work with. It should be: If "Extension" is present AND "Show Phone Number" is TRUE then... Thanks for the help though!! Keith
Free Windows Admin Tool Kit Click here and download it now
October 8th, 2010 5:06pm

Hi There, You can nest IIF statements... here is an example... ---- snip ------ That said, your first one can be done with a nested IIF statement -> IIF(IsPresent(sample),IIF(IsPresent(sample2),"both present","first one present"),"first one not present") This checks function checks to see if the first value is present and then checks to see if the second one is present. The strings in the different true/false areas of the IIF determine what will be output. ---- end snip ------ I have explained this in quite a bit of detail in this thread -> http://social.technet.microsoft.com/Forums/en-US/ilm2/thread/7043488f-ccf0-42b0-8b69-7329e46f6594 Thanks B
October 14th, 2010 11:38pm

Hi there, I would log this one into connect as a bug. I find it interesting now that I've played with it a lot more that you can do the following -> Trim(Left(sn,1) + "Test") But yet you cannot do Trim("Test" + Left(sn,1)) Seems to be an error in the parser for the functions. IMHO. Thanks B
Free Windows Admin Tool Kit Click here and download it now
October 15th, 2010 12:14am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics