0

I have a tab where i save my values in first column. And when I check checkbox I want to copy value from first column then sort it and save in second column. How to implement sort? Any suggestions

Update Apex:

 }

  try {
      sortApRec.sf__c = sortApRec.uns__c; 
      sortRec.add(sortApRec);

    if ( sortRec.size() >1  ) {  
         sortRec.sort(); 

         update sortRec;  
        sortRec.clear(); 
        //sortRec.sort();
    }  
         if ( sortRec.size() > 0 ) { 
       // sortRec.sort();     
        update sortRec;  
        sortRec.clear();    
    }  

  } catch (Exception ex) {
   throw new AuraHandledException(ex.getMessage());
  • 3
    Hello and welcome to Salesforce Stack Exchange! This question is not quite up to the expected quality. I would recommend adding in more information on your use case, as well as anything you have already tried and relevant code examples. See here for more info: salesforce.stackexchange.com/help/how-to-ask – Ayoola Olapo Jun 25 at 13:07
  • 4
    Hi, and welcome to SFSE! What have you tried so far? Where exactly are you stuck? Please read more about How to Ask, then edit your question to include any relevant code or additional information so we can better assist you. – sfdcfox Jun 25 at 13:07
  • Thank you guys, the stuck is that I can't pass the value from Unsorted to the Sorted column and sort it. – Greg Jason Jun 25 at 17:39
  • I found the reason, now the value is perfectly saved in the Sorted column, but I still can`t sort the result. I updated the post. Any help will be appreciated – Greg Jason Jun 25 at 23:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.