• cignus
  • NEWBIE
  • 25 Points
  • Member since 2012

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

Hi

 

I have created an Apex class called relation. It has a public field of type contact. I want to input this contact from a VF page.

When I add 

<apex:inputField value="{!relation.contact}"

 I get this exception:

<apex:inputField> can only be used with SObject fields.	

I added a public contact field in my controller called C.

I tried to use the contact from my controller but again got the same error.

 

Why is lookup bounded to SObject fields and not SObject types?

Hi

 

I have added two record types(RT1,RT2) to Contact. I want to set the value to RT2 if some condition is met. (RT1 is default)

 

I added this code to my controller before updating.

		c.RecordType =  [select Id from RecordType where Name = 'RT2' and SobjectType = 'Contact'];
		update c;

 

When I create a new Contact the RecordType is correctly set to RT1.

But when I want to change it to RT2 it does not change. (the line is executed and the recordTypeId value is changed (I debugged))

 

Then I moved this codes into a trigger

trigger updateRecordType on Contact (before update) {
    system.debug('Entered Contact Trigger');
    for (Contact c: Trigger.new) {
        system.debug('c.RecordType before trigger = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        if (condition){
            c.RecordType =  [select Id,Name from RecordType where Name = 'RT2' and SobjectType = 'Contact'];
            system.debug('c.RecordType = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        }else{
            c.RecordType =  [select Id,Name from RecordType where Name = 'RT1' and SobjectType = 'Contact'];
            system.debug('c.RecordType = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        }
    }
}

 From all the debug lines I get the correct RT values, but still RT is not changed after the record is saved.

 

Cheers

Hi

 

I need add some functionality to contact page. I want a copy of contact edit page to add  a controller extension. Has anyone done that before?

I can add all the fields to a VF page but I want the page look exactly like standard contact page.

 

Behzad

Hi

 

I want to make a page with a table of some data. I want to have a radio button column which has a radio button beside each line.

I tried using selectRadio with selectOption but the resulting radion buttons had deifferent names, so when I select one of them the other ones do not becime unseleeccted

 

Cheers

  • April 19, 2012
  • Like
  • 0

Hi

 

I need to call out to a remote server. I have to login and get sessionID and then send the sessionID back as a cookie. 

How can I cookie in HTTP Request?

 

Cheers

  • April 16, 2012
  • Like
  • 0

Hi 

 

I am creating a VF page for contacts. When I put the <apex:inputField value="{!ownerId}" on the page it shows and empty input field, but the same thing on the standard layout is filled with current user.

How can I imitate the standard form's behavior with minimum changes in data model?

 

Cheers

  • April 13, 2012
  • Like
  • 0

Hi 

I want to create a VF page for contact.( I need to remove some fields and add some extended functionality)

When I add <apex:inputField value="{!contact.name}"> what I get is a label and no input field, but in the standard contact layout you can move the name field and it creates a combo box (salutation) and firstname and last name.

 

The same happens for the address.

How can  use the name and address component in my own VF page?

 

Cheers

 

  • April 13, 2012
  • Like
  • 0

Hi

I have created a custom page and a tab for it. When I select the tab, everything goes well except that tab is not highlighted. Sometimes another tab gets highlighted and sometimes not tab.

Cheers

 

  • April 12, 2012
  • Like
  • 0

Hi

I want to create a person custom object. I want to have first name and last name separately but I also want them both to be shown in pick list and searches....

I tried to create a dummy name field (full name) and fill it with fName+ lName. but in the default layout I cannot remove the name field from the form or set a temp default value on it.

any suggestions?

Would it help if I made a custom form and left out the name field?

 

Cheers,

Behzad

  • April 11, 2012
  • Like
  • 0

I want to add some extended functionality to contact page. I need to keep the current layout and add some buttons and fields to it. 

If I want to use a custom controller or add a controller extension, I need to build the page from the scratch.

I'm looking for a way to keep the standard page layout and apply some minor changes. 

  • April 11, 2012
  • Like
  • 0

Hi

 

I have added two record types(RT1,RT2) to Contact. I want to set the value to RT2 if some condition is met. (RT1 is default)

 

I added this code to my controller before updating.

		c.RecordType =  [select Id from RecordType where Name = 'RT2' and SobjectType = 'Contact'];
		update c;

 

When I create a new Contact the RecordType is correctly set to RT1.

But when I want to change it to RT2 it does not change. (the line is executed and the recordTypeId value is changed (I debugged))

 

Then I moved this codes into a trigger

trigger updateRecordType on Contact (before update) {
    system.debug('Entered Contact Trigger');
    for (Contact c: Trigger.new) {
        system.debug('c.RecordType before trigger = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        if (condition){
            c.RecordType =  [select Id,Name from RecordType where Name = 'RT2' and SobjectType = 'Contact'];
            system.debug('c.RecordType = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        }else{
            c.RecordType =  [select Id,Name from RecordType where Name = 'RT1' and SobjectType = 'Contact'];
            system.debug('c.RecordType = '+c.RecordType.Name +' '+ c.RecordType.id +' '+c.RecordTypeId );
        }
    }
}

 From all the debug lines I get the correct RT values, but still RT is not changed after the record is saved.

 

Cheers

Hi

 

I need add some functionality to contact page. I want a copy of contact edit page to add  a controller extension. Has anyone done that before?

I can add all the fields to a VF page but I want the page look exactly like standard contact page.

 

Behzad

Hi

 

I want to make a page with a table of some data. I want to have a radio button column which has a radio button beside each line.

I tried using selectRadio with selectOption but the resulting radion buttons had deifferent names, so when I select one of them the other ones do not becime unseleeccted

 

Cheers

  • April 19, 2012
  • Like
  • 0

Hi

 

I need to call out to a remote server. I have to login and get sessionID and then send the sessionID back as a cookie. 

How can I cookie in HTTP Request?

 

Cheers

  • April 16, 2012
  • Like
  • 0

Hi 

 

I am creating a VF page for contacts. When I put the <apex:inputField value="{!ownerId}" on the page it shows and empty input field, but the same thing on the standard layout is filled with current user.

How can I imitate the standard form's behavior with minimum changes in data model?

 

Cheers

  • April 13, 2012
  • Like
  • 0

Hi 

I want to create a VF page for contact.( I need to remove some fields and add some extended functionality)

When I add <apex:inputField value="{!contact.name}"> what I get is a label and no input field, but in the standard contact layout you can move the name field and it creates a combo box (salutation) and firstname and last name.

 

The same happens for the address.

How can  use the name and address component in my own VF page?

 

Cheers

 

  • April 13, 2012
  • Like
  • 0

Hi

I have created a custom page and a tab for it. When I select the tab, everything goes well except that tab is not highlighted. Sometimes another tab gets highlighted and sometimes not tab.

Cheers

 

  • April 12, 2012
  • Like
  • 0

Hi

I want to create a person custom object. I want to have first name and last name separately but I also want them both to be shown in pick list and searches....

I tried to create a dummy name field (full name) and fill it with fName+ lName. but in the default layout I cannot remove the name field from the form or set a temp default value on it.

any suggestions?

Would it help if I made a custom form and left out the name field?

 

Cheers,

Behzad

  • April 11, 2012
  • Like
  • 0

I want to add some extended functionality to contact page. I need to keep the current layout and add some buttons and fields to it. 

If I want to use a custom controller or add a controller extension, I need to build the page from the scratch.

I'm looking for a way to keep the standard page layout and apply some minor changes. 

  • April 11, 2012
  • Like
  • 0

I'm overriding the default tab view for the Case object.  It's all easy enough to add access to existing views via a dropdown, just like the default tab would have

 

 

      <apex:selectList value="{!filterId}" size="1">
        <apex:actionSupport event="onchange" rerender="list"/>
        <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>

 

 

But of course an overriden tab should provide the preexisting functionality which enables the user to create new views, edit existing ones, etc.  So is there a way I can leverage salesforce's code to provide the standard view links like below (Create New View | Edit | Delete | Refresh) in my custom visual force page?

 

 

 

Cheers,

 

Tyler

 

Hi All,

    Good day. Is there a way to set the record type of a record to be saved via VF? Thanks!