Inherit parent entity security settings on child

By | August 9, 2012

In Sage CRM, I have created an entity as child of company entity through ASP pages. I wanted to assign the security rights to this entity similar to its parent i.e. Company entity. All the buttons, must be applied the predefined security settings for Company entity.
Let’s take an example of New button which uses insert rights on entities. Normally in custom pages of your secondary entities you will have the New button as follows.
Container.AddButton (CRM.Button (“New”, “new.gif”, CRM.URL (140) +”&Key-1=”+iKey_CustomEntity+”&PrevCustomURL=”+List.prevURL+”&E=RFP”));
This button will be visible to all. Now what if I want to change this button in such a way that only those people should see New button who are having rights to insert on Company entity. The code needs to be changed like below.
Container.AddButton (CRM.Button (“New”, “new.gif”, CRM.URL (140) +”&Key-1=”+iKey_CustomEntity+”&PrevCustomURL=”+List.prevURL+”&E=RFP”, ‘company’, ‘insert’));
Here, you can see there are two parameters at the end as “Company” and “Insert” which identifies whether a particular user has rights to insert company record or not.