User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:workflow_tricksandtips [2021/04/20 23:33]
joebordes [Execute multiple commands in one expression]
en:workflow_tricksandtips [2021/05/05 20:47] (current)
joebordes [Execute multiple commands in one expression]
Line 25: Line 25:
 <​code>​explode('​x',​ id)</​code>​ <​code>​explode('​x',​ id)</​code>​
  
-Supposing we save that into the context variable ​`wsid`, then the expression for the update field would be+Supposing we save that into the context variable ​"wsid", then the expression for the update field would be
  
 <​code>​concat('<​a href="​index.php?​module=cbReview&​action=DetailView&​record=',​ getFromContext('​wsid.1'​),​ '">​A review has been made.</​a>'​)</​code>​ <​code>​concat('<​a href="​index.php?​module=cbReview&​action=DetailView&​record=',​ getFromContext('​wsid.1'​),​ '">​A review has been made.</​a>'​)</​code>​
Line 40: Line 40:
 Since we know that setToContext will return a truish value, we know that the command in the "​then"​ part will always be executed and the "​else"​ ignored and the setToContext has been executed so we can get the value we need from the context. Tricky but effective. Since we know that setToContext will return a truish value, we know that the command in the "​then"​ part will always be executed and the "​else"​ ignored and the setToContext has been executed so we can get the value we need from the context. Tricky but effective.
  
 +====getCRMIDFromWSID====
 +
 +The correct solution arrived in May 2021 by the hand of one of our new community members, [[https://​github.com/​MiquelPerezGiner|Miquel Perez]]. He added a [[https://​github.com/​tsolucio/​corebos/​commit/​6f53bcf4e3850a9f20c027cc9fb432fc606ff129|new workflow expression function]] that directly obtains the CRMID from the Web Service ID so the expression would end up looking like this:
 +
 +<​code>​concat('<​a href="​index.php?​module=cbReview&​action=DetailView&​record=',​ getCRMIDFromWSID(id),​ '">​link</​a>'​)</​code>​
 +
 +Thanks!