You need to sign in to do that
Don't have an account?
Creating 1:1 Relationship in VF, at What Point?
I have a visualforce page that, when the user clicks a button, creates a new record (profile) based on the current record (opportunity).
I want to link the new profile to the existing opportunity via a lookup on the existing record (essentially creating a 1:1 relationship).
At what point in my code and how can I edit the existing opportunity profile field to update it to the newly created profile id?
I have tried the following, but it does not work:
// Create the project
try {
res = sforce.connection.create([project]);
} catch (err) {
alert(err);
}
if (res[0].getBoolean("success")) {
ret = res[0].id;
sourceOpp.Project_Profile__c = project.Id;
}
return (ret);
}
Note: this page is written in javascript.