The CreatorCon Call for Content is officially open! Get started here.

what is new SNC.PlannedTaskAPI();

moulik1
Kilo Guru

Hi,

Can anyone explain what is "new SNC.PlannedTaskAPI();". I could not find it in script includes. Please help

Thanks

9 REPLIES 9

corbettbrasing1
Mega Guru

Its something that we don't have access too.   If you don't belive me you can install codeSearch or Developer Search from the share site and search for it all day long.   You wont find it.   I had the same questions and have already been down the road of...us just not having access.  



Corbett Brasington, PMP, CSM


If this answered your question please mark answered and close the thread.   Have a great day!


arun_vydianatha
ServiceNow Employee
ServiceNow Employee

moulik SNC.PlannedTaskAPI is a Java API.



Through our Rhino engine we can expose Java APIs to JavaScript layer and those APIs are typically called with SNC.<API_NAME>


PlannedTaskAPI is the core of Project Management API. Our recalculation logic for Projects reside in Java layer and they are invoked through SNC.PlannedTaskAPI


I am pretty sure this means you can invoke and call SNC.PlannedTask() it but you cannot edit or view the code in anyway correct Arun?   If you want to see everything associated with that object or the functions that are a part of it you can use this....



You can use Object.getOwnPropertyNames() to get all properties that belong to an object, whether enumerable or not. For example:


console.log(Object.getOwnPropertyNames(Math)); //-> ["E", "LN10", "LN2", "LOG2E", "LOG10E", "PI", ...etc ]

You can then use filter() to obtain only the methods:


console.log(Object.getOwnPropertyNames(Math).filter(function (p) { return typeof Math[p] === 'function'; })); //-> ["random", "abs", "acos", "asin", "atan", "ceil", "cos", "exp", ...etc ]

This was taken from How to display all methods of an object in Javascript? - Stack Overflow   if you want to see it further, they use the Math class in this example.