0

enter image description here

Please help with code of how to create this button(Age Of Escalation Action). I have written this till now.

<apex:page standardController="User" >
<apex:form >
<apex:pageBlock >
<apex:pageblockSection title="Escalation Action Details" >

<apex:inputField label="Escalate to" value="{!User.contactid}" id="a"/><br/>
<apex:inputtext label="Escalate Template" /><br/>
<apex:inputField label="Assign owner for the escalated case" value="{!User.contactid}"/><br/>
<apex:inputTextarea label="Additional Emails"/>
</apex:pageblockSection>
<apex:commandButton value="save"/>
<apex:commandButton value="cancel"/>
</apex:pageBlock>
</apex:form>
</apex:page>

Kindly help me with code for the button.

0

1 Answer 1

0

This should be written using StandardController = "Case". When you escalate a Case you're changing the Owner of the Case. As such, you'll want to change the OwnerId and have a lookup for the Owner as well as their email address.

EDIT:

I can't write your code for you since I don't know exactly what you need or want to do. You won't learn how to do it for yourself unless you stick to it until you've worked it out yourself. Refer to the documentation in the Visualforce Developer’s Guide and also use Trailhead Modules and the Visualforce Workbook to learn how to write Visualforce. You'll also likely find the Object Reference comes in very handy when you're writing code. At least I've found it very helpful to me.

Below are a few specific lines in your code that you'll definitely need to change:

<apex:inputField label="Escalate to" value="{!User.contactid}" id="a"/><br/>
// this should be changed to value="{!User.Id} since it's a look-up to a User

<apex:inputtext label="Escalate Template" /><br/>
// I would expect this to be a link to the Template you want to use, perhaps a urlfor() with a label
// Otherwise, how will your controller know what the inputtext refers to?
// Are you certain there isn't a custom controller or controller extension for this?

<apex:inputField label="Assign owner for the escalated case" value="{!User.contactid}"/><br/>
// Once again, this should be value="{!User.Id}, but you're assigning it to !Contact.OwnerId 

Its occurred to me that since you're presumably using this with an email template, the template will require a specific controller. I would check the template to see which controller you need to be using and look for the merge fields you need to supply to the template.

2
  • Can you help me with the entire code? I am unable to go further. Commented Jun 28, 2016 at 6:45
  • See my edits above for some guidance
    – crmprogdev
    Commented Jun 28, 2016 at 12:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .