Logging to adTempus 4.3.1 from Referenced Assemblies

dustinbrooks (2 posts)
August 10, 2016 01:32 PM
Accepted Answer

So from our script, we reference our C# .dll, and from the script Run() method we call the public method to kick off our job. 

This all works as we would expect. What we want to accomplish now, is to be able to log messages in adTempus.

adTempus.LogMessage(MessageTypeEnum.Error, 0, "test error"); 

The above line works fine in the script page, but how do we accomplish the same thing once it enters the custom dll code. Can we pass in a reference to the current job instance or something? 

Bill Staff (602 posts)
August 10, 2016 09:22 PM
Accepted Answer
The adTempus object implements the ScriptHostInterface interface from the ApplicationIntegration assembly, which exposes all of that functionality. Your custom assembly should reference ArcanaDevelopment.adTempus.ApplicationIntegration.dll. Your method should then take an argument of type ScriptHostInterface. When you call the method from the script, pass it the adTempus object. Your assembly can then call methods on that interface just like you can do from the adTempus script.

Replies are disabled for this topic.