Skip to Content
avatar image
Former Member

User defined function Problem

if (a.equals= = 311&&b.equals == SL02&&c.equals==SL01))

return "SL04";

elseif(a.equals= = 311&&b.equals == SL01&&c.equals==SL11))

return "SL01";

Problem in this UDF

Regards

Skancham

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jun 18, 2010 at 05:28 AM

    you dont need UDF at all,use equals function(TEXT) and "AND" function,it will work.

    Regards,

    Raj

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 18, 2010 at 05:30 AM

    Hi,

    Your UDF code syntax is totally wrong. you are using the equals method and using the == also. It should not be like that.

    Please modify the code as shown.

    if (a.equals("311")&&b.equals("SL02")&&c.equals("SL01"))
    return "SL04";
    elseif(a.equals("311")&&b.equals("SL01")&&c.equals("SL11"))
    return "SL01";

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2010 at 08:36 AM

    Hi,

    Check this code or you can directly use the predefined AND and EQUALS functions.

    if (a.equals("311") && b.equals("SL02") && c.equals("SL01"))

    return "SL04";

    elseif(a.equals("311") && b.equals("SL01") && c.equals("SL11"))

    return "SL01";

    Regards

    Ramesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2010 at 12:36 PM

    why are you using UDF. You should use a UDF only if its not possible with Graphical node functions. Your conditions can easily be achieved without an UDF. Check the node functions and do it.

    Thanks

    S

    Add comment
    10|10000 characters needed characters exceeded