I need your opinion on the below Spel,
send_wait(0, top_object(), "call_attr", "chg", "sync_fetch", "RLIST_DYNAMIC", format("summary like '%xxyyzz%'", this.chg), -1, 0);
And I am expecting true or false value on msg. That means if the summary pattern matches the given criteria msg will be 1 or else 0.
Is it a write approach?
Before we answer the above, can you describe what this code is meant to do? And what specifically are you trying to achieve here with the spel code? Are you testing for a specific string to appear in the summary field and have a reaction take place based on the presence/absence of the given string?
Exactly David-Ng . I want test a particular keyword presence on summary and based on want to do some operation. The above spel is just to validate the presence of a given string in summary filed.
The sync_fetch method will return a number of records, not True/False, so that's not the right approach to test. Note that a search by summary will be expensive - in terms of peformance - so I'd advise against it.
It's much easier to use the OOB capabilities in SD and perform this test in an Event associated with the Initial activity type. You can design your condition with a Site Defined Condition macro and perform the necessary actions using an Action Macro.
Using CA SDM::.SPEL::. Sindex instead of sync_fetch could be a better way to validate string.
my 2 cents.
Dear cdtj , The solution is amazing and I loved the simplicity. Thats perfect answer for my requirement. You rock again! Also learned something new!