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 / table_recursively_filled.js
Created June 9, 2021 22:48
Test filling a table through a recursive process #js #node #javascript
const struct = [
{
a: [
{ b: [{ c: [] }, { d: [] }] },
{
e: [{ f: [] }, {
g: [
{ k: [{ l: [] }, { m: [] }] },
{ n: [{ o: [] }, { p: [] }] }
]
@YMA-MDL
YMA-MDL / MassReplace.js
Created April 7, 2020 12:33
Create an Express ECO to replace a selected Part with another chosen Part in all parent assemblies #aras #javascript #eco #impactmatrix
// MassReplace
// Create an Express ECO to replace a selected Part with another chosen Part in all parent assemblies
var inn = this.getInnovator();
// Make sure only one item is selected
if (this.getItemCount() !== 1) { return inn.newError("Please select a single item"); }
// Launch a search dialog to select a replacement Part
// TODO: create a better UI
@YMA-MDL
YMA-MDL / Get Controlled Item
Created February 24, 2020 09:21
Get Controlled Item #aras #method #csharp
      // Retrieve the workflow item(s)
            Innovator inn = this.getInnovator();
            Item wflItem = this.newItem("Workflow","get");
            wflItem.setAttribute("select","source_id,source_type");
            Item wflProc = wflItem.createRelatedItem("Workflow Process","get");
            wflProc.setAttribute("select","name");
            Item wflProcAct = wflProc.createRelationship("Workflow Process Activity","get");
            wflProcAct.setAttribute("select","related_id");
            wflProcAct.setProperty("related_id",this.getID());
            wflItem = wflItem.apply();
@YMA-MDL
YMA-MDL / YMA_SetOwnerOnAdd.cs
Created January 19, 2020 21:53
[set actual Identity as assigned creator / owned by id] #csharp #Aras
Innovator inn = this.getInnovator();
string identities = inn.getUserAliases();
string aliasId = identities.Split(';')[0];
this.setProperty("owned_by_id",aliasId);
return this;
@YMA-MDL
YMA-MDL / waitmap.js
Created November 23, 2019 08:51
Wait for .map to execute #javascript #vanillajs
const list = [1, 2, 3, 4, 5] //...an array filled with values
const functionWithPromise = item => { //a function that returns a promise
return Promise.resolve('ok')
}
const anAsyncFunction = async item => {
return functionWithPromise(item)
}
@YMA-MDL
YMA-MDL / filterArasItemPropWindow.js
Created August 27, 2019 08:43
#aras #javascript #filter
//create new Object
var Filter = new Object( );
//Assign Filter
Filter["state"]={filterValue:"Released", isFilterFixed:true};
return Filter;
@YMA-MDL
YMA-MDL / open item.js
Created July 17, 2019 07:41
aras short snippets #aras #javascript
top.aras.uiShowItem("LAB_Cards", $(this).attr("cardId"));
SELECT *
FROM ALS_Activity act
LEFT JOIN ALS_ActivityPredecessors pre
ON act.id = pre.source_id
WHERE pre.source_id IS NULL
@YMA-MDL
YMA-MDL / visjsGanttChartInForm.html
Last active July 12, 2019 15:09
#aras #javascript #form
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" rel="stylesheet" type="text/css" />
<div id="visualization" style="width:100%;height:100%;"></div>
<script>
require(["https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.js"], function (vis) {
var container = document.getElementById('visualization');
var groupBy = function (xs, key) {
return xs.reduce(function (rv, x) {
(rv[x[key]] = rv[x[key]] || []).push(x);
div[name='text7'] .sys_f_label{
text-transform: none;
}