AnsweredAssumed Answered

Macro capture value property

Question asked by SoporteCAcma on Mar 31, 2017
Latest reply on Apr 3, 2017 by SoporteCAcma

Hello, 

 

I have a change order workflow macro (CHG) that capture property value in sequence 10. The macro work ok. The macro is:

___________________________________________________________________________________________________

send_wait(0, top_object(), "call_attr", "prp", "sync_fetch", "STATIC", format("object_id=%d AND sequence=10", chg.id), -1, 0);
object found_prp;
object propiedad;
string valor;
found_prp = msg[0];
send_wait(0,found_prp,"dob_by_index","DEFAULT",0,0);
propiedad = msg[0];
send_wait(0,propiedad,"call_attr","value","get_val");
valor = msg[0];

 

if (valor != "Sí") {
send_wait( 0, top_object(), "call_attr", "api", "update_object_super", (uuid)"0C7E35F48667B14D863808B2B0D8800B", persistent_id, 0, "status", "tskstat:7104" );
}

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Now I need adapter this macro that they work in request workflow (CR). I have tried, but I get a error "Parse error at : "owning_cr=cr:402425 AND sequence=10" (Bad where clause) "

________________________________________________________________________________________

send_wait(0, top_object(), "call_attr", "cr_prp", "sync_fetch", "STATIC", format("owning_cr = %s AND sequence=10", cr.persistent_id), -1, 0);
object found_prp;
object propiedad;
string valor;
found_prp = msg[0];
send_wait(0,found_prp,"dob_by_index","DEFAULT",0,0);
propiedad = msg[0];
send_wait(0,propiedad,"call_attr","value","get_val");
valor = msg[0];

 

if (valor != "Sí") 
{
send_wait( 0, top_object(), "call_attr", "api", "update_object_super", (uuid)"CAD0904DDFC2004E8F2D3F1086B3F442", persistent_id, 0, "status", "tskstat:7104" );
}

-----------------------------------------------------------------------------------------------------------------------------------------------------

Any idea?

 

Regards.

Outcomes