Skip to content

Instantly share code, notes, and snippets.

View sampoearas's full-sized avatar

Sam Poe sampoearas

View GitHub Profile
@sampoearas
sampoearas / RelSearch.cs
Created May 30, 2019 19:42
Relationship Search Property
//Example: getting actual property from Part Goal relationship
System.Diagnostics.Debugger.Launch();
Innovator inn = this.getInnovator();
string actVal = "";
//loop through returned collection from search
int counter = this.getItemCount();
for(int i = 0; i < counter; i++){
Item cItm = this.getItemByIndex(i);
cItm.fetchRelationships("Part Goal");
@sampoearas
sampoearas / MidnightBatchRunEx.cs
Last active May 9, 2019 16:06
Midnight Batch Run Method Code (blog)
//Get existing email message in Innovator
//An email Item contains a Name for the stored item, a Subject, a From User/Identity, and the Body of the email
Item email_msg = this.newItem("EMail Message", "get");
email_msg.setProperty("name", "Open Items Need Attention!"); //this email name is an example and does not exist OOTB
email_msg = email_msg.apply();
//Get admin Identity
Item iden = this.newItem("Identity", "get");
iden.setProperty("name", "Innovator Admin");
iden = iden.apply();
//Send email TO above Identity
@sampoearas
sampoearas / BatchRunExample.xml
Created May 9, 2019 15:48
Midnight Batch Run Example (blog)
<innovators>
<innovator>
<server>http://localhost/Innovator11</server>
<database>InnovatorServer</database>
<username>admin</username>
<password>innovator</password>
<http_timeout_seconds>600</http_timeout_seconds>
<job>
<method>Midnight Batch Run</method>
<months>*</months>
@sampoearas
sampoearas / InnovatorServiceConfigEx.xml
Created May 9, 2019 13:55
Innovator Service Config File Example (blog)
<?xml version="1.0" encoding="utf-8" ?>
<innovators>
<innovator>
<server>SERVER</server>
<database>DATABASE</database>
<username>USERNAME</username>
<password>PASSWORD</password>
<http_timeout_seconds>600</http_timeout_seconds>
<job>
<method>METHOD-NAME</method>
@sampoearas
sampoearas / EmailReminderCode.cs
Created May 1, 2019 21:22
Email Reminder Method (Blog)
//Get email message
Item email_msg = this.newItem("EMail Message", "get");
email_msg.setProperty("name", "Service Reminder");
email_msg = email_msg.apply();
//Get admin Identity
Item iden = this.newItem("Identity", "get");
iden.setProperty("name", "Innovator Admin");
iden = iden.apply();
bool result = this.email(email_msg, iden);
if (!result) { return this.getInnovator().newError("Mail not sent"); }
@sampoearas
sampoearas / EmailDeliveryExample.xml
Last active May 9, 2019 19:42
Email Delivery Example (Blog)
<innovators>
<innovator>
<server>http://localhost/Innovator11</server>
<database>InnovatorSolutions</database>
<username>admin</username>
<password>innovator</password>
<http_timeout_seconds>600</http_timeout_seconds>
<job>
<method>Scheduled Email Delivery</method>
<months>*</months>