You need to sign in to do that
Don't have an account?
abi dzar
Show Specific Record in Visual Force without passing Id in URL
I'm trying to make a Custom Visual Force page that will specifically open a fixed case without passing the Case Id in the URL.
Can I do that?
Kind Regards,
Abi Dzar
So you want to stay on your custom visualforce page but allow the user to edit some values?
In that case, you need to pull all the values that can be changed as part of the constructor SOQL call. Remove the page level action, as you want to leave the user where they are. Then in your page, simply use apex:inputField components to display the existing values and allow the user to edit them. Finally, you'll need a save action method to apply the changes to the database.
All Answers
If you don't pass the case id on the URL, you will need some way to determine which case should be opened. Do you have some rules for this?
Thanks for the reply bob_b.
How do we set that?
The only rule is to make query check weather is there a case with specific email or not.
Then show in VF.
I tried something. by using action function in <apex:page> but it redirect me to default editing.
I want it to be viewed inside the page.
regards,
Abi Dzar
In that case you need a controller that will carry out the SOQL to locate the case in question.
This is my code
Hope this will help
I'm sorry, there is some mistake in the pasted code. I hope this is better.
So do you want to display the information in your current page?
If so, you shouldn't return a page reference to a different page. Rather you should use the mycase property to back the output fields etc that you have in this page.
Or am I misunderstanding what you are trying to do?
Yes, that what I want to do.
But, How do I do that?
When You mention "output fields", means, the data can still be modified rite?
How do I do that?
Thanks.
So you want to stay on your custom visualforce page but allow the user to edit some values?
In that case, you need to pull all the values that can be changed as part of the constructor SOQL call. Remove the page level action, as you want to leave the user where they are. Then in your page, simply use apex:inputField components to display the existing values and allow the user to edit them. Finally, you'll need a save action method to apply the changes to the database.
Bob, I got the idea.
The only problem is I dunno how to stay at my own custom VF.
and let user edit the data from that VF.
Just remove your page level action. There's no need to try to send the user off anywhere else, just leave them where they are.
Thanks Bob,
I tried to access using inputfield and remove the page level action.
Then its all done. :)
Thanks a lot.