+ Start a Discussion
Ryan NeelRyan Neel 

I'm receiving the following error after deploying my custom component to our prod environment:Error while creating component for lightning component quick action [Unable to find action 'productcats' on the controller of c:UpdateStoreVisitInventory]

Here's the controller:
public class UpdateStoreVisitInventoryController {
  @Auraenabled //For the init function of UpdateStoreVisitInventory comoponent. Gets the Product Catalogs from the Ship To the store visit is associated with
    public static List<Ship_To_Product_Catalog__c> shipcat(Id storevisitId){
        system.debug(storevisitId);
        return [Select Id,Get_Inventory__c,Product__r.Name, Product__r.NoPrefixProduct__c, Product__r.Product_Category__c,Quantity__c FROM Ship_To_Product_Catalog__c WHERE Ship_To__c =: storevisitId ORDER BY Get_Inventory__c DESC];
    }
  @Auraenabled //For the combobox filter. Gets all Product Categories and turns them into a list.	
    public static List<sObject> productcats(Id storevisitId) {
//        return [SELECT Product_Category__c FROM Product2 WHERE Product_Class__c NOT IN ('Installs', 'None', 'Repair', 'Resale', 'Strings') GROUP BY Product_Category__c];
		return [SELECT Product__r.Product_Category__c FROM Ship_To_Product_Catalog__c WHERE Ship_To__c =: storevisitId GROUP BY Product__r.Product_Category__c];
    }
    
  @AuraEnabled //For the Update fucntion in UpdateStoreVisitInventory component. Takes the List of Product Catalogs compares to the Updated SPIds and updates accordingly
    public static void updateSPCat(List<Ship_To_Product_Catalog__c> SPCat, List<Id> SPId, Id storevisitId ){
        system.debug(SPCat);
        system.debug(SPId);
        List<Ship_To_Product_Catalog__c> upSPCat = new List<Ship_To_Product_Catalog__c>();
        
        for(Ship_To_Product_Catalog__c temp : SPCat){
            system.debug(temp);
            if(SPId.contains(temp.Id)){
                temp.Date_Last_Reported_In_Store__c = date.today();
                upSPCat.add(temp);
            }
        }
        update upSPCat;
    } 
}

 
Best Answer chosen by Ryan Neel
ShirishaShirisha (Salesforce Developers) 
Hi Ryan,

Greetings!

Can you please double check if you have deployed the controller to the destination org if it doesn't exist in the target org.So,try by deploying the apex class along with the lightning component to avoid the issues.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Ryan,

Greetings!

Can you please double check if you have deployed the controller to the destination org if it doesn't exist in the target org.So,try by deploying the apex class along with the lightning component to avoid the issues.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
This was selected as the best answer
Ryan NeelRyan Neel
Hi Shirisha! I had everything deployed, but I had deployed the parts separately. Redeploying them all together worked. Thank you so much!