• noob123
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies

I am trying to update a Date field (Destination) with the value from another Date field (Source). I am calling the Source field in my page using an inputHidden tag. I'm setting the date fields like so:

 

destinationObj.Start_Date__c = sourceObj.Start_Date__c;

 

 

When I do this, I get the following error below:

 

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, Start Date: value not of required type: Tue Feb 24 00:00:00 GMT 2009: [Start_Date__c]

Class.MyController.completeMove: line 77, column 9
Class.MyController.Move: line 98, column 9
External entry point

 

However, when I change it to to an inputField tag it works perfectly.  Any reason why it wouldn't work when I hide that field? I don't want the user to have the ability to change this field as it is supposed to be set automatically behind the scenes.

 

Thanks!

Two minor hurdles between me and my first functioning Visualforce mini-app, both related issues.

 

Within my extension class for a Contact controller I am trying to programmatically create a custom object that is related to a Contact. I am creating the custom object and then trying to populate it with certain values from the Contact record. It works for some fields, but not others.  I am trying to populate the Name of the object and a date field, like so:

 

 In my constructor I have:

 

CustomObject__c  customobj = new CustomObject__c();

contact = (Contact)controller.getRecord();

 

 

In my method I have:

 

customobj.Name = 'Account: ' + contact.Account.Name;

customobj.Date__c = contact.Last_Move_Date__c;

 

The first line returns "Account: null" and the second just never updates the Date__c field at all.

 

Any thoughts? Thanks!

I have a button on a Contact details page that launches a Visualforce page.  This Visualforce page uses a custom controller for various reasons, but I need to reference the specific Contact that the user launched from.  Is there an easy way to pass the Contact ID as a parameter to the new Visualforce page and reference it throughout my code?

 

Thanks..

I'm new to Visualforce and looking to create a page that maps out this basic workflow:

 

1) User selects a value from a picklist (not tied to any specific object).

2) A list of records for a specific entity is generated based on the value selected in the picklist.

 

How can I create a basic field and then use that selected value to plug-in to another query / list?

 

Thanks!

Two minor hurdles between me and my first functioning Visualforce mini-app, both related issues.

 

Within my extension class for a Contact controller I am trying to programmatically create a custom object that is related to a Contact. I am creating the custom object and then trying to populate it with certain values from the Contact record. It works for some fields, but not others.  I am trying to populate the Name of the object and a date field, like so:

 

 In my constructor I have:

 

CustomObject__c  customobj = new CustomObject__c();

contact = (Contact)controller.getRecord();

 

 

In my method I have:

 

customobj.Name = 'Account: ' + contact.Account.Name;

customobj.Date__c = contact.Last_Move_Date__c;

 

The first line returns "Account: null" and the second just never updates the Date__c field at all.

 

Any thoughts? Thanks!

I'm new to Visualforce and looking to create a page that maps out this basic workflow:

 

1) User selects a value from a picklist (not tied to any specific object).

2) A list of records for a specific entity is generated based on the value selected in the picklist.

 

How can I create a basic field and then use that selected value to plug-in to another query / list?

 

Thanks!