Skip to content

Instantly share code, notes, and snippets.

View YMA-MDL's full-sized avatar
🎯
Focusing

Yoann Maingon YMA-MDL

🎯
Focusing
View GitHub Profile
@YMA-MDL
YMA-MDL / getFormFieldValue.js
Created July 12, 2019 08:35
retrieve field input value in an Aras Innovator form #aras #js #snippet #form #field
var myValue = getFieldByName("myproperty").getElementsByTagName("input")[0].value;
@YMA-MDL
YMA-MDL / canvaJsAras.html
Last active September 11, 2017 10:15
Script for adding a pie chart to an Aras Form
<script type="text/javascript">
require(["https://canvasjs.com/assets/script/canvasjs.min.js"], function(){
// retrieve infos
var PartID = document.thisItem.getID();
var PartManufs = document.thisItem.newItem("Manufacturer Part","get");
PartManufs.setProperty("source_id",PartID);
PartManufs = PartManufs.apply();
@YMA-MDL
YMA-MDL / SyncToolProductOnProject.cs
Created September 4, 2017 13:41
SyncToolProductOnProject
Innovator inn = this.getInnovator();
if (this.getProperty("classification") == "Product") {
CCO.Utilities.WriteDebug("DEL_SyncToolProductOnProject", "Sync from Product to Tool");
// retrieve product project structure
String mainWBSid = this.getProperty("wbs_id");
Item mainWBS = inn.newItem("WBS Element", "get");
mainWBS.setID(mainWBSid);
Item submainWBS = mainWBS.createRelationship("Sub WBS", "get");
@YMA-MDL
YMA-MDL / gitLabToGitGraph.js
Last active September 1, 2023 08:54
Rendering a gitgraph in Aras PLM Solution, from a git extract (from gitlab)
require([
"./gitgraph/gitgraph.min.js",
"./gitgraph/lodash.js"
], function() {
var myTemplateConfig = {
colors: [ "#66ff66", "#00ffff", "#9999ff", "#ff6699", "#ff9966", "#3399ff", "#ff3300" ], // branches colors, 1 per column
branch: {
lineWidth: 6,
spacingX: 40,
@YMA-MDL
YMA-MDL / reqSafety.css
Created January 31, 2017 19:20
reqSafety CSS for preText
.reqSafety::before {
content: "Safety conditions \A";
white-space: pre;
text-align: center;
font-size: 1.6em;
font-weight: bold;
}
@YMA-MDL
YMA-MDL / reqSafetyElt.xml
Created January 31, 2017 19:17
reqSafety Element (S1000D)
<xs:element name="reqSafety">
<xs:complexType>
<xs:complexContent>
<xs:extension base="aras:text">
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
@YMA-MDL
YMA-MDL / ExcelToClassification.vb
Last active September 23, 2016 09:28
Tranforms an classification stored in Excel to Aras Item classification
' source columns are from 6 to 10 and are ordered alphabetically starting on col 6 to 10.
Sub ListToClassStructure()
Dim colStart As String
colStart = "f"
Dim i As Integer
i = 2
import java.net.*;
import java.io.*;
import java.security.*;
import java.math.*;
class filecheckin
{
public static String calcMD5(String s) {
MessageDigest m = null;
@YMA-MDL
YMA-MDL / amlCall.java
Created September 23, 2016 09:06
java example for AML call
String nameSpace = "http://www.aras-corp.com/";
String remoteMethod = "ApplyItem";
String characterEncoding = "UTF-8";
String SOAPmessage = "<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><SOAP-ENV:Body><ApplyItem xmlns:m='http://www.aras-corp.com/'>" + context.XML_Buffer + "</ApplyItem></SOAP-ENV:Body></SOAP-ENV:Envelope>";
// Create new URL object and HttpURLConnection object
java.net.URL url = new java.net.URL(context.InnovatorService);
java.net.HttpURLConnection httpConnection = (java.net.HttpURLConnection) url.openConnection();
// Convert the message to a byte array
byte[] messageBytes = SOAPmessage.getBytes();
System.Diagnostics.Debugger.Break();
// Example request
// <Item type="tha_Node" id="E2E7D574B0E2449DA6367CD0F8D01448" project="Proj1" fromStream="Trunk" fromVersion="1" toStream="Trunk">...
Innovator inn = this.getInnovator();
// Get the main node informations
string proj = this.getAttribute("project");
if (proj == null) return inn.newError("Project is required");
string fromStream = this.getAttribute("fromStream");
if (fromStream == null) return inn.newError("fromStream is required");