cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for checking 3 values

Former Member
0 Kudos

Hi Expert,

Can anybody help me out for creating an UDF for below requirements?A,B and C are input field and based upon the below condition the output for D will be decided.

if A starts with FX and B starts WOOT and C = ZDS

then D=317914431 (or any other value)

Regards

Faisal.


Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Faisal,

why you need the UDF for this req. You can achieve this using standard function.


A --> startwith FX(text function) -->

B --> startwith WOOT (text function) -->AND --->> IF without else --> map constant 317914431 to target

B --> startwith ZDS(text function) -->AND

regards,

Harish

Former Member
0 Kudos

Hi Harish,

I agree with you, but we may get different values for A, B and C and based upon that we need to decide the target value.

Regards

Faisal

Harish
Active Contributor
0 Kudos

Hi Faisal,

so your req. is having list of value of A, B and C and based on that you need populate list of value?

regards,

Harish

Former Member
0 Kudos

Hi,

Yes you are right. Sorry my requirement was not clear.

Regards

Faisal

Harish
Active Contributor
0 Kudos

Hi Faisal,

It is better to maintain the values set in table rather then in UDF. In UDF you need to hardcode the values. but you can check the below code if it suits your req.

Input paramter = A, B, C.

String res = "res";

String Apre = "FX";

  String Bpre = "WOOT";

  String Cpre = "ZDS";


  if(A.startsWith(Apre) && B.startsWith(Bpre) && C.startsWith(Cpre))

  {

  return res;

  }

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Thanks alot.


Regards

Faisal

Answers (0)