JavaScript Resource Name

Not applicable

Hello All,

Is there a way via JavaScript notation to get the name or path of the JavaScript resource that is executing? We'd like to institute a logger function which would include the JavaScript resource name/path with the log entry. So within our code, we'd like to do something like:

enhanceLog("/apiproxy/resources/jsc/updateAdjustmentRequest.js", "This is a sample log entry.");

So essentially looking for some method to give me the JavaScript resource name (argument one in the function above) as opposed to hard coding the resource name in the code itself.

TIA,

Steve

2 2 200
2 REPLIES 2

@Stephan.Cossette

I don't know of a way to get that information from within the JS callout.

Hi @Dino,

When we trace using trace tool, we can see a variable - javascript-name (see below). Is there a way to get that variable?

1798-capture-js.jpg

Thanks,

Abhishek