• BrokenBird
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 24
    Replies

 

Every time I save in my code, I return to the parent form:

 

 

public PageReference mysave() { update scorecard; PageReference pageRef = new PageReference('/'+scorecard.Project__c); return pageRef; }

 but the Page Editor layer at the bottom stays there... And If I go in the form again, and save, and repeat a few time, it adds more and more layers. This is quite strange, is it my code that causes that?

 

 

I have a special form, in which there are no inputfield, only a table with radio buttons, I actually set the field value based on the radio button selected. (See image)

 

 

So if leave the InputField box (see top row), then the context is kept and I can save, however, If they are not included the context is not kept and saving saves the old values.

 

 

public myCriteriaScorecardExtension(ApexPages.StandardController controller)
{
baseController = controller;
scorecard = (Criteria_Scorecard__c) baseController.getRecord();
...

 

 including this is the only way the context is kept, if I hide them with rendered="false" it stop working, if I use outputfield instead of inputfield, it also stop working.

<apex:pageblock mode="edit" id="PB1">
<apex:inputField value="{!scorecard.Question1__c}" rendered="true" />
<apex:inputField value="{!scorecard.Question2__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question3__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question4__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question5__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question6__c}" rendered="true"/>
</apex:pageblock>

 

 

 

 

Message Edited by BrokenBird on 05-23-2009 11:15 AM
Message Edited by BrokenBird on 05-23-2009 11:16 AM

In my controller extension, I have my own save method:

 

 

public PageReference mysave() { baseController.save(); PageReference pageRef = new PageReference('/'+scorecard.Project__c); return pageRef; }

 

 I also have a trigger that make sure I have only one relation to the parent which uses AddError:

 

 

trigger LimitScoreCardLink on symbiosis__Criteria_Scorecard__c (before insert, before update) { //Validate that only one BusinessCase can be associate with a project symbiosis__Criteria_Scorecard__c [] TheEntries; TheEntries = trigger.new; for(symbiosis__Criteria_Scorecard__c aCard: TheEntries ) { if (aCard.symbiosis__Project__c != null)

{ List<symbiosis__Criteria_Scorecard__c> TheScoreCardofThisProject = new List<symbiosis__Criteria_Scorecard__c>(); TheScoreCardofThisProject = [ select Id from symbiosis__Criteria_Scorecard__c where symbiosis__Project__c = :aCard.symbiosis__Project__c and Id != :aCard.Id ]; if (!TheScoreCardofThisProject.isEmpty()) { aCard.addError('The selected project already have a Scorecard attached.'); } } } }

 

This works with standard controller and display the error, but with the extension, how do I trap this error and make sure it displays?

 

 

I am trying to load a tab programatically, so far I use the url that I see when I click on the tab, but I want to make sure this is the correct way:

 

 

public PageReference GoToTab() { PageReference pageRef = new PageReference('/servlet/servlet.Integration?lid=01r800000003iF1&ic=1'); return pageRef; }

 

Will that also work in a deployed managed application at a customer's site?

 

Thanks

 

 

I have overriden the View button of a custom object to load a custom edit form directly instead of going throught the normal view->edit mode. In this form I created a controller extension where I have a mysave method, which the forms calls instead of save, in this method I want to call the basecontroller save and go back to the list.

 

I found out how to save, but I can't find how to go back to the list of items.

 

I already spent 3 hours on this and I am about to throw the !@###$@ computer thru the window, please help!

I am trying to use radio button in a list, but I can't figure out how to produce what I want. This is an HTML example of what I am looking for: Survey sample

 

 

Message Edited by BrokenBird on 05-11-2009 03:06 PM

I have a custom object that has many related list, for one of the list

I would like to use a custom VisualForce page, is this possible? I want

the parent to still follow its diplay layout except for this specific list.

 

At this moment I have a workaround I do not really like.

 

I created an extension controller for the parent,  which includes

 

 <apex:detail relatedlist="true"/>

 

and I could add custom code to display my special list in a form section,

however with this solution, I cannot hide the special list from the layout

if the user choose to display it, and my custom list is always at the end.

 

What I would like is let the admin decide where my list goes with the 

