buli
2022-05-13 2f4492ee18f90274582fcc2bb06f5e9bf64136e8
force-app/main/default/classes/NewRepairPartsController.cls
@@ -4,8 +4,7 @@
   public String swoId{get;set;}
   public String repairId{get;set;}
    public Boolean pageClose{get;set;}
    public String baseUrl{get;set;}
    public String productId{get;set;}
    /*public NewRepairPartsController(ApexPages.StandardController stdController) {
        swoId = System.currentPageReference().getParameters().get('swoId');
    }*/
@@ -16,13 +15,6 @@
    }
    public void init(){
        baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        String path = URL.getCurrentRequestUrl().getPath();
        if (path.indexOf('/apex') > 0) {
            baseUrl += path.substring(0, path.indexOf('/apex'));
        } else if (path.indexOf('production/') > 0) {
            baseUrl += '/production';
        }
       if(String.isNotBlank(repairId)){
         Schema.DescribeSobjectResult repairPartType = RepairPart__c.sObjectType.getDescribe();
         Map<String, Schema.SObjectField> repairPart_fields = repairPartType.fields.getMap();
@@ -80,17 +72,6 @@
            return;
        }else{
            return;
        }
    }
    public void productReturn(){
        if(String.isNotBlank(productId)){
            List<Product2> productList = [SELECT Id, Name, Product_ECCode__c, Description, ProductCode FROM Product2 WHERE Id = :productId limit 1];
            if(productList!=null && productList.size()!=0){
                repairPart.PART_NUMBER__c = productList[0].Product_ECCode__c;
                repairPart.DESCRIPTION__c = productList[0].Description;
                repairPart.ITEM__c = productList[0].ProductCode;
            }
        }
    }
}