Skip to main content

Posts

Keep Vault Data Consistent with Database Records in Aras Innovator

In Aras Innovator, every files normally link to particular Item by Property or Relationship. When deleting Item, relevant physical file will not be removed. Obviously, these orphaned files will increase with time, of course it could be treated as a special way to protect physical files from accidentally deletion. In order to keep vault data consistent with database records, variable "Force.Delete.Orphaned.Files" can control if system need to handle physical file or not. But this variable does not exist in default, you need to create it by yourself. If set to 1, orphaned files will be removed together once relevant Item is deleted.

Handle Loading Spinner Visibility in Aras Innovator

When opening Item window, a loading spinner shows automatically like below figure. In some cases, manually handle its visibility would be a necessary process to prevent user do any operation. Show Loading Spinner aras.browserHelper.toggleSpinner(document,true); Hide Loading Spinner aras.browserHelper.toggleSpinner(document,false);

Fix Failed to Logout Properly in Aras Innovator When Using Chrome

Normally, Aras Innovator will save user's preference and disconnect session automatically when user logout. In order to perform this action in background, relevant code should be triggered in onbeforeunload event and then send request to server silently. But newer version Chrome disallow "Synchronous XHR in page dismissal", this would make above post process failed (see error message in Figure 1). Therefore, all requests in onbeforeunload event are abandoned due to this kind of policy. Figure 1. Error in console. Solution Open "\Innovator\Client\javascript\aras_object.js". Add below code. Aras.prototype.handleUnloadSoapSend = function Aras_handleUnloadSoapSend(methodName,xmlBody,url) { if (this.Browser.isCh() && window.fetch) { var soapMessage = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">'; soapMessage += '<SOAP-ENV:Body>'; soapMessage += '<'+methodName+'...

aras.evalJavaScript Method (aras Object)

aras.evalJavaScript Method Evaluates JavaScript code in the Aras object space. Syntax aras.evalJavaScript( jsCode ) Parameters Name Type Description jsCode String Required. JavaScript code represented as a string. Return Value Returns evaluated result from given JavaScript code. See Also aras Object Aras Innovator Client Framework

Prevent unexpected error when uploading file does not exist in Aras Innovator

Sometime users may rename or remove local file "accidentally", it will make the saving process stuck like Figure 1. According to Figure 2, the problem should be that uploading program cannot read file. It seems there is no exception handler. Figure 1. Saving process stuck when uploading failed. Figure 2. Error in console. Solution Open "\Innovator\Client\Modules\core\xxhWorker.js". Move to line 31 and modify "onmessage" function. var receivedData = e.data.data; var fileId = e.data.fileId; var offset = e.data.from; var reader = new FileReaderSync(); var byteData,xxhash; try { byteData = reader.readAsArrayBuffer(receivedData); xxhash = xxHash(byteData); } catch (e) { xxhash = -1; } var result = { xxhash: xxhash, fileId: fileId, offset: offset }; //we remove links to objects in memory to prevent keeping references and to stable garbage collector working reader = null; byteData = null; postMessage(result); Open "\Innovator\Client\Modules\core\v...

Fix Aras Innovator Dashboard Cannot Display in Chrome

Dashboard is a built-in function on Aras Innovator which can perform data visualization with simple configuration. If enter any of existing Dashboard with Chrome, "HTTP Error 500 - Internal Server Error" will show. But using IE and Firefox are OK. It's a little strange due to the error detail shows the requested URL is a directory named "_src_" (shown as below figure). Actually, this kind of directory doesn't exist on server. Check "Dashboard.html" can find the attribute "src" of embed tag is dynamically set by JavaScript in order to get multilingual resource (shown as below figure). The code seems correct but not work in Chrome actually. According to the  discussion on Stak Overflow , dynamically change attribute "src" of embed tag is a very old bug. It looks like not fixed until now. Solution Open "\Innovator\Client\scripts\Dashboard.html". Move to Line 211. Replace all contents of script scope with...

Display thousands separator in Aras Innovator

