function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
p_282p_282 

Dynamically getting the values in javascript

How to get the values dyamically in javascript using visualforce page?

 

I have some fields like

                                  Date

                                  Reference

                                  Subject..

and also had a table and the table includes product,description ,quantity...

                  

MagulanDuraipandianMagulanDuraipandian

Apex code to get fields is

 

        objectFields =  new List<String>();  

        Map<String , Schema.SObjectType> globalDescription = Schema.getGlobalDescribe();   

        Schema.sObjectType sObjType = globalDescription.get(searchCategory);             

        sObjectToBind = sObjType.newSObject();  

        Schema.DescribeSObjectResult r1 = sObjType.getDescribe();  

          

        Map<String , Schema.SObjectField> mapFieldList = r1.fields.getMap();  

        for(Schema.SObjectField field : mapFieldList.values())  

        {  

            Schema.DescribeFieldResult fieldResult = field.getDescribe();  

            if(fieldResult.isAccessible())  

            {  

                objectFields.add(fieldResult.getName());

            }  

        }  

 

Regards,

Magulan D

Salesforce.com certified Force.com Developer.

SFDC Blog

 

If this post is your solution, kindly mark this as the solution.

       

p_282p_282

Thanks for the post ..i need that in javascript

Pramodh KumarPramodh Kumar
Hi p_282,

I have the same scenario where i need to use schema methods in javascript. Could you please help if you have any piece of code.



Thanks,
pRAMODH.