layout editor, and just change the way this list is presented. 

For some columns of my pageBlockTable I am specifying a different StyleClass:

.SpendingStyle {background-color: lightgrey; color:grey; background-image:none}

 

<apex:column styleClass="SpendingStyle">
<apex:facet name="header"><b>Immediate Costs</b></apex:facet>
<apex:outputField value="{!aProject.project.Immediate_Costs__c}" />
</apex:column>
 

 

 

However the color of the text is never applied. What do I need to do to make the color of the text change?

 

Ok I have read a lot about this, but still can't figure it out, I must be dumber than I thought.

 

Anyway I need to pass a value to my Controller from my page in a datatable:

 

 

<apex:column styleClass="{!ScheduleStatusClass}"> <apex:facet name="header"><b>Schedule Status</b></apex:facet> <apex:outputField value="{!aProject.Schedule_Status__c}" /> </apex:column>

 


  

 

You see the ScheduleStatusClass is a method that would return a style based on the content  of {!aProject.Schedule_Status__c, but I can't find a way to get the {!aProject.Schedule_Status__c} back to my controller for my {!ScheduleStatusClass} method to see. I have been at it for 3 hours and this is driving me insane, please help!!! :smileysad:

Is there a way to set the background color of a cell in a datatable to a specific color based on content?

 

I have a many to many relationship between 2 objects, so when from object A I want to link to Object B it is not a problem, however when the target does not exist I would like to give the user a New button in the lookup dialog (standard objects have that).

 

Having to go back to another tab to pre-create the object can be quite a pain in the A.

 

Thanks

 

(And yes I do have the Quick Create option set)

Message Edited by BrokenBird on 02-13-2009 12:30 PM

I have a lookup relationship between Object A and B, in object A I have a lookup field, while in Object B I have a related list.

 

I would like to be able to limit the number of Object A that reference Object B to 3, how can this be done?

 

Thanks

In a custom object I have a checkbox that I want to be unique for a group of records based on a relation. In example for all the records related to the same account, I want only one to have this field checked. 

 

To do so I implemented a trigger that would uncheck all the other records after new one is checked and also update a field in the account record; when the record is unchecked, I clear the field in the account.

 

The problem I have is that this provoke triggers on the modified records as well, now how do I know if the trigger is the original one or a cascaded one?

In a custom object I have setup a lookup releationship, but how do I make it mandatory?

Newbie question:

 

When in a record, and wanting to create a child record, under standard record type you are brought back to the parent record after you are done creating the child, however with custom records, when creating a child record, after I am done I am left with [Edit, Delete, Clone] buttons but no way to go back to the parent record. Am I missing something? Do I have to put custom button or code to go back to the parent?

 

Thanks

 

Every time I save in my code, I return to the parent form:

 

 

public PageReference mysave() { update scorecard; PageReference pageRef = new PageReference('/'+scorecard.Project__c); return pageRef; }

 but the Page Editor layer at the bottom stays there... And If I go in the form again, and save, and repeat a few time, it adds more and more layers. This is quite strange, is it my code that causes that?

 

 

I have a special form, in which there are no inputfield, only a table with radio buttons, I actually set the field value based on the radio button selected. (See image)

 

 

So if leave the InputField box (see top row), then the context is kept and I can save, however, If they are not included the context is not kept and saving saves the old values.

 

 

public myCriteriaScorecardExtension(ApexPages.StandardController controller)
{
baseController = controller;
scorecard = (Criteria_Scorecard__c) baseController.getRecord();
...

 

 including this is the only way the context is kept, if I hide them with rendered="false" it stop working, if I use outputfield instead of inputfield, it also stop working.

<apex:pageblock mode="edit" id="PB1">
<apex:inputField value="{!scorecard.Question1__c}" rendered="true" />
<apex:inputField value="{!scorecard.Question2__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question3__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question4__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question5__c}" rendered="true"/>
<apex:inputField value="{!scorecard.Question6__c}" rendered="true"/>
</apex:pageblock>

 

 

 

 

Message Edited by BrokenBird on 05-23-2009 11:15 AM
Message Edited by BrokenBird on 05-23-2009 11:16 AM

In my controller extension, I have my own save method:

 

 

public PageReference mysave() { baseController.save(); PageReference pageRef = new PageReference('/'+scorecard.Project__c); return pageRef; }

 

 I also have a trigger that make sure I have only one relation to the parent which uses AddError:

 

 

trigger LimitScoreCardLink on symbiosis__Criteria_Scorecard__c (before insert, before update) { //Validate that only one BusinessCase can be associate with a project symbiosis__Criteria_Scorecard__c [] TheEntries; TheEntries = trigger.new; for(symbiosis__Criteria_Scorecard__c aCard: TheEntries ) { if (aCard.symbiosis__Project__c != null)

{ List<symbiosis__Criteria_Scorecard__c> TheScoreCardofThisProject = new List<symbiosis__Criteria_Scorecard__c>(); TheScoreCardofThisProject = [ select Id from symbiosis__Criteria_Scorecard__c where symbiosis__Project__c = :aCard.symbiosis__Project__c and Id != :aCard.Id ]; if (!TheScoreCardofThisProject.isEmpty()) { aCard.addError('The selected project already have a Scorecard attached.'); } } } }

 

This works with standard controller and display the error, but with the extension, how do I trap this error and make sure it displays?

 

 

I am trying to load a tab programatically, so far I use the url that I see when I click on the tab, but I want to make sure this is the correct way:

 

 

public PageReference GoToTab() { PageReference pageRef = new PageReference('/servlet/servlet.Integration?lid=01r800000003iF1&ic=1'); return pageRef; }

 

Will that also work in a deployed managed application at a customer's site?

 

Thanks

 

 

I have overriden the View button of a custom object to load a custom edit form directly instead of going throught the normal view->edit mode. In this form I created a controller extension where I have a mysave method, which the forms calls instead of save, in this method I want to call the basecontroller save and go back to the list.

 

I found out how to save, but I can't find how to go back to the list of items.

 

I already spent 3 hours on this and I am about to throw the !@###$@ computer thru the window, please help!

I am trying to use radio button in a list, but I can't figure out how to produce what I want. This is an HTML example of what I am looking for: Survey sample

 

 

Message Edited by BrokenBird on 05-11-2009 03:06 PM

I have a custom object that has many related list, for one of the list

I would like to use a custom VisualForce page, is this possible? I want

the parent to still follow its diplay layout except for this specific list.

 

At this moment I have a workaround I do not really like.

 

I created an extension controller for the parent,  which includes

 

 <apex:detail relatedlist="true"/>

 

and I could add custom code to display my special list in a form section,

however with this solution, I cannot hide the special list from the layout

if the user choose to display it, and my custom list is always at the end.

 

What I would like is let the admin decide where my list goes with the 

layout editor, and just change the way this list is presented. 

For some columns of my pageBlockTable I am specifying a different StyleClass:

.SpendingStyle {background-color: lightgrey; color:grey; background-image:none}

 

<apex:column styleClass="SpendingStyle">
<apex:facet name="header"><b>Immediate Costs</b></apex:facet>
<apex:outputField value="{!aProject.project.Immediate_Costs__c}" />
</apex:column>
 

 

 

However the color of the text is never applied. What do I need to do to make the color of the text change?

 

Ok I have read a lot about this, but still can't figure it out, I must be dumber than I thought.

 

Anyway I need to pass a value to my Controller from my page in a datatable:

 

 

<apex:column styleClass="{!ScheduleStatusClass}"> <apex:facet name="header"><b>Schedule Status</b></apex:facet> <apex:outputField value="{!aProject.Schedule_Status__c}" /> </apex:column>

 


  

 

You see the ScheduleStatusClass is a method that would return a style based on the content  of {!aProject.Schedule_Status__c, but I can't find a way to get the {!aProject.Schedule_Status__c} back to my controller for my {!ScheduleStatusClass} method to see. I have been at it for 3 hours and this is driving me insane, please help!!! :smileysad:

I have a lookup relationship between Object A and B, in object A I have a lookup field, while in Object B I have a related list.

 

I would like to be able to limit the number of Object A that reference Object B to 3, how can this be done?

 

Thanks