This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Add html to ItemType column

jfranken - Friday, January 28, 2011 6:53 AM:

Hi Guys

I have added string property (relationship) to the "Part" ItemType and I'm trying to set this property on the onafterGet event to something like this:

 Item ci = this.getItemByIndex(i);

 string related_id = ci.getProperty("id"); 

 ci.setProperty("test","<a href='url/download.aspx related_id +"'>Download Part</a>");

This will allow the users to open an external URL by clicking on this link when they open the default Part Form. Is there any way to do this?

Thanks

 



jfranken - Friday, January 28, 2011 8:53 AM:

What I have managed to do is add a button to the part form. So every time you open (edit or view) the part you can click on the button in order to download e.g BOM or Part documents from my external application.

This is my code:

if(document.item)

{

  var PartID = top.aras.getItemProperty(document.item, 'id') 

  //top.aras.AlertError(PartID);

  var url = "url/TemplateDownloadAras.aspx + PartID;

  var name = "Test";

  var options = "resizable=yes,height=300,width=800,top=100,left=160,scrollbars=yes,status=yes,toolbar=no,directories=no,menubar=no,location=no";

 

  window.open(url, name, options);

}

return true;

 

The only problem I have is that we have to open the form every time in order to access this functionality. I want to be able to do this from the Part List screen directly. Just remember one thing. The part ID have to be retrieved every time and thats why I want to add it within the column.

I have tried doing this with a custom action but am unable to retrieve the Part ID via a client side JavaScript method.

Any suggestions would be helpful.

Thanks

 



Brian - Friday, January 28, 2011 9:28 PM:

If you are using an "Item" type action then the ID of the Item you are launching the action from will be passed to the method as part of the Item Context (so part of the "this" item).

From that you should have all the information you need to be able to run the Action by right clicking on the Part in the main search grid.

Hope this helps,

Brian.



jfranken - Sunday, January 30, 2011 3:36 AM:

Thank you so much Brian. This is working very well!

Regards

jfranken