This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - case to IOM

zapping - Wednesday, May 26, 2010 11:38 AM:

Hi,
 Is it possible to convert this query to IOM

UPDATE trans
 SET type = CASE
     WHEN type = deb THEN type + '-' deb
     ELSE type + '-' + crd + '-' + substring(type, 1, len(type)) END
WHERE code <> deb AND rcode = crd

or AML.

Cheers,
Zaps



zapping - Wednesday, May 26, 2010 3:16 PM:

Hi,
 Have implemented it using applySQL(). But the onAfterUpdate event created on the trans itemtype does not trigger. Is there anyway to call it.

Thx and cheers,
Zaps



zapping - Thursday, May 27, 2010 2:40 AM:

Hi,
 Was able to do it this way.

1. issued an action=GET to type=TRANS with an attribute WHERE = code<> deb and rcode = crd.
2. used FOR loop on the result of apply().
3. inside the FOR loop built up an action=EDIT on the type=Trans and implemented the CASE part using IF THEN ELSE statement to setup the property.

Hope this is better and was also able to get the onAfterUpdate event of trans.

Cheers,
Zaps.