+ Start a Discussion

Help with Visualforce page

I am new at coding and am probably way over my head. However I need to get this figured out.


Below is the code I have for a current visualforce page. I need to add a trigger that updates the opportunity master-detail lookup field with the id from the custom field opportunity name text.


Fields in Custom Object (Project)

Opportunity Name            Opportunity_Name__c      Lookup(Opportunity)

Opportunity name text     Opportunity_name_text__c     Formula (Text)--This formula was setup to pull the Opportunity id that I want the master detail lookup to relate to.



This visualforce page is setup for a cloning button of a custom object. Thank you for your help on this issue!


<apex:page standardController="Milestone1_Project__c"
    <apex:form >
        <apex:pageBlock title="Project Clone">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save"
                <apex:commandButton value="Cancel"
            <apex:pageBlockSection columns="1">
                <apex:pageBlockSectionItem > 
                    <apex:outputLabel value="New Project Name"
                    <apex:inputText id="new_name"

 btw, I received this coding from: Milestones PM - Project Planning and Task Management Application - Force.com Labs. They have a copywrite on the coding as is. However they do allow changes to the coding. I am adding this info because there is copywrite stuff on the visualforce page I pulled it from.


On the page, there is a button called "Save" which calls a method "createClone" - is this the action you want to modify?


There should be a method called createClone in your Milestone1_Clone_Project_Controller Apex Class.  That is where you would put the logic.