cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in UDF

Former Member
0 Kudos
53

Hi experts,

Iam using an UDF to check whether values for any of the fields in any of the records are missing. If so i have to skip perticular record. UDF is allowing the records which are without any missing values. But whenever a field with a missing comes its raising exception.

The code Iam using in UDF is

//write your code here

boolean flag = false;

for(int i=0;i<a.length;i++)

{

String temp[] = a<i>.split(" ");

for(int cnt=0;cnt<temp.length;cnt++)

{

if(!(temp[cnt].equals( null )))

{

flag = true;

}else

flag = false;

if(flag = true)

result.addValue(a<i>);

} }

If the flag is false I want it to skip that record and continue with next one.

Thanks&Regards,

Reyaz.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Reyaz,

you need more than only a UDF. first see that the content of the incoming element is set right. There should be no context change! After the UDF you need a "split by value (each value)". After that you need a "exists".

Regards Mario

Former Member
0 Kudos

HI,

suppose a is the input value which is to be checked

For(i=0;i<a.length;i++)

{

if(a{i}.equals(""));

{

output the supress value

}

else

{

result.addValue(a{i});

}

}

This will work

Thnx

Chirag

Former Member
0 Kudos

Hi Chirag,

My logic also works similar to that you hace given. But problem is about the command to be used for supressing.

Thanks&Regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

U could try the following functions inside the loop which suppresses the value in Chirag's code:

result.addValue(SUPPRESS) OR resultlist.addValue(SUPPRESS)

OR

ResultList.Suppress(Suppressed Value)

Regards,

Jyotika.

Pls reward points if useful.