Combining before suffix with code suffix

Posted by matman on 23-Sep-2014 09:10

I can use {!status#code}, but not {!status#code#before} or {!status#before#code}. These last two only return the ID, not the integration code for these enumerated values. Any other way to get the integration codes? 

Posted by Godfrey Sorita on 24-Sep-2014 09:51

Below is a sample code you can use as reference:

/*
||==============================================||
||Status Name    ||  Code         ||  ID        ||
||==============================================||
||Created        ||  created      ||  110088204 ||
||For Approval   ||  forApproval  ||  110088212 ||
||==============================================||
*/
status_before_id = {!status#before};
status_before_code = rbv_api.getCodeById("transaction12", "status", status_before_id);

if (status_before_code = "forApproval") return "Validation Message Here.";

Kindly let me know if this code works for you.

Thank you very much,

Godfrey

All Replies

Posted by Godfrey Sorita on 23-Sep-2014 09:41
You can use getCodeById API to convert the returned value to a picklist code.
Posted by Godfrey Sorita on 24-Sep-2014 09:51

Below is a sample code you can use as reference:

/*
||==============================================||
||Status Name    ||  Code         ||  ID        ||
||==============================================||
||Created        ||  created      ||  110088204 ||
||For Approval   ||  forApproval  ||  110088212 ||
||==============================================||
*/
status_before_id = {!status#before};
status_before_code = rbv_api.getCodeById("transaction12", "status", status_before_id);

if (status_before_code = "forApproval") return "Validation Message Here.";

Kindly let me know if this code works for you.

Thank you very much,

Godfrey

Posted by matman on 26-Sep-2014 04:12

Works, thanks a lot Godfrey!

This thread is closed