| | |
| | | |
| | | public Boolean isIEDealer{get; set; } |
| | | |
| | | public String staticResource {get; set;} |
| | | |
| | | public String oppid {get; set;} |
| | | |
| | | public NewCrossRegionalSalesController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | |
| | | accId = System.currentPageReference().getParameters().get('accid'); |
| | | conId = System.currentPageReference().getParameters().get('conId'); |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | |
| | | List<Account> accList = [select Id, Name, ProductSegment__c,compo_Acc__c,UserType__c from Account where Id = :accId]; |
| | | if (accList.size() > 0) { |
| | | acc = accList[0]; |
| | | } |
| | | |
| | | List<Contact> conList = [select Id, Name from Contact where Id = :conId]; |
| | | List<Contact> conList = [select Id, Name from Contact where Id = :conId];//pi |
| | | if (conList.size() > 0) { |
| | | con = conList[0]; |
| | | } |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | //测试环境ID |
| | | opp.RecordTypeId = '0120T0000002Vh9'; |
| | | //opp.RecordTypeId = '0120T0000002Vh9'; |
| | | //正式环境ID |
| | | //opp.RecordTypeId = '0120K000000OpaG'; |
| | | opp.RecordTypeId = '0120K000000OpaG'; |
| | | opp.CrossCooperativeProject__c = true; |
| | | |
| | | insert opp; |
| | |
| | | |
| | | hasError = false; |
| | | |
| | | String url = baseUrl + '\\' + opp.Id; |
| | | return new Pagereference(url); |
| | | // String url = baseUrl + '\\' + opp.Id; |
| | | // return new Pagereference(url); |
| | | oppid = opp.id; |
| | | return null; |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage())); |