You need to sign in to do that
Don't have an account?
Priyanka Reddy 74
How to get editable and non editable fields from fieldset
Hi All,
I'm having a field set which contains fields of records which include both editable and non editable, can some one suggest me like how I can make retrieve separately both editable and non editable fields.
Thank you in Advance.
I'm having a field set which contains fields of records which include both editable and non editable, can some one suggest me like how I can make retrieve separately both editable and non editable fields.
fieldList = new List<String>(); for(Schema.FieldSetMember memberObj : SObjectType.Account.FieldSets.rakch__DemoFieldSet.getFields()){ qwerty += ','+memberObj.getFieldPath(); fieldList.add(memberObj.getFieldPath()); }
Thank you in Advance.
Can you try the below code once:
Let me know if it helps you and in case if it is solved close your query by marking it as solved so that it can help others in the future.
All Answers
I found these two snippets that you can use:
for read only: https://salesforce.stackexchange.com/questions/184831/list-of-all-read-only-fields-on-an-object
for editable fields: https://salesforce.stackexchange.com/questions/10532/finding-if-a-custom-field-is-editable-using-apex-code
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
Thank you for snippets, I tried this but i'm not able to access feilds in visualforce page dynamically.
Can you please do let me know.
Apex:
Visual Force:
selectedList1 is an account type.
im facing an error: Invalid field for SObject Account
Can you please let me know where i went wrong.
Thank you.
Looking forward to your response.
My requirement is to display only editable feilds in visualforce.
Thank you.
Can you try the below code once:
Let me know if it helps you and in case if it is solved close your query by marking it as solved so that it can help others in the future.