How to fetch all the child records based on the particular value say (Category -xyz) using a javascript.I found few scripts but hard to match my requirements .Please help .
For this requirement you will need to write an Apex method which would query the child records. That being said, there are two ways by which you can invoke Apex from JavaScript.
Method 1 By using RemoteAction calls from JavaScript. You can annotate you apex method with 'RemoteAction' and call that method in JavaScript. Eg: Apex Code
public class JuhiDhiver {
@RemoteAction
public static Integer addNumbers( Integer a, Integer b ) {
return a + b;
}
}
Method 1
By using RemoteAction calls from JavaScript. You can annotate you apex method with 'RemoteAction' and call that method in JavaScript.
Eg:
Apex Code Visualforce
Method 2
By using webservice methods. The method in Apex class which needs to be accessed in JavaScript is exposed as a webservice.
Apex Code Visualforce
Please let me know if you have any more doubts.