• JohnTaylorUK
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

Hi All,

 

I hope this is a simple problem and I'm just missing something.

 

I am trying to build a controller extension that saves a VF form page details and then reloads the same page.

 

This should be straight forward but when I try and use the documented way to do this, the data is saved and the return page is the page I wanted, but along with it the URL of the page , a long string of test has been appended to the end, the apex seems to be wanting to map the details of the fields on the page when it reloads.

 

This in itself would not a problem, but some users are getting an authentication error when the page reloads, and i assume this has something to do with it.

 

Any help would be great.

 

Thanks all

Hi All,

 

I have a very basic trigger that moves a text field into an email field, to enable a workflow to send out an email to this address.

 

I would like to write a test class for this trigger to help keep everyting in order

 

 

trigger UpdateEmailFieldWithRealEmail on Offer__c (before insert,before Update)

{
for (Offer__c OFF : Trigger.new)

    {
OFF.candidates_Email_Address_For_Chases__c = OFF.Candidates_Email_Address__c;
    }
    
}

 

 

The trigger itself is very simple and does what I needed but I could now really do this help to write the test class

 

Any pointers would be great

 

Thanks

 

John

Hi,

 

I am trying to build a formula or workflow on my object that will look at all the fields on the object and let me know which one was edited last.

 

History is enabled and does some on this work for me , but I have more than 20 fields that need tracking to let me know which one was changed.

 

Any ideas ?

 

Thanks guy

Hi All,

 

I have a quick question and it doesnt appear to have been asked before.

 

I have a requirement to to set the value of a picklist inputfield value on load. So I can can make three pages. When a user loads page A , I would like a picklist value to be set to A, page b to B and page C to C. This value is then saved into my object and used in a workfow to send emails and the value sets the template.

 

I suppose you can call this dynamic default values (which would be really cool..).

 

Anyone have any ideas how this can be done, I dont want to have to creat three extensions which a set value in if I can help it.

 

Thanks in advance guys

 

John

Hi All,

 

I have built a little javascript timer that wii eventually start when a user visits a html page (soon to be a sites page).

 

I am trying to work out if it would be possible (and how..) to pass the variable from that timer to a field on an object.

 

I've included the code below if that helps, and im sure im going to need an add an ID= here and there but am a little bit stuck when it comes to writting the controller...

 

Any help to just work out if this is possible would be great..

 

Many Thanks to you all...:smileywink:

 

 

<HTML>


<HEAD>

<script language="JavaScript" type="text/javascript">
var sec = 0;
var min = 0;
var hour = 0;
function stopwatch(text) {
   sec++;
  if (sec == 60) {
   sec = 0;
   min = min + 1; }
  else {
   min = min; }
  if (min == 60) {
   min = 0; 
   hour += 1; }

if (sec<=9) { sec = "0" + sec; }
   document.clock.stwa.value = ((hour<=9) ? "0"+hour : hour) + " : " + ((min<=9) ? "0" + min : min) + " : " + sec;

  if (text == "Start") { document.clock.theButton.value = "Stop "; }
  if (text == "Stop ") { document.clock.theButton.value = "Start"; }

  if (document.clock.theButton.value == "Start") {
   window.clearTimeout(SD);
   return true; }
SD=window.setTimeout("stopwatch();", 1000);
}

function resetIt() {
  sec = -1;
  min = 0;
  hour = 0;
  if (document.clock.theButton.value == "Stop ") {
  document.clock.theButton.value = "Start"; }
  window.clearTimeout(SD);
 }
 
</script>

</HEAD>

<BODY>


<table bgcolor="#c0c0c0" align="center" border="2" width="140" cellspacing="0">

  <tr>
     <td align="center">
       <form name="clock">
       <input type="text" size="12" name="stwa" value="00 : 00 : 00" style="text-align:center" /><br />
       <input type="button" name="theButton" onClick="stopwatch(this.value);" value="Start" />
       <input type="button" value="Reset" onClick="resetIt();reset();" />
       </form>
     </td>
  </tr>     
</table>
</HTML>

 

 

Hi Al,

 

I am trying to make my first very simple sites page. The page will be used to enter information into a custom object.

 

I have build in the page and everything looks fine when viewing the page inside on Salesforce, the Inputfield fields bind back to the fields in the object and the custom controller I have built to re-direct the user once they have submitted the data works fine.

 

In fact, while logged in to Salesforce, everything is perfect.

 

However, when I try and put this visualforce page on Force.com Sites, the fields are not shown. Save buttons and text will show fine but I can not seem to find away to get the <Apex:Inpuntfields> to show.

 

I assumed that this was something to be with the security and public access settings on the site I had created. I have however played around with these setting a lot and have granted the highest level of Create, Edit and Read access to all objects in order to try and get around this issue.

 

Below is the stripped back page code , however, I doubt this is a code issue , as I asl get this problem when try to use only two fields off a  standard object and these fields still dont show. 

 

 

================== CODE ========================

 

 

<apex:page standardController="Ravs__c"
           extensions="RavExtention"
           title="Contact Us" showHeader="false"
           standardStylesheets="true">
           <BR/><BR/><BR/><BR/>
    <apex:form >
        <apex:pageBlock title="">
            <apex:pageMessages />
            
            <apex:pageBlockButtons >
                              <apex:commandButton value="Submit"
                              action="{!saveLead}" />
            </apex:pageBlockButtons>
          
            <apex:pageBlockSection columns="1">
