markW - Thursday, May 10, 2007 7:51 AM:
This is probably quite simple, but can't find it clearly in the documentation.
If I have an Item instance created in Aras can someone provide me some sample code executed from a Method to have the Item Form Pop-up automatically for the user (preferably in Edit mode, but would be interested to know if there is a trigger to have it come in View or Edit)? Basically I just want to create a simple Action to call a Method which then has the Form come up. I may also trigger it from a lifecycle or workflow event.
Thanks in advance for any help.
RobMcAveney - Thursday, May 10, 2007 3:07 PM:
Hi Mark -
The formal API to manipulate the client UI is currently a work in progress. There is a way to do what you are looking for, but be aware that it is not documented and is subject to change. The following code will open a specific item using the uiShowItemEx method. If the item is locked by the current user, this method will automatically open the form in edit mode. Otherwise it will be in view mode. Keep in mind that this is client-side method code -- I don't know of a way to do the equivalent in a server method (like a lifecycle or workflow event).
var inn = this.newInnovator();Rob
var myItem = inn.getItemByKeyedName("List","Units");
// Remove the following line if you don't want the item locked
if (myItem.isLocked() != 1) {myItem = myItem.lockItem();}
if (myItem.isError()) {top.aras.AlertError(myItem.getErrorDetail());}
top.aras.uiShowItemEx(myItem.node,"tab view",true);