Aras Innovator can automatically handle the format of Decimal Property with client culture. See below figures, users can find different number output in different culture. The problem is, system only handles the decimal separator. Although Aras Innovator is not a kind of accounting system, it still makes inconvenience for recognizing price data. Figure 1. The decimal data in default culture (en-US). Figure 2. The decimal data in German culture (de-DE). Solution Open "\Innovator\Client\javascript\ArasNumberHelper.js". Move to line 38 and add below code to "ArasNumberHelperFormat" function. Save file. if (locale!==null) { //Called by converting from neutral this.requestModules(); locale = this.localizationModule.normalizeLocale(locale); var formatResult,temp,digits; if (pattern) { temp = pattern.split('.'); digits = Math.min(temp[1] ? temp[1].length : 0, 20); } else { formatResult = number.toString()...

Change Keyed Name Length in Aras Innovator

The "Keyed Name" value normally follows "Name" value, and the value may be very long in some special scenarios. Default length of "Keyed Name" Property is 128, but it can't be modified due to system restrictions (see Restriction on Modifying System Property ). All operations on Aras Innovator will be validated before executing command in database. Therefore, it is impossible to modify with AML or configure on system interface. The alternative way is to modify column definition in database directly. Use below the SQL command to achieve: ALTER TABLE [ Table Name ] ALTER COLUMN [keyed_name] NVARCHAR( New Length ) NULL; UPDATE [Property] SET [stored_length]= New Length WHERE [id]=' Property ID '; ※Please use the command very carefully because there is no any system check for it.

aras.evalMethod Method (aras Object)

aras.evalMethod Method Executes a client side Method with Item node or XML string. Syntax aras.evalMethod( methodNameOrNd , XMLinput , inArgs ) Parameters Name Type Description methodNameOrNd String or Object Required. Client side Method name or node. XMLinput Object Optional. Item node or XML string with Item tag. inArgs Any Optional. Additional arguments to pass. Return Value Returns evaluated result from executed client Method. See Also aras Object Aras Innovator Client Framework

aras.evalItemMethod Method (aras Object)

aras.evalItemMethod Method Executes a client side Method with Item node. Syntax aras.evalItemMethod( methodName , itemNode , addArgs ) Parameters Name Type Description methodName String Required. Client side Method name. itemNode Object Optional. Item node. addArgs Any Optional. Additional arguments to pass. Return Value Returns evaluated result from executed client Method. See Also aras Object Aras Innovator Client Framework

aras.convertToNeutral Method (aras Object)

aras.convertToNeutral Method Converts local value to neutral value. Only effect on specified data types including date, decimal, and float. Syntax aras.convertToNeutral( localValue , data_type , dotNetPattern4Date ) Parameters Name Type Description localValue Any Required. The local value to convert. data_type String Required. Property data type. dotNetPattern4Date String Optional. Decimal pattern or date pattern. When "data_type" is "date", this parameter only supports the following values: short_date (default) short_date_time long_date long_date_time Return Value A String. Returns the converted value. If conversion fails, original value will be returned. See Also aras Object Aras Innovator Client Framework

aras.convertFromNeutral Method (aras Object)

aras.convertFromNeutral Method Converts neutral value to local value. Only effect on specified data types including date, decimal, and float. Syntax aras.convertFromNeutral( val , data_type , dotNetPattern4Date ) Parameters Name Type Description val Any Required. The neutral value to convert. data_type String Required. Property data type. dotNetPattern4Date String Optional. Decimal pattern or date pattern. When "data_type" is "date", this parameter only supports the following values: short_date (default) short_date_time long_date long_date_time Return Value A String. Returns the converted value. If conversion fails, original value will be returned. See Also aras Object Aras Innovator Client Framework

Relationship Permission Logic in Aras Innovator

A Relationship will inherits permission from its parent when ItemType uses "UseSrcAccess". Although using same permission, the background check logic is a little different. In general, system will check "CanAdd" from ItemType when user executes "add" action, and will check Permission's Access for "edit" and "delete" action. As long as an item is a Relationship with "UseSrcAccess", system will check if "can update" permission of its parent is available alternatively when executing "add" and "delete" action. I guess this kind of design aims for the data safety of adding/deleting Relationship due to user cannot only delete Relationship without editing parent Item in normal situation. But in some customization scenarios, operating Relationship directly is possible (e.g. using AML command).

Control Property Access with Identity in Aras Innovator

In Aras Innovator, each ItemType links to a table in database. That means the Property links to a column for storing data. If there are access issues for data field, create a Poly Item and Form with particular Identity should be the simplest way to implement. When facing to complicated scenario (maybe various columns and Identity need to be considered together), the future maintenance work might be very difficult. This article provides another thinking to achieve similar result with a little customization. Change Property Access The Property is also an ItemType in system, that means its access can be controlled by system permission. In default, a Relationship will inherits permission from its parent. But in order to control Property access individually, the "Use Src Access" option should be cancelled (see Figure 1). Figure 1 Create Private Permission Open the ItemType which need to create various view (here takes "Part" as example), and follow below s...

Add Locale Options to Login Page of Aras Innovator

Aras Innovator supports multilingual user interface and will automatically determine locale preference by browser's language configuration. But it is not convenient if user want to change locale quickly due to user may not know or do not want to change browser's settings. Allow users determine the locale with login data by themselves should be an alternative way to solve the problem. Follow below steps to implement. Add Inline Code Open "\Innovator\Client\scripts\login.aspx". Move to line 131 and add below code with embedded code block. Dim objLocales As XmlNodeList = ApplicationXML.SelectNodes("/Innovator/Locale-Option[@id and @text]") If objLocales.Count>0 Then Dim objLocale As XmlElement Dim strDefault As String = Request.ServerVariables.Item("HTTP_ACCEPT_LANGUAGE").SubString(0,5) Dim strID As String Dim strText As String Response.Write("<div class=""database"">") Response.Write("...