Skip to main content

Posts

Trigger Sequence of Promotion Events in Aras Innovator

There are several Server Event could trigger Method during item promotion: ItemType: OnBeforePromote, OnAfterPromote; Life Cycle: Transition Pre, Transition Post. Trigger sequence of above events is shown in below figure: It's important to note that "Transition Post" cannot rollback while exception throws because item promotion is finished after "OnAfterPromote" That means even if throwing exception, the life cycle will still stay at promoted state. Please note, all above events will not be triggered when "OnPromote" event exists (due to this will overwrite original system process).

Fundamentals of Relationship Operation with Aras Innovator API

Basic knowledge of operating an item object can refer to " Fundamentals of Item Operation with Aras Innovator API ". This article will introduce operation for relationships with JavaScript. Assume Part "A0001" need to be created, the code will be: var inno = aras.IomInnovator; var itm = inno.newItem('Part', 'add'); itm.setProperty('item_number','A0001'); And the built AML Node seems like below: <Item isNew="1" isTemp="1" type="Part" action="add" id="052C2E5D160645E9835BAA74AE732265"> <item_number>A0001</item_number> </Item> Create Relationship Assume Part "A0002" need to be created, and it is the child of "A0001". For another words, "A0002" is Related Item of "Part BOM" Relationship. Syntax var relItm = inno.newItem('Part','add'); relItm.setProperty('item_number','A0002...

Fundamentals of Item Operation with Aras Innovator API

Aras Innovator API (Innovator Object Model; IOM) provides simple way to build and submit query request with AML. This article will introduce some common methods. Get Innovator Instance No matter develop server side or client side code, IOM provides same members to call. The only difference is the way to get Innovator instance. Syntax of VB .NET and JavaScript show as below: VB. NET Dim objInno As Innovator = Me.getInnovator() JavaScript var inno = aras.IomInnovator; ※Due to the syntax of IOM in VB .NET and JavaScript are similar, the following examples will only enumerate with JavaScript. Create Item Mainly use the method "newItem". Syntax var itm = inno.newItem('Part', 'get'); Built AML <Item isNew="1" isTemp="1" type="Part" action="get"/> Handle Attribute Related methods are "setAttribute" and "getAttribute". Set Syntax itm.setAttribute('select', 'id...

Conditional Operator in VBA/VB .NET

For most of C-like programming languages, conditional (ternary) operator is more concise than If statement. And it is also available in VBA and VB .NET. VBA Conditional Operator The function "IIF" exists since VB6, syntax seems like below: Dim i As Integer Dim s As String i = 1 s = IIf(i > 0, "Greater than zero", "Zero or less than zero") Debug.Print (s) 'Greater than zero i = -1 s = IIf(i > 0, "Greater than zero", "Zero or less than zero") Debug.Print (s) 'Zero or less than zero It is convenient but need to notice that IIF will always evaluate all arguments. See below example: Dim i As Integer i = IIf(True, 1 + 1, 1*1) 'This is OK i = IIf(True, 1 + 1, 1 / 0) 'This will throw exception due to division by zero VB .NET Conditional Operator To improve IIF problem, there is IF operator in VB .NET. Dim i As Integer = 1 Dim s As String = If(i > 0, "Greater than zero", "Zero or less t...

Create Tab Layout for Form in Aras Innovator

This article will introduce how to create tab layout for Form like below Figure 1 and able to trigger function while clicking a tab. Figure 1. A tab layout in Form Figure 2. Trigger a function while clicking a tab Create a HTML Field in Form with clicking the icon marked in Figure 3. Figure 3. Create HTML Field In "Field Type", paste below code to "HTML Code". And then, save Form. The function "onClick" mainly defines the action while tab is clicked. <script type="text/javascript"> var tabApplet; clientControlsFactory.createControl("Aras.Client.Controls.Experimental.SimpleTabbar", {style: 'width: 400px; height: 200px;'}, function(control) { tabApplet = control; //Set tabs tabApplet.addTab('tab1','Tab 1'); tabApplet.addTab('tab2','Tab 2'); //Set tab content tabApplet._getTab('tab1').setContent('This is Tab 1.'); tabApplet._getTab(...

Fix Blank Message of Promotion Error in Aras Innovator While Using IE 11

Blank message may show up like below picture when server throw an error at life cycle promotion. (Not sure which version has this bug and when being fixed.) Solution: Open the file "\Innovator\Client\scripts\promoteDialog.html" on server. Find the function "closeWindow". Modify as below: function closeWindow(value) { if (dialogArguments.dialog) { setTimeout(function () { dialogArguments.dialog.close(value); }, 100); } else { window.returnVal ue = value; window.close(); } } Open the file "\Innovator\Client\web.config". Increase the attribute "filesRevision" value of tag "cachingmodule". <cachingModule moduleEnabled="true" filesRevision="2" /> References: Return error at LifeCycle Transition Pre Server method - Aras Open PLM Community

Item Window Render Process in Aras Innovator

Item window is a typical way to display item data, this article is to investigate the render process of it. And then, check the trigger timing of "onFormPopulated" and "onLoad". When user open an item, Window Render Process (see Figure 1) will be executed. There is an action "render" which mainly handles form details (see Figure 2), here calls Form Render Process. When HTML elements are loaded, system will trigger form event "onFormPopulated" if it exists. After Form Render Process finished, system will trigger form event "onLoad" if it exists, and then Window Render Process is finished. But if user save/lock/unlock an item, system will only execute Form Render Process. With above points, the trigger timing and main difference between "onFormPopulated" and "onLoad" are clear: onFormPopulated: execute every time while item window update form data. onLoad: execute only one time while item window opened. ...