You need to sign in to do that
Don't have an account?
Copy field Values
dear experts ,
i have a custom object called prospects with two record types ( suspect and prospect) . if some one created a suspect they have an option to convert suspect to prospect . so that way two records will be created. on each suspect lay out we have button called "convert" it iwll create new record when they click the button. but i want to copy some of the fields to when the push the button. i am not sure how to do this. any help will be appriciated. i would like to copy fields like for ex ( Type__C, notes__C,picklist__c) to prospect record .
here is my code for the suspect to convert.
<apex:page standardController="Prospect__c" extensions="SusConvertToPros" action="{!convert}" showHeader="true" sidebar="true"> <apex:pageMessages /> </apex:page> ----------------------------------------- public with sharing class SusConvertToPros { private ApexPages.StandardController standardController = null; public SusConvertToPros ApexPages.StandardController controller) { standardController = controller; } public PageReference convert() { List<Prospect__c> prospects = new List<Prospect__c>(); PageReference prospectPage = null; try { prospects = SuspectsService.convertToProspects( new Set<ID> { standardController.getId() }); String partialURL = '/' + prospects[0].Id; prospectPage = new PageReference(partialURL); } catch (Exception e) { ApexPages.addMessages(e); } return ApexPages.hasMessages() ? null : prospectPage; } }
any help would be appriciated.
why not (if you are determined to use static methods)?