<apex:inputField value="{!Ravs__c.Name}"/>
<apex:inputField value="{!Ravs__c.Additional_information__c}"/>
<apex:inputField value="{!Ravs__c.Area__c}"/>
<apex:inputField value="{!Ravs__c.Contract_Type__c}"/>
<apex:inputField value="{!Ravs__c.Corrected_Date_to_Pub_Vac__c}"/>
<apex:inputField value="{!Ravs__c.Date_Time_Entered_Onto_MSN__c}"/>
<apex:inputField value="{!Ravs__c.Date_Time_Raised_By_RSC__c}"/>
<apex:inputField value="{!Ravs__c.Time_email_sent_to_HRA__c}"/>
<apex:inputField value="{!Ravs__c.Date_to_publish_vacancy__c}"/>
<apex:inputField value="{!Ravs__c.Division__c}"/>
<apex:inputField value="{!Ravs__c.Email_address_of_practice_manager__c}"/>
<apex:inputField value="{!Ravs__c.Email_of_clinical_support_colleague__c}"/>
<apex:inputField value="{!Ravs__c.Email_Requestor__c}"/>
<apex:inputField value="{!Ravs__c.External_e_mail_address__c}"/>
<apex:inputField value="{!Ravs__c.Full_Time_Part_Time__c}"/>
<apex:inputField value="{!Ravs__c.Group_Type__c}"/>
<apex:inputField value="{!Ravs__c.HRA_Email__c}"/>
<apex:inputField value="{!Ravs__c.HRA_For_This_Store__c}"/>
<apex:inputField value="{!Ravs__c.HRA_Name__c}"/>
<apex:inputField value="{!Ravs__c.HRC_for_This_RAV__c}"/>
<apex:inputField value="{!Ravs__c.I_Grasp_Store_Name__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_1_Date_and_Time__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_2_Date_and_Time__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_3_Date_and_Time__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_availability_dates_and_time__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_Name_1__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_Name_2__c}"/>
<apex:inputField value="{!Ravs__c.Interviewer_Name_3__c}"/>
<apex:inputField value="{!Ravs__c.Is_this_a_Management_role__c}"/>
<apex:inputField value="{!Ravs__c.Job_title_Of_Requestor__c}"/>
<apex:inputField value="{!Ravs__c.Location_supplement_to_be_advertised__c}"/>

            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
       
</Apex:Page>

 

I hope someone can help with this ..

 

Hi All,

 

I hope this is a simple problem and I'm just missing something.

 

I am trying to build a controller extension that saves a VF form page details and then reloads the same page.

 

This should be straight forward but when I try and use the documented way to do this, the data is saved and the return page is the page I wanted, but along with it the URL of the page , a long string of test has been appended to the end, the apex seems to be wanting to map the details of the fields on the page when it reloads.

 

This in itself would not a problem, but some users are getting an authentication error when the page reloads, and i assume this has something to do with it.

 

Any help would be great.

 

Thanks all

Hi All,

 

I hope this is a simple problem and I'm just missing something.

 

I am trying to build a controller extension that saves a VF form page details and then reloads the same page.

 

This should be straight forward but when I try and use the documented way to do this, the data is saved and the return page is the page I wanted, but along with it the URL of the page , a long string of test has been appended to the end, the apex seems to be wanting to map the details of the fields on the page when it reloads.

 

This in itself would not a problem, but some users are getting an authentication error when the page reloads, and i assume this has something to do with it.

 

Any help would be great.

 

Thanks all

Hi All,

 

I have a quick question and it doesnt appear to have been asked before.

 

I have a requirement to to set the value of a picklist inputfield value on load. So I can can make three pages. When a user loads page A , I would like a picklist value to be set to A, page b to B and page C to C. This value is then saved into my object and used in a workfow to send emails and the value sets the template.

 

I suppose you can call this dynamic default values (which would be really cool..).

 

Anyone have any ideas how this can be done, I dont want to have to creat three extensions which a set value in if I can help it.

 

Thanks in advance guys

 

John

Hi All,

 

I have built a little javascript timer that wii eventually start when a user visits a html page (soon to be a sites page).

 

I am trying to work out if it would be possible (and how..) to pass the variable from that timer to a field on an object.

 

I've included the code below if that helps, and im sure im going to need an add an ID= here and there but am a little bit stuck when it comes to writting the controller...

 

Any help to just work out if this is possible would be great..

 

Many Thanks to you all...:smileywink:

 

 

<HTML>


<HEAD>

<script language="JavaScript" type="text/javascript">
var sec = 0;
var min = 0;
var hour = 0;
function stopwatch(text) {
   sec++;
  if (sec == 60) {
   sec = 0;
   min = min + 1; }
  else {
   min = min; }
  if (min == 60) {
   min = 0; 
   hour += 1; }

if (sec<=9) { sec = "0" + sec; }
   document.clock.stwa.value = ((hour<=9) ? "0"+hour : hour) + " : " + ((min<=9) ? "0" + min : min) + " : " + sec;

  if (text == "Start") { document.clock.theButton.value = "Stop "; }
  if (text == "Stop ") { document.clock.theButton.value = "Start"; }

  if (document.clock.theButton.value == "Start") {
   window.clearTimeout(SD);
   return true; }
SD=window.setTimeout("stopwatch();", 1000);
}

function resetIt() {
  sec = -1;
  min = 0;
  hour = 0;
  if (document.clock.theButton.value == "Stop ") {
  document.clock.theButton.value = "Start"; }
  window.clearTimeout(SD);
 }
 
</script>

</HEAD>

<BODY>


<table bgcolor="#c0c0c0" align="center" border="2" width="140" cellspacing="0">

  <tr>
     <td align="center">
       <form name="clock">
       <input type="text" size="12" name="stwa" value="00 : 00 : 00" style="text-align:center" /><br />
       <input type="button" name="theButton" onClick="stopwatch(this.value);" value="Start" />
       <input type="button" value="Reset" onClick="resetIt();reset();" />
       </form>
     </td>
  </tr>     
</table>
</HTML>