Skip to main content

Hello , 

 

I want to know what’s the right syntax to use the condition in custom event :

my condition is : NEW:CUSTOMER like 25% OR 15%.

Here what I’ve used , but it doesn’t work , I guess it’s a wrong syntax , Can anyone help me with that ?

 

Thank you in advance ,

Hanane

Hi @Hanane,

Semi-colon should be the correct operator. Have you tried enclosing the values in single quotes? 

Eg: ‘25%’;’15%’

hope this helps!


Hello @Hanane 

That wouldn’t be a nice solution, but I would make 2 custom actions.

On your first one, you would define the condition :

NEW:CUSTOMER_ID like 15%

And a second one with the condition

NEW:CUSTOMER_ID like 25%

 

Inside these 2 custom actions, you would put the exact same code


Hi @Hanane,

Semi-colon should be the correct operator. Have you tried enclosing the values in single quotes? 

Eg: ‘25%’;’15%’

hope this helps!

I didn’t know it. :)

 

Hello @Hanane 

That wouldn’t be a nice solution, but I would make 2 custom actions.

On your first one, you would define the condition :

NEW:CUSTOMER_ID like 15%

And a second one with the condition

NEW:CUSTOMER_ID like 25%

 

Inside these 2 custom actions, you would put the exact same code

Probably, If I were faced with this scenario, I would use this way.

 

Hello ,

Thank you all for the replies .

the single quotes didn’t work for me .

I included my conditions in my code , so it worked .

I used @romsar idea on another project , it’s very handy as well !

 

Kind Regards,

Hanane


Hello.

Another idea and more handy than the idea I suggested would be to create a custom attribute.

In name, I would put IS_CUSTOMER_ID_OK

In server method, I would put something like 

MyPackageName.Get_Is_Customer_ID_OK(&NEW:CUSTOMER_ID)

 

I would define the procedure like this :

 

FUNCTION Get_Is_Customer_ID_OK(P_CUSTOMER_ID VARCHAR2) RETURN number

IS

BEGIN

 IF P_CUSTOMER_ID LIKE ‘15%’ OR P_CUSTOMER_ID LIKE ‘25%’ THEN

    RETURN 1;

ELSE

    RETURN 0;

END IF;

END Get_Is_Customer_ID_OK;

 

So, with this new attribute, in the event action screen, you put as new condition

IS_CUSTOMER_ID_OK = 1

And this way, you would have just 1 custom action.


It’s a great idea if the conditions are the same .

My requirement is different for each customer_id ( depending on the prefix ) , so I’ll stick with two action events .

 

Thank you ,

Hanane


Reply