- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 05:06 PM
Hi there,
I have created a system property : ab.provision.workflow, type : true/false
I want to put an 'if condition' in workflow to check if this system property's value is true and current requester is from some abc company then fire the next sc task.
Can anyone please share the conditions, how can i achieve this?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 05:21 PM
Hi Jyo,
Here you go. Untested code.
answer = ifScript();
function ifScript() {
var prop = gs.getProperty('ab.provision.workflow');
var comp = current.u_requestor.company.getDisplayValue(); //I am assuming u_requestor is the field company name
//var comp = current.variables.VARIBALENAME.getDisplayValue(); //for catalog variables
if(prop == 'true' && comp == 'company name')
{
return 'yes';
}
return 'no';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 05:21 PM
Hi Jyo,
Here you go. Untested code.
answer = ifScript();
function ifScript() {
var prop = gs.getProperty('ab.provision.workflow');
var comp = current.u_requestor.company.getDisplayValue(); //I am assuming u_requestor is the field company name
//var comp = current.variables.VARIBALENAME.getDisplayValue(); //for catalog variables
if(prop == 'true' && comp == 'company name')
{
return 'yes';
}
return 'no';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 05:25 PM
Comment line 4 and use line 5 in case it is a workflow on requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 05:52 PM
Thanks Pradeep, that was really helpful also I am just wondering for the requested_for company:
Actually the company is not there on the item form, but for requested_for I can call it like this right,
var comp = current.requested_for.company.getDisplayValue();
or
var comp = current.variables.requested_for.company.getDisplayValue();
Please guide.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 07:55 PM
Thanks for the update. Use 2nd line of code i.e
var comp = current.variables.requested_for.company.getDisplayValue();