You need to sign in to do that
Don't have an account?
etechcareers
Insert after the fact????
Hi all:
I am building a wizard on 2 custom object and basically the name in one obect is an autonumber. So i need this autonumber to appear in the second object which links to the first custom object.
for some reason it is not working from my VF page when I hit save
public PageReference saveit() { System.Debug('rtpspm' + ApexPages.currentPage().getParameters().get('rtpspm')); System.debug('oppid' + ApexPages.currentPage().getParameters().get('oppId')); //Payment Detail pd.Donation__c = ApexPages.currentPage().getParameters().get('oppId'); pd.recordtypeid = ApexPages.currentPage().getParameters().get('rtpspm'); insert pd; List<Payment_Detail__c> pdName = new List<Payment_Detail__c>(); pdName = [Select Name from Payment_Detail__c where Id=:pd.id Limit 1]; System.Debug('pd.Name' + pdName[0].Name); //Allocation alloc.Donation__c = ApexPages.currentPage().getParameters().get('oppId'); alloc.Payment_Detail__c = pdName[0].Name ; insert alloc; PageReference opptyPage = new PageReference('/' + ApexPages.currentPage().getParameters().get('oppId')); return opptyPage.setRedirect(true); }
Where am I going wrong????
Is payment_detail__c a lookup? if so you should be using the Id of the related record, not its name.
All Answers
Is payment_detail__c a lookup? if so you should be using the Id of the related record, not its name.
Thank you so much... One more question
How in VF can I tell the user for what donation they are making the payment for:
I tried:
Try it with an explicit get method:
Hi Thank you so much... Awesome if I can give 2 aceepted solutions I would give one to you as well...
Thanks
Z