cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - Find Function For Enable Rule

Former Member
0 Kudos

Hi all,

I want to use enable rule for a field on edit transaction screen. There is a string property as "EDITABLEFIELDS" and it has names of editable fields. (ex. EDITABLEFIELDS: IMEINO,AHBNO,PRODUCTID,SERIALNUMBER...)

I want enable rule to work according to the "EDITABLEFIELDS" property has that field name. But it does not work correctly. How should i set this enable rule?

Best Regards,

Serkan DEMIR

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

I solved my problem to move and set EDITABLEFIELD property under main object. I could not reach "EDITABLEFIELDS" property when it's under the object which edit transaction works for.

Thanks all.

Best Regards,

Serkan DEMIR

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

try the following:

- add a label to the screen and set the update rule to :>Current Object> "EDITABLEFIELDS" Property... if it does not show the content (IMEINO,...) you need to find another way to access that EDITABLEFIELDS Property (e.g. via other objects in the property browser)

- wrap the FIND with an EQBOOL to enforce a boolean context on the FIND (since about a year or so, agentry changed the way implicit conversion works in rules...)

- use the test environment to debug the rule

Daniel

Former Member
0 Kudos

Hi Daniel,

-I tried to reach EDITABLEFIELDS property for a label as you said. I reached and saw the data on the screen.

- to wrap FIND with EQBOOL function, what should i give as second parameter for EQBOOL? can i write hardcoded "true" or "false" ?

Thanks,

Serkan

Former Member
0 Kudos

Yes, hardcoded "true"/"false" should do it. If you have problems with that, try hardcoded "1"/"0".

Former Member
0 Kudos

I did like this, but it gives always false:

Former Member
0 Kudos

Hi,

strange, the rule looks okay to me.

In one of our projects, we had to check if ExecutionPath contains WOEQ. We came up with this rule, maybe you can adapt it for your situation (FIND returns different results for Boolean, String and Integral Number contexts; see documentation):

Daniel

jason_latko
Advisor
Advisor
0 Kudos

Serkan,

FIND will return a boolean if used for an enable rule in a boolean context, so you don't need the EQBOOL wrapper.  Just do the FIND followed by the source string followed by the target string you are searching for, and the rule will return TRUE if found, and FALSE if not.

I wouldn't recommend using Current Object if you can avoid it.  Always fully qualify your object names where possible.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason,

As you recommended , i used fully object qualify name by going other objects. But the rule still gives false everytime.

Thanks,

Serkan

former_member208808
Active Participant
0 Kudos

Hi Serkan,

FIND will return you true or false when its in enable rule.

Just for that sake, make sure your string returning you correct case because your rule that is seen in above replies all are case sensitive search.

Or Include false in your rule to make it case insensitive.

Regards,

AK

Former Member
0 Kudos

Hi,

it might be a good test to try:

FIND

     "ABCDE"

     "BCD"

it should return true. If not, you have to play with the rule until you do... after that you can replace the constants.

Daniel

Former Member
0 Kudos

Hi Daniel,

I can get the resutl what i want by doing your simple test. But i can not get source string from the object's property which target edit transaction.

jason_latko
Advisor
Advisor
0 Kudos

Serkan,

Debug the rule using the old ATE or new built in ATE in Eclipse Agentry plugin.  Show us what the debugger is returning for your rule.

Jason Latko - Senior Product Developer at SAP