You need to sign in to do that
Don't have an account?
Susanta Chakraborty
How to restrict record type in list view through apex triggers or class
Hi Team
Could anyone write the codes which help me to restrict record type in list view in one object.
I have one object called "Person" which has 4-5 record types and 4-5 page layout assign with particular record type. There are 2 record types, which are "Staff" & "Limited Staff". Staff record type has similar called page layout with so many fields and Limited staff record type also has similar page layout which restrict with some fields.
Now I want if User ID <> Owner ID then Limited staff record type and page layout should open from list view, other-wise Staff record type and page layout should open for the true critiria.... User ID=Owner ID.
Please let me know if anyone can help me out. I am not very familiar with apex codes
Could anyone write the codes which help me to restrict record type in list view in one object.
I have one object called "Person" which has 4-5 record types and 4-5 page layout assign with particular record type. There are 2 record types, which are "Staff" & "Limited Staff". Staff record type has similar called page layout with so many fields and Limited staff record type also has similar page layout which restrict with some fields.
Now I want if User ID <> Owner ID then Limited staff record type and page layout should open from list view, other-wise Staff record type and page layout should open for the true critiria.... User ID=Owner ID.
Please let me know if anyone can help me out. I am not very familiar with apex codes
Hi Susanta,
We cannnot manage ListView of an object through apex, i.e. directly handled by Salesforce.
What we can do to achieve this is to create Custom VF page for List view that will check the possible condition and display data accordingly.
Thanks,
Gaurav
Skype: gaurav62990
Thanks for prompt reply. Could you please provide me the Custom VF page code so that I can impelment this to our Production.
Thanks.
Please go through this link:
https://salesforce.stackexchange.com/questions/32067/custom-list-view-to-display-vf-page.
Hope this helps!!!
Thanks,
Gaurav
Thanks.
This will be complicated, as you need to prepare the VF page and its controller class to manage the requirements.
Or you can prepare the Details / edit page layout with the above condition.
Thanks,
Gaurav
Skype: gaurav62990
Thanks.
Visibility of the fields are defined based on following:
1. Profile
2. Page Layout assignment.
3. Record Type Access.
4. Object Level Permission.
5. Field Level Permission.
6. Custom VF page / Controller class.
THanks,
Gaurav
Thanks.
Let me know if you need more help on this.
Thanks,
Gaurav
Skype: gaurav62990
If you can help me out then please let me know.
Thanks.
This is not that easy, and would require some time to develop this code. Please provide some time to me to help you in this.
THanks,
Gaurav
For your help I am providing some details...
Object name: Staff__c
Restrited field names are: Account_Savings_Current__c (picklist field), Age__c (formula number field), Bank_Name__c (Text field) and so on.... which I can modify to see any one or two restriction.
Logic will be, If UserID <> Owner ID then these fields should not visible to others.
Let me know if you need anything further.
Thanks.
Any update which we have discussed couple of days ago.....
Thanks.
I have made a small list view on Account object. Please modify it as per your requirement. Wrapper is the list which we are displaying over Page. You can add multiple field which need to be displayed on page.
"isOwnerView = true" will show all the fields and make it "False" to hide field value.
Hope this helps!!!
Thanks,
Gaurav
Skype: gaurav62990
Thanks.
Hi Susanta,
Yes, you can reach out to me on Skype: gaurav62990.
I will help you build this.
Thanks,
Gaurav