function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VisionaryVisionary 

simple vf page with custom handling of Save buttons

I'm new to VF so please be gentle - here is the scenario:

 

we have a custom object, the fields in this object will change (rather new ones will be added often) as new categories emerge...

 

So i need a way to create the VF page where i don't have to code every single field every time there is a new field created, but i need to be able to handle the Save function, perhaps the Save&New etc.. in a special way.

 

How can i create this? oh and the page should open in EDIT mode.

 

please help or let me know if this is even possible? 

 

<apex:page standardController="My_Feedback__c">
     <apex:form >
           <apex:detail />
     </apex:form>
</apex:page>

 

clicking "edit" or "delete" or "clone" standard buttons on the page that renders doesn't do anything...

joshbirkjoshbirk

What do you need to handle every save?  What you describe is possible but actually fairly complicated.  If the logic can be encapsulated in a Trigger, that would be better.

VisionaryVisionary

I haven't worked with triggers yet, so let me know if a trigger would work for this.

 

Here is the scenario:

 

I have created a related list on a custom object.

I have modified the "New" button on the related list to pass the Identifier (lookup) for the parent object, but when someone goes into an already created item in the related list, then clicks Edit > Save & New the identifier does not populate, thus the lookup relationship is lost.

 

here are some pics to help explain: 

attached is the screen shot when i click "NEW" button from the related list (Notice i pass a value in the URL)

 

------------------ > link to the image ---------> http://mkscommunications.com/crm1.JPG

 

however- when i click EDIT of an existing item in the related list and click SAVE & NEW, the Promoter field is not filled in by default...

 

i guess a trigger would do the job, fill in the current object's ID or rather "Name" value into the Promoter field?

 

 

 

joshbirkjoshbirk

Yeah, I think so.

 

What does "Promoter" actually point to?  Is that a lookup field on the parent object?  Could it also just be a formula field?