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 - Disable Create New from TOC for a Item

vishnu - Tuesday, December 21, 2010 9:29 AM:

My requirement is to disable create new link from TOC, but I will create the item programatically.

Is there a way to block the create new link from TOC?



Brian - Tuesday, December 21, 2010 9:51 PM:

Hi Vishnu,

Use the Permissions model to limit who can create the Item Type (Can Add Tab on Item Type definition).

Allow Identity "Aras PLM" to create the Items.

In your method grant permissions to the method

// Grant 'Aras PLM' permissions

 

Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName("Aras PLM");

Boolean PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);

 // Create the item here.

 

// Revoke 'Aras PLM' permissions

 

if (PermissionWasSet) Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);

Cheers,

Brian.



vishnu - Wednesday, December 22, 2010 7:45 AM:

I have blocked by writing a Javascript method on "onBeforeNew" event and return false.



Brian - Wednesday, December 22, 2010 4:56 PM:

Hi Vishnu,

Glad you found a way that works for you.

One thing to consider. Blocking the create by using the onBeforeNew event still gives the user the impression that they can add a new Item. They see the Create icon etc but they end up not being able to actually do it.

If you use the permissions model then the user does not see the option to add a new Item and so they won't be expecting to be able to do it.

As I say, just something to think about from a user perspective.

Cheers,

Brian.