This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //MethodTemplateName=CSharp:Aras.TDF.ContentGenerator(Strict); | |
| targetElement.AddChild(this.Factory.NewText("Text", "")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //MethodTemplateName=CSharp:Aras.TDF.ContentGenerator(Strict); | |
| ItemDocumentElement targetItem = targetElement as ItemDocumentElement; | |
| if (targetItem != null) { | |
| targetItem.ClearChilds(); | |
| targetItem.AddChild(this.Factory.NewText("Title", targetItem.GetItemProperty("name", " "))); | |
| targetItem.AddChild(this.Factory.NewText("Text", targetItem.GetItemProperty("description", " "))); | |
| string cost = targetItem.GetItemProperty("cost", " "); | |
| if (cost != " ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This sample code hides "BOM" and "BOM Structure" tabs for OOTB Part item. | |
| In order to make this code work for FireFox, it explicitly selects the tab | |
| that should be loaded first -- "Alternates" | |
| */ | |
| var tabbar; | |
| var desiredTabId; | |
| //Function to hide tabs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // show the BOM and BOM Substitute tabs only when the Part is an assembly | |
| if (document.thisItem.getProperty("classification","") != "Assembly") | |
| { | |
| //Call hideTabs function | |
| setTimeout(hideTabs, 50); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var userIsSpecial = function(item) { | |
| var userID = aras.getUserID(); | |
| // user is special if they are the creator | |
| if (userID == item.getProperty("created_by_id","")) | |
| return true; | |
| return false; | |
| }; | |
| if (!userIsSpecial(document.thisItem)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1st query | |
| Item workflowProcess = this.newItem("Workflow Process", "get"); | |
| Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity", "get"); | |
| Item activity = workflowProcessActivity.createRelatedItem("Activity", "get"); | |
| activity.setID('activityId'); | |
| workflowProcess = workflowProcess.apply(); | |
| String workflowProcessId = workflowProcess.getID(); | |
| // 2nd query | |
| Item workflow = this.newItem("Workflow", "get"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // single query | |
| Item workflow = this.newItem("Workflow","get"); | |
| Item workflowProcess = workflow.createRelatedItem("Workflow Process","get"); | |
| Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity","get"); | |
| Item activity = workflowProcessActivity.createRelatedItem("Activity", "get"); | |
| activity.setID('activityId'); | |
| workflow = workflow.apply(); | |
| // generates the following AML query | |
| // <AML> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Item workflow = this.newItem("Workflow","get"); | |
| Item workflowProcess = workflow.createRelatedItem("Workflow Process","get"); | |
| Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity","get"); | |
| Item activity = workflowProcessActivity.createRelatedItem("Activity", "get"); | |
| activity.setID('activityId'); | |
| workflow = workflow.apply(); | |
| // generates the following AML query | |
| // <AML> | |
| // <Item type="Workflow" action="get"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Item workflow = this.newItem("Workflow","get"); | |
| // use select attribute to retrieve only the necessary properties | |
| workflow.setAttribute("select", "source_id,source_type"); | |
| Item workflowProcess = workflow.createRelatedItem("Workflow Process","get"); | |
| Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity","get"); | |
| Item activity = workflowProcessActivity.createRelatedItem("Activity", "get"); | |
| activity.setID('activityId'); | |
| workflow = workflow.apply(); | |
| // generates the following AML query |