Skip to main content

For example.....Suppose I'm getting this data from my Apex Class

 

objlist=[ 

    {Id: 1, Name:"Jake Peralta", Role: "Employee", Birthday: "01/01/1998"},

    {Id: 2, Name:"Amy Santiago", Role: "Lawyer", Birthday: "11/03/1988"},

    {Id: 3, Name:"Charles Boyle", Role: "Beneficiary", Birthday: "29/12/1993"},

    {Id: 4, Name:"Rosa Diaz", Role: "Spouse", Birthday: "01/06/1968"},

    {Id: 5, Name:"Gina Linetti", Role: "Dependent", Birthday: "23/07/1997"},

    {Id: 6, Name:"Terry Jeffords", Role: "Sibling", Birthday: "21/04/1989"}

    ];

 

I want to sort this w.r.t "Role" field such that the order is:

Spouse

Sibling

Dependent 

Beneficiary

Employee

Lawyer

 

#Javascript  #Javascript Code  #Apex #Salesforce Developer

3 个回答
0/9000