| | |
| | | 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'); |
| | | }*/ |
| | |
| | | } |
| | | |
| | | 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(); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |