• MSVRad
  • NEWBIE
  • 80 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 44
    Replies

I have Salesforce EE and I am not a programmer but am stuck with a project that requires this knowledge so i would appreciate any help at all. 

 

I have a trigger to that actions opportunities based on record type and I need to edit this trigger to exclude a record type.  

 

I downloaded eclipse and can access my developer and production orgs BUT I still have absolutely no idea on how to deploy the edited trigger to my production environment even after drowning in websites and pages of Force.com manuals. 

 

Help-I feel like Alice in blunderland.

  • November 16, 2009
  • Like
  • 0

I have a custom object where the Detail view, edit, and new pages have all been overriden with visualforce pages. I need to be able to create/override a clone button that works like the standard clone button. So far I have only been able to override the clone button so that when it is clicked the record is created (new record inserted) then the page redirects to the edit page of the new record.

 

How do I make the clone work like the standard clone? In the standard clone when the clone button is clicked the user is redirected to an edit page where the record id in the url is the record you are trying to clone. After the user clicks save is when the new record gets "cloned"

 

Would I have to override the standard save behavior? Just for the clone page?

 

I can post the code I have completed so far if needed.

  • February 12, 2010
  • Like
  • 0

I am writing visualforce pages where I need to retrieve values from a picklist and I know how to do it this way:

 

public List<SelectOption> getFinalsOptions(){ List<SelectOption> Finalsoptions = new List<SelectOption>(); Finalsoptions.add(new SelectOption('null','-- Select One --')); Schema.DescribeFieldResult Finals = Schema.sObjectType.Business_Review__c.fields.Interest_in_Finals__c; for (Schema.PickListEntry FinalsPickVal : Finals.getPicklistValues()){ // create a selectoption for each pickval Finalsoptions.add(new SelectOption(FinalsPickVal.getValue(),FinalsPickVal.getLabel())); } return Finalsoptions; }

 

Then the visualforce looks like this:

<apex:pageBlockSectionItem > <apex:outputLabel value="Interest in Finals" /> <apex:selectList value="{!Business_Review__c.Interest_in_Finals__c}" size="1"> <apex:selectOptions value="{!FinalsOptions}" /> <apex:actionSupport reRender="brBlock" event="onchange" status="" /> </apex:selectList> </apex:pageBlockSectionItem>

 

 

 

The issue is that I can only have so many describe calls and I have a large number of picklist fields where I need to retreieve their values so that I can create a series of dependencies to other fields from the picklist.

 

So the question summed up: Is there a way to write a query that just extracts the values in a picklist.

If I have a picklist Month__c with values: jan, feb, mar, apr, may, jun, jul, etc... How do I write a query just to get the values from that field?

 

I have found some information about possibly using a map:

Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap();

I am just not sure how to get the value that I need from the map. So that I can extract the picklist values.

 

Any suggestions - I have not been successful so far.

 

Thanks in advance!

Message Edited by MSVRad on 12-17-2009 12:52 PM
  • December 17, 2009
  • Like
  • 0

I would like to create a custom link for a custom object that has multiple record types. I am not sure if what I am trying to do is possible through custom links.

 

The custom object is Go_Live_Process__c

The two record types involved are "HL7" and "SOW"

The link would be on the page layout for HL7 and we want the link to find the SOW record that has the same Account as the HL7 record. So the link would lead the user to see the detail page of the SOW record.

 

Is this something that can be done with a custom link? If so does anyone have any suggestions

  • December 03, 2009
  • Like
  • 0

I am writing a test class for a trigger that has multiple for loops in it and When I run the test the lines that are not covered are the for loops.

 

Here is part of the trigger:

trigger AutoCreateIncident on Account (after update) { List<Case> c = new List<Case>(); for (Integer i = 0; i < Trigger.new.size(); i++) { Account newCase = Trigger.new[i]; Account OldCase = Trigger.old[i]; if(newCase.Operational_Status__c == 'Operational' && oldCase.Operational_Status__c == 'IT GO'){ if(newCase.Account_Services_Rep__c == 'Ade Adeyemi' || oldCase.Account_Services_Rep__c == 'Ade Adeyemi'){ for(Integer j = 0; j < 24; j++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016ePl', Priority = 'High', Due_date__c = System.today() + (j*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Chris Nelson' || oldCase.Account_Services_Rep__c == 'Chris Nelson'){ for(Integer k = 0; k < 24; k++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016eQ4', Priority = 'High', Due_date__c = System.today() + (k*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Deborah Kerr' || oldCase.Account_Services_Rep__c == 'Deborah Kerr' ){ for(Integer l = 0; l < 24; l++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016ePr', Priority = 'High', Due_date__c = System.today() + (l*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Elyssa Kim' || oldCase.Account_Services_Rep__c == 'Elyssa Kim'){ for(Integer m = 0; m < 24; m++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '00570000001IbB3', Priority = 'High', Due_date__c = System.today() + (m*30) + 1)); } } } } insert c; }

I understand this is not the most efficent or best way to code this trigger, but this is how i have chosen to code it for now. The lines of code that I am not sure how to test are the for loop lines and the "c.add(new Case(" lines. any suggestions on how to tackle this one?

 

I also have another one that has a few Field.addErrors in it and I am not sure how to test those lines of code either 

 

Thanks

  • November 24, 2009
  • Like
  • 0

I understand that when I create a new Case using the New button on the Case related list on the Account page that the Account Name should auto populate in the Account Name lookup field. I have written a trigger that creates new cases when a picklist value changes from one value to another. I am able to populate other Case fields using this trigger but am not able to get the Account Name to populate. Here is the trigger:

trigger AutoCreateIncident on Account (after update) { List<Case> c = new List<Case>(); List<Id> pracIds = new List<Id>(); for (Account accNew : Trigger.new) { pracIds.add(accNew.Id); //A set of Practice Accounts } Map<Id, Account> pAccounts = new Map<Id, Account>([SELECT id, Name FROM Account WHERE id IN :pracIds]); for (Integer i = 0; i < Trigger.new.size(); i++) { Account newCase = Trigger.new[i]; Account OldCase = Trigger.old[i]; if(newCase.Operational_Status__c == 'Operational' && oldCase.Operational_Status__c == 'IT GO'){ if(newCase.Account_Services_Rep__c == 'Ade Adeyemi' || oldCase.Account_Services_Rep__c == 'Ade Adeyemi'){ for(Integer j = 0; j < 24; j++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', Account = pAccounts.get(newCase.Id), OwnerId = '005700000016ePl', Priority = 'High', Due_date__c = System.today() + (j*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Chris Nelson' || oldCase.Account_Services_Rep__c == 'Chris Nelson'){ for(Integer k = 0; k < 24; k++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', Account = pAccounts.get(newCase.Id), OwnerId = '005700000016eQ4', Priority = 'High', Due_date__c = System.today() + (k*30) + 1)); } } } } insert c; }

Any suggestions as to why the account name field (Account = pAccounts.get(newCase.Id)) is not populating on the new Case?

  • November 23, 2009
  • Like
  • 0

I need to write a trigger I am guessing to auto create a case when a user changes an account picklist value from one value to another.

 

My question: would this trigger be "on Account" or "on Case"? My guess is "on Case(after Insert, after Update) but I am not sure if this is correct.

 

Along with the autocreation of a case a few fields need to be populated based on an account field as well.

 

Here is the scenario:

 

A user edits an account and they change the custom picklist field "Operational Status" from "ITGO" to "Operational" and clicks save.

 

Then a case needs to be created pulling in the related accout as a lookup, the owner of the case needs to be set based on the custom account picklist field "Customer Service Rep" and the Type field will be set to "Health Check".

 

Does anyone have any suggestions for this trigger?

 

Thanks in advance.

  • November 16, 2009
  • Like
  • 0

Is it possible to have multiple record types on one visualforce page? I ask this because I have users that want all of the record types associated with a custom object on one page. Each of these record types share fields. So say we have a OpenDate__c field that resides over 9 record types. They want that field to be displayed on all the record types all on one page.  So all 9 record types would display on one visualforce page and the one OpenDate__c field would reside in each of the record type's section of the page. I know this is really convoluted in explination. I do not have a better way of explaining this.

 

I have said that I do not think this is possible, it just doesnt make sense to me from the data perspective. If anyone has some insight on this I would really appreciate it.

 

Thanks!

  • October 20, 2009
  • Like
  • 0

Can I do this for a multiselect picklist?

 

 public List<SelectOption> getOptions(){

List<SelectOption> options = new List<SelectOption>();Schema.DescribeFieldResult goLive = Schema.sObjectType.

Go_Live_Process__c.fields.Go_Live_Processes__c;

for (Schema.PickListEntry glpPickVal : goLive.getPicklistValues()){

// create a selectoption for each pickval

options.add(new SelectOption(glpPickVal.getValue(),glpPickVal.getLabel()));

}

return options;

 

I use this same code but for a differnt object on a regular selectlist and it works perfectly.

Here is how i want to make use of it in a visualforce page:

 ...

<apex:pageBlockSectionItem >

<apex:outputLabel value="Go Live Processes" />

<apex:selectList value="{!Go_Live_Process__c.Go_Live_Processes__c}" size="9">

<apex:selectOptions value="{!getOptions}" />

<apex:actionSupport reRender="TheBlock" event="onchange" status="showCredentialing" />

</apex:selectList>

</apex:pageBlockSectionItem>

...

 

I get this error when I run a build:

it is an error for that visualforce block stating it does not know the property getOptions. I do not get this error when I do this with a regular picklist.

 

Save error: Unknown property 'Go_Live_Process__cStandardController.getOptions' GoLiveEdit.page Dev1 Sandbox/src/pages line 0 Force.com save problem

 

Any suggestions? I am trying to use this multiselect picklist with action support for specific pageblocksections to display based on which options are selected from the multiselect picklist.

 

Thanks!

  • October 19, 2009
  • Like
  • 0

I have visualforce code and apex code for a controller extension where I have a boolean property that sets the input checkbox to false initally.

 

Here is the controller extension:

public with sharing class GoLiveController { public Go_Live_Process__c glp; public apexpages.standardController controller {get; set;} public GoLiveController(ApexPages.StandardController stdController) { // constructor controller = stdController; this.glp= (Go_Live_Process__c)stdController.getRecord(); Go_Live_Process__c goLives = (Go_Live_Process__c)stdController.getRecord(); goLives = [SELECT Account__c FROM Go_Live_Process__c WHERE id=:system.currentpageReference().getparameters().get('id')]; } //Property for Credentialing checkbox public Boolean showCredentialing{ get{ if(showCredentialing == null){ showCredentialing = false; } return showCredentialing; } set; } //Property for client agreement checkbox public Boolean showClientAgreement{ get{ if(showClientAgreement == null){ showClientAgreement = false; } return showClientAgreement; } set; } }

 

Here is the VF page:

<apex:page standardController="Go_Live_Process__c" extensions="GoLiveController"> <apex:form id="EditForm"> <apex:pageBlock title="Go Live Edit" id="TheBlock"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> <apex:commandButton action="{!delete}" value="Delete"/> <apex:commandButton action="{!cancel}" value="Cancel"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Go-Live General Information" columns="1" id="general"> <apex:outputField value="{!Go_Live_Process__c.Account__c}"/> <apex:pageBlockSectionitem id="CredBlock" > <apex:outputLabel value="Credentialing"/> <apex:inputCheckBox value="{!showCredentialing}"> <apex:actionSupport event="onclick" rerender="TheBlock" status="showCredentialing" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:outputLabel value="{!showCredentialing}"/> <apex:pageBlockSectionitem > <apex:outputLabel value="Client Agreement"/> <apex:inputCheckBox value="{!showClientAgreement}"> <apex:actionSupport event="onclick" rerender="EditForm" status="showClientAgreement" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:actionStatus startText="(rendering Credentialing Go Live...)" id="showCredentialing"/> <apex:actionStatus startText="(rendering Client Agreement Go Live...)" id="showClientAgreement"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Credentialing" rendered="{!showCredentialing}" id="CredentialingBlock" columns="2"> <apex:inputField value="{!Go_Live_Process__c.Privileges_issued__c}"/> </apex:pageBlockSection> </apex:actionRegion> </apex:pageBlock>

There is a similar post to this already and I have tried all of the suggestions on that post with no success. Here is the link to that post for reference: InputCheckbox will not set

 

I have an output field that shows that when I check it in the edit page that it is true, but after I save and go back in to edit it shows as false again.

 

Any suggestions would be greatly appreciated.

  • October 16, 2009
  • Like
  • 0

I am creating visual force pages for to override New, Edit, and Detail view for a custom object. I am using ActionSupport event On Change for a checkbox. Why is it that when I check the checkbox the even that would be considered "on change" the section of the page that should be rendered on this action does not display. It displays if I click outside of the checkbox after the checkbox has been checked.

 

There is a lot more to add to this extension but I wanted to test that it functioned properly before I coded anymore.

 

Here is the Controller extension:

public with sharing class GoLiveController { public Go_Live_Process__c glp; public apexpages.standardController controller {get; set;} public GoLiveController(ApexPages.StandardController stdController) { // constructor controller = stdController; this.glp= (Go_Live_Process__c)stdController.getRecord(); Go_Live_Process__c goLives = (Go_Live_Process__c)stdController.getRecord(); goLives = [SELECT Account__c FROM Go_Live_Process__c WHERE id=:system.currentpageReference().getparameters().get('id')]; } //Property for Credentialing checkbox public Boolean showCredentialing{ get{ if(showCredentialing == null){ showCredentialing = false; } return showCredentialing; } set; } //Property for client agreement checkbox public Boolean showClientAgreement{ get{ if(showClientAgreement == null){ showClientAgreement = false; } return showClientAgreement; } set; } }

Here is part of the visual force page:

 

... <apex:pageBlockSectionitem > <apex:outputLabel value="Client Agreement"/> <apex:inputCheckBox value="{!showClientAgreement}"> <apex:actionSupport event="onchange" rerender="EditForm" status="showClientAgreement" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:actionStatus startText="(rendering Client Agreement Go Live...)" id="showClientAgreement"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Client Agreement" rendered="{!showClientAgreement}" id="closeoutBlock" columns="2"> <apex:inputField value="{!Go_Live_Process__c.Privileges_issued__c}"/> </apex:pageBlockSection> </apex:actionRegion> ...

Any Ideas? I know how it works and I think it would be okay but I think that users would complain about having to click outside of the checkbox even after they have already checked the box.

 

Thanks!

Message Edited by MSVRad on 10-16-2009 11:10 AM
  • October 16, 2009
  • Like
  • 0

I am trying to override the Opportunity save button so that the standard Close Date field is not required on the save.

 

I have already created an override for the Detail View and the Edit page each of the different record types has its own detail view and edit page.

 

I know I cannot directly override the button through the Salesforce UI like the Edit button or the Detail View. 

Can anyone provide an example of how this would look? I know I am either over simplifying this or I am over thinking it. I already have a controller extension in place I would just add this save method to it.

 

This is what I thought it might look like but I am not sure how to say do not output an error if this field is not populated.

public PageReference save(){

// do not require CloseDate Field

 if (CloseDate == null) { //Call a method that says the closedate is not required - This is the part I do not know how to do }

 

// use the standard controller to perform the save and redirect - will using this still make the CloseDate field required

 return controller.save();

}

  • October 09, 2009
  • Like
  • 0

I am trying to figure out a way to track what has been deleted. I am wondering how the isDeleted flag works once the recycling bin has been manually emptied or if the recycling bin hits its limit and the oldest records begin to be "permanently"  be deleted.  Are the records that have been Permanently deleted still accessable through the a data table? We are using a 3rd party data integration tool and we want to use the isDeleted flag to track what records have been deleted so we want to know if a record is permanently deleted if that record remains in the data table with the isDeleted flag set to true or if it is removed from the data table and is no longer accessable through the data table or through the UI.

 

Does anyone have any insight on this?

  • September 29, 2009
  • Like
  • 0

I am trying to write a controller extension where I have created two custom checkbox fields and I want to create two boolean properties to be used with these checkboxes.

 

I have

if(checkbox1 == 'true'){ ca = true; } if(checkbox2 == 'true'){ cred = true; } public Boolean cred{ get{ if(cred == null){ cred = false; } return cred; } set; } //Property for client agreement checkbox public Boolean ca{ get{ if(ca == null){ ca = false; } return ca; } set; }

I am not sure how to set the checkbox to true or false in apex code. I get an error saying "Comparison Argument must be compatible types:Schema.SObjectField, string"

 

Any ideas on how to handle this?  I am trying to use this boolean property to render pageblock sections in a visualforce page.

 

Thanks.

  • September 21, 2009
  • Like
  • 0

I have created a custom object and I want to use a picklist in a formula field. All I really want to do is display this field on my custom object. Is there a way to do that without using a Formula field since I cannot use a picklist in the way I want. I do not want to override the pages with visualforce I know this is one way to just put an output field of the picklist on the page.

 

This is all I am trying to do: Account__r.Operational_Status__c.

 

Where Operational_Status__c is a custom picklist.  I just want the value that is selected in this picklist to appear on a different object's detail view.

 

Any suggestions would be greatly appreciated.

 

Thanks!

Message Edited by MSVRad on 09-16-2009 02:08 PM
  • September 16, 2009
  • Like
  • 1

I would like to replicate the Phone and Email fields on Task where the Phone and Email fields populate with the contact information when save is clicked . I want to have the Mobile and Other Phone fields from the Contact on the Task page and have them populate onclick of the Save button. Can this be done through a formula field or will I need to write a trigger.

 

I have tried Contact.MobilePhone 

and I have tried Contact__r.MobilePhone

 

Neither of these work so I just want to check if I need to write a trigger (or worse override the pages with VF Pages).

 

Any suggestions would be great. I just get Contact or Contact__r do not exist as an error in the formula field

  • September 08, 2009
  • Like
  • 0

I have written a simple trigger that populates a custom lookup field on the Contact object with the Data from a Standard lookup field on the Account object.

 

I am having some issue testing this trigger as everytime I try to create a dummy contact to test on I get an error.

 

Here is the trigger:

 

trigger PopulatePracticeContact on Contact (before update, before insert) { //Set of Account Ids Set<Id> AccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { AccountIds.add(contactNew.AccountId); //A set of Accounts } Map<Id, Account> pAccounts = new Map<Id, Account>([SELECT a.id, a.parentid, a.Name FROM Account a WHERE a.id IN :AccountIds]); for(Contact fcon : Trigger.New){ fcon.Related_Practice_Account__c = pAccounts.get(fcon.AccountId).ParentId; } }

 

 

Here is what I have started for the Test Class... I am not really sure how to test this anyway, so any suggestions would be greatly appreciated.

 

public with sharing class PopulatePracticeContactTest {

  static testMethod void PopulatePracticeContactTest(){

 

Account pAcc1 = new Account(Name = 'TestAccount1', BillingState = 'MN', Practice_ID__c = '1234', Operational_status__c = 'Prospect', recordTypeId = '012700000009R7B');

insert pAcc1;

Account fAcc1 = new Account(Name = 'TestAccount2', BillingState = 'OH', Facility_ID__c = '4321', Operational_status__c ='Pending', recordTypeId = '012700000009R7G', ParentId = pAcc1.id);

insert fAcc1;

 

Contact pCon1 = new Contact(LastName = 'TestContact1', AccountId = pAcc1);

insert pCon1;

Contact fCon1 = new Contact(LastName = 'TestContact2', AccountId = fAcc1);  insert fCon1;

 

}

}

 

The error that I get is this:

 

Save error: Invalid initial expression type for field Contact.AccountId, expecting: Id PopulatePracticeContactTest.cls 

 

Update: I didn't review this before I posted it - I did make a copy/paste error I just pasted the trigger twice.  The test class that I actually started writing is now added.

Message Edited by MSVRad on 09-08-2009 06:44 AM
  • September 03, 2009
  • Like
  • 0

I have this controller extension:

 

public class OpportunityClosedLost { public Opportunity opp; public apexpages.standardController controller {get; set;} public opportunityClosedLost(ApexPages.StandardController stdController) { // constructor controller = stdController; this.opp= (Opportunity)stdController.getRecord(); Opportunity opps = (Opportunity)stdController.getRecord(); opps = [SELECT RecordTypeId, StageName FROM Opportunity WHERE id=:system.currentpageReference().getparameters().get('id')]; //VRC opportunity if(opps.RecordTypeId =='012700000009RIb'){ isVrc = true; } //vRad Alliance Opportunity if(opps.RecordTypeId =='012T00000000JJD'){ isAlliance = true; } //EC Opportinity if(opps.RecordTypeId =='012700000005KwS'){ isEc = true; } } public List<SelectOption> getStageOptions(){ List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('null','-- Select One --')); Schema.DescribeFieldResult oppStage = Schema.sObjectType.Opportunity.fields.StageName; for (Schema.PickListEntry oppPickVal : oppStage.getPicklistValues()){ // create a selectoption for each pickval options.add(new SelectOption(oppPickVal.getValue(),oppPickVal.getLabel())); } return options; } public Boolean isVrc{ get{ if(isVrc == null){ isVrc = false; } return isVrc; } set; } public Boolean isAlliance{ get{ if(isAlliance == null){ isAlliance = false; } return isAlliance; } set; } public Boolean isEc{ get{ if(isEc == null){ isEc = false; } return isEc; } set; } }

I have written a test class and it is only catching the true situations for the boolean properties colored in blue I am not sure how to test the false condition. I am also unsure how to test the SelectList portion of the code that is red.

 

Here is my test class so far:

 

 

public with sharing class OpportunityClosedLostTest { static testMethod void OpportunityClosedLostTest(){ Opportunity opp1 = new Opportunity(Name = 'Opportunity1', Probability = 20.00, CloseDate = Date.newInstance(System.now().year(),10,10), StageName = 'Prospect', RecordTypeId = '012700000009RIb'); insert opp1; Opportunity opp2 = new Opportunity(Name = 'Opportunity2', Probability = 70.00, CloseDate = Date.newInstance(System.now().year(),12,31), StageName = 'Quote Requested', RecordTypeId = '012700000005KwS'); insert opp2; Opportunity opp3 = new Opportunity(Name = 'Opportunity3', Probability = 50.00, CloseDate = Date.newInstance(System.now().year(),9,18), StageName = 'Competitive Situation', RecordTypeId = '012T00000000JJD'); insert opp3; //Test Opportunity Edit Page VRC Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.Standardcontroller sc1 = New ApexPages.StandardController(opp1); System.CurrentPageReference().getParameters().put('id',opp1.Id); OpportunityClosedLost cOpp1 = new OpportunityClosedLost(sc1); System.debug(cOpp1.isVrc); update opp1; //Test Opportunity Detail Page VRC Test.setCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc2 = New ApexPages.StandardController(opp1); System.CurrentPageReference().getParameters().put('id',opp1.id); OpportunityClosedLost cOpp2 = new OpportunityClosedLost(sc2); System.debug(cOpp2.isVrc); update opp1; //Test Opportunity Edit Page EC Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.StandardController sc3 = New ApexPages.StandardController(opp2); System.CurrentPageReference().getParameters().put('id', opp2.id); OpportunityClosedLost cOpp3 = new OpportunityClosedLost(sc3); System.debug(cOpp3.isEc); update opp2; //Test Opportunity Detail Page EC Test.SetCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc4 = New ApexPages.StandardController(opp2); System.CurrentPageReference().getParameters().put('id', opp2.id); OpportunityClosedLost cOpp4 = new OpportunityClosedLost(sc4); System.debug(cOpp4.isEc); update opp2; //Test Opportunity Edit Page vRad Alliance Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.Standardcontroller sc5 = new ApexPages.Standardcontroller(opp3); System.currentPageReference().getParameters().put('id', opp3.id); OpportunityClosedLost cOpp5 = new OpportunityClosedLost(sc5); System.debug(cOpp5.isAlliance); update opp3; //Test Opportunity Detail Page vRad Alliance Test.setCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc6 = new ApexPages.StandardController(opp3); System.currentPageReference().getParameters().put('id', opp3.id); OpportunityClosedLost cOpp6 = new OpportunityClosedLost(sc6); System.debug(cOpp6.isAlliance); update opp3; } }

 

  • August 31, 2009
  • Like
  • 0

I want to write a validation rule like this but cannot figure out how to do so. 

 

If the record type of the record = xyz  and a picklist option from a standard picklist = abc then an option must be selected for another picklist.

 

I know how to do the part where if the standard picklist has an option = abc then require another picklist I just do not know how to add in the record type portion.

Message Edited by MSVRad on 08-28-2009 09:37 AM
  • August 27, 2009
  • Like
  • 0

We have a Custom Object related to the Account Object called "Schedule" (Displays as a related list on the Account page). We have a trigger written saying that for an Account the Account to Schedule relationship can only be one to one. 

 

When a user merges accounts multiple schedules can be added to the master which is not allowed but the trigger we have written does not catch this. So I am wondering if there is a way to write a trigger where on a merge it will check if multiple Schedules are trying to be added to the master Account. Then display an error message so that the user needs to go back and remove the extra schedules before they can proceed with the merge.

 

Really, if anything else I would like more information about how a merge works behind the scenes.

 

Thanks in advance for any help or suggestions.

  • August 25, 2009
  • Like
  • 0

I am trying to write a validation rule for two picklists.

 

If one picklist (StageName) is on option "Closed Lost" then the second picklist "Lost Reason" cannot be "null" or a value must be selected.

 

I tried this:

 

AND (
ISPICKVAL( StageName , "Closed Lost"),
ISNULL( Lost_Reason__c )
)

 

Then I get an error saying that the ISNULL function cannot be used on a picklist.

 

Is there a function that I can use for this purpose or do I need to write an apex trigger?

  • August 21, 2009
  • Like
  • 0

I have created a custom object and I want to use a picklist in a formula field. All I really want to do is display this field on my custom object. Is there a way to do that without using a Formula field since I cannot use a picklist in the way I want. I do not want to override the pages with visualforce I know this is one way to just put an output field of the picklist on the page.

 

This is all I am trying to do: Account__r.Operational_Status__c.

 

Where Operational_Status__c is a custom picklist.  I just want the value that is selected in this picklist to appear on a different object's detail view.

 

Any suggestions would be greatly appreciated.

 

Thanks!

Message Edited by MSVRad on 09-16-2009 02:08 PM
  • September 16, 2009
  • Like
  • 1

for (User u : Trigger.new) {

AccountShare share = new AccountShare();

share.AccountId = u.AccountId;

}

 Why is the IDE telling me that User doesn't have an AccountId field?

 

User object 

Is there a different discussion board section for Flex development? 

 

I am trying to create a flex component that basically does the exact same thing as a VF tag "<apex:detail>"

 

Thanks

 

--Todd Kruse 

I have created a custom clone button for cloning contacts.

 

When i click on the clone button it takes me to the edit page. Till this point everything is fine.

 

But even if i click on the cancel button, on the edit page, it creates the cloned contact.

 

It should only create the record on clicking the save button. Here is the code

 

public PageReference createContact(){

String errorMessage = '';

//if contact record type is Employee display error message

 if(sourceContact.RecordType.Name == EMPLOYEE){

errorMessage = ' Employee contacts cannot be cloned.'; ApexPages.addMessage(

new ApexPages.Message(ApexPages.Severity.ERROR, errorMessage));

}

//if contact record type is Contact create clone of the contact and return to the edit page of newly created contact

 else if(sourceContact.RecordType.Name == CONTACT){

Contact clonedContact = sourceContact.clone(false, true);

try{

insert clonedContact;}

catch(Exception ex){

errorMessage =' This contact can not be cloned. '+ex; ApexPages.addMessage(

new ApexPages.Message(ApexPages.Severity.ERROR, errorMessage));

}

PageReference pageRef = new PageReference('/' + clonedContact.Id+ '/e?retURL=%2F' + clonedContact.Id);

pageRef.setRedirect(true);

return pageRef;

}

//if page has error messages then display the messages

 if(ApexPages.hasMessages()){

showError=true;

showNoError=false;

return null;

}

return null;

}

  • January 14, 2010
  • Like
  • 0

I have written my first apex trigger, tested it, and it works in my sandbox.  However when i try to push to production it is saying I need to run unit tests up to 75%.  I am unsure on how to do this and scouring the boards has got me nowhere.  Can anyone assist?  My code is as follows:

 

trigger createSupplierMemberLink on Opportunity (after insert) {
   
    Opportunity oppty = trigger.new[0];
    if(oppty.Payroll_Type__c <> ''){
   
    SupplierMemberLink__c sml = new SupplierMemberLink__c();
    sml.RelatedProgram__c = oppty.Id;
    sml.SalesDate__c = oppty.CloseDate;
    sml.SalesAmount__c = oppty.Amount;
    sml.Name = oppty.Name + ' Payroll';
   
    insert sml;
}
}

I am writing visualforce pages where I need to retrieve values from a picklist and I know how to do it this way:

 

public List<SelectOption> getFinalsOptions(){ List<SelectOption> Finalsoptions = new List<SelectOption>(); Finalsoptions.add(new SelectOption('null','-- Select One --')); Schema.DescribeFieldResult Finals = Schema.sObjectType.Business_Review__c.fields.Interest_in_Finals__c; for (Schema.PickListEntry FinalsPickVal : Finals.getPicklistValues()){ // create a selectoption for each pickval Finalsoptions.add(new SelectOption(FinalsPickVal.getValue(),FinalsPickVal.getLabel())); } return Finalsoptions; }

 

Then the visualforce looks like this:

<apex:pageBlockSectionItem > <apex:outputLabel value="Interest in Finals" /> <apex:selectList value="{!Business_Review__c.Interest_in_Finals__c}" size="1"> <apex:selectOptions value="{!FinalsOptions}" /> <apex:actionSupport reRender="brBlock" event="onchange" status="" /> </apex:selectList> </apex:pageBlockSectionItem>

 

 

 

The issue is that I can only have so many describe calls and I have a large number of picklist fields where I need to retreieve their values so that I can create a series of dependencies to other fields from the picklist.

 

So the question summed up: Is there a way to write a query that just extracts the values in a picklist.

If I have a picklist Month__c with values: jan, feb, mar, apr, may, jun, jul, etc... How do I write a query just to get the values from that field?

 

I have found some information about possibly using a map:

Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap();

I am just not sure how to get the value that I need from the map. So that I can extract the picklist values.

 

Any suggestions - I have not been successful so far.

 

Thanks in advance!

Message Edited by MSVRad on 12-17-2009 12:52 PM
  • December 17, 2009
  • Like
  • 0

I am writing a test class for a trigger that has multiple for loops in it and When I run the test the lines that are not covered are the for loops.

 

Here is part of the trigger:

trigger AutoCreateIncident on Account (after update) { List<Case> c = new List<Case>(); for (Integer i = 0; i < Trigger.new.size(); i++) { Account newCase = Trigger.new[i]; Account OldCase = Trigger.old[i]; if(newCase.Operational_Status__c == 'Operational' && oldCase.Operational_Status__c == 'IT GO'){ if(newCase.Account_Services_Rep__c == 'Ade Adeyemi' || oldCase.Account_Services_Rep__c == 'Ade Adeyemi'){ for(Integer j = 0; j < 24; j++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016ePl', Priority = 'High', Due_date__c = System.today() + (j*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Chris Nelson' || oldCase.Account_Services_Rep__c == 'Chris Nelson'){ for(Integer k = 0; k < 24; k++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016eQ4', Priority = 'High', Due_date__c = System.today() + (k*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Deborah Kerr' || oldCase.Account_Services_Rep__c == 'Deborah Kerr' ){ for(Integer l = 0; l < 24; l++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '005700000016ePr', Priority = 'High', Due_date__c = System.today() + (l*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Elyssa Kim' || oldCase.Account_Services_Rep__c == 'Elyssa Kim'){ for(Integer m = 0; m < 24; m++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', AccountId = newCase.Id, OwnerId = '00570000001IbB3', Priority = 'High', Due_date__c = System.today() + (m*30) + 1)); } } } } insert c; }

I understand this is not the most efficent or best way to code this trigger, but this is how i have chosen to code it for now. The lines of code that I am not sure how to test are the for loop lines and the "c.add(new Case(" lines. any suggestions on how to tackle this one?

 

I also have another one that has a few Field.addErrors in it and I am not sure how to test those lines of code either 

 

Thanks

  • November 24, 2009
  • Like
  • 0

I understand that when I create a new Case using the New button on the Case related list on the Account page that the Account Name should auto populate in the Account Name lookup field. I have written a trigger that creates new cases when a picklist value changes from one value to another. I am able to populate other Case fields using this trigger but am not able to get the Account Name to populate. Here is the trigger:

trigger AutoCreateIncident on Account (after update) { List<Case> c = new List<Case>(); List<Id> pracIds = new List<Id>(); for (Account accNew : Trigger.new) { pracIds.add(accNew.Id); //A set of Practice Accounts } Map<Id, Account> pAccounts = new Map<Id, Account>([SELECT id, Name FROM Account WHERE id IN :pracIds]); for (Integer i = 0; i < Trigger.new.size(); i++) { Account newCase = Trigger.new[i]; Account OldCase = Trigger.old[i]; if(newCase.Operational_Status__c == 'Operational' && oldCase.Operational_Status__c == 'IT GO'){ if(newCase.Account_Services_Rep__c == 'Ade Adeyemi' || oldCase.Account_Services_Rep__c == 'Ade Adeyemi'){ for(Integer j = 0; j < 24; j++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', Account = pAccounts.get(newCase.Id), OwnerId = '005700000016ePl', Priority = 'High', Due_date__c = System.today() + (j*30) + 1)); } } else if(newCase.Account_Services_Rep__c == 'Chris Nelson' || oldCase.Account_Services_Rep__c == 'Chris Nelson'){ for(Integer k = 0; k < 24; k++){ c.add(new Case(Type = 'Health Check', Reason__c = 'Health Check', Account = pAccounts.get(newCase.Id), OwnerId = '005700000016eQ4', Priority = 'High', Due_date__c = System.today() + (k*30) + 1)); } } } } insert c; }

Any suggestions as to why the account name field (Account = pAccounts.get(newCase.Id)) is not populating on the new Case?

  • November 23, 2009
  • Like
  • 0

I have Salesforce EE and I am not a programmer but am stuck with a project that requires this knowledge so i would appreciate any help at all. 

 

I have a trigger to that actions opportunities based on record type and I need to edit this trigger to exclude a record type.  

 

I downloaded eclipse and can access my developer and production orgs BUT I still have absolutely no idea on how to deploy the edited trigger to my production environment even after drowning in websites and pages of Force.com manuals. 

 

Help-I feel like Alice in blunderland.

  • November 16, 2009
  • Like
  • 0

I have visualforce code and apex code for a controller extension where I have a boolean property that sets the input checkbox to false initally.

 

Here is the controller extension:

public with sharing class GoLiveController { public Go_Live_Process__c glp; public apexpages.standardController controller {get; set;} public GoLiveController(ApexPages.StandardController stdController) { // constructor controller = stdController; this.glp= (Go_Live_Process__c)stdController.getRecord(); Go_Live_Process__c goLives = (Go_Live_Process__c)stdController.getRecord(); goLives = [SELECT Account__c FROM Go_Live_Process__c WHERE id=:system.currentpageReference().getparameters().get('id')]; } //Property for Credentialing checkbox public Boolean showCredentialing{ get{ if(showCredentialing == null){ showCredentialing = false; } return showCredentialing; } set; } //Property for client agreement checkbox public Boolean showClientAgreement{ get{ if(showClientAgreement == null){ showClientAgreement = false; } return showClientAgreement; } set; } }

 

Here is the VF page:

<apex:page standardController="Go_Live_Process__c" extensions="GoLiveController"> <apex:form id="EditForm"> <apex:pageBlock title="Go Live Edit" id="TheBlock"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> <apex:commandButton action="{!delete}" value="Delete"/> <apex:commandButton action="{!cancel}" value="Cancel"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Go-Live General Information" columns="1" id="general"> <apex:outputField value="{!Go_Live_Process__c.Account__c}"/> <apex:pageBlockSectionitem id="CredBlock" > <apex:outputLabel value="Credentialing"/> <apex:inputCheckBox value="{!showCredentialing}"> <apex:actionSupport event="onclick" rerender="TheBlock" status="showCredentialing" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:outputLabel value="{!showCredentialing}"/> <apex:pageBlockSectionitem > <apex:outputLabel value="Client Agreement"/> <apex:inputCheckBox value="{!showClientAgreement}"> <apex:actionSupport event="onclick" rerender="EditForm" status="showClientAgreement" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:actionStatus startText="(rendering Credentialing Go Live...)" id="showCredentialing"/> <apex:actionStatus startText="(rendering Client Agreement Go Live...)" id="showClientAgreement"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Credentialing" rendered="{!showCredentialing}" id="CredentialingBlock" columns="2"> <apex:inputField value="{!Go_Live_Process__c.Privileges_issued__c}"/> </apex:pageBlockSection> </apex:actionRegion> </apex:pageBlock>

There is a similar post to this already and I have tried all of the suggestions on that post with no success. Here is the link to that post for reference: InputCheckbox will not set

 

I have an output field that shows that when I check it in the edit page that it is true, but after I save and go back in to edit it shows as false again.

 

Any suggestions would be greatly appreciated.

  • October 16, 2009
  • Like
  • 0

I am creating visual force pages for to override New, Edit, and Detail view for a custom object. I am using ActionSupport event On Change for a checkbox. Why is it that when I check the checkbox the even that would be considered "on change" the section of the page that should be rendered on this action does not display. It displays if I click outside of the checkbox after the checkbox has been checked.

 

There is a lot more to add to this extension but I wanted to test that it functioned properly before I coded anymore.

 

Here is the Controller extension:

public with sharing class GoLiveController { public Go_Live_Process__c glp; public apexpages.standardController controller {get; set;} public GoLiveController(ApexPages.StandardController stdController) { // constructor controller = stdController; this.glp= (Go_Live_Process__c)stdController.getRecord(); Go_Live_Process__c goLives = (Go_Live_Process__c)stdController.getRecord(); goLives = [SELECT Account__c FROM Go_Live_Process__c WHERE id=:system.currentpageReference().getparameters().get('id')]; } //Property for Credentialing checkbox public Boolean showCredentialing{ get{ if(showCredentialing == null){ showCredentialing = false; } return showCredentialing; } set; } //Property for client agreement checkbox public Boolean showClientAgreement{ get{ if(showClientAgreement == null){ showClientAgreement = false; } return showClientAgreement; } set; } }

Here is part of the visual force page:

 

... <apex:pageBlockSectionitem > <apex:outputLabel value="Client Agreement"/> <apex:inputCheckBox value="{!showClientAgreement}"> <apex:actionSupport event="onchange" rerender="EditForm" status="showClientAgreement" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:actionStatus startText="(rendering Client Agreement Go Live...)" id="showClientAgreement"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Client Agreement" rendered="{!showClientAgreement}" id="closeoutBlock" columns="2"> <apex:inputField value="{!Go_Live_Process__c.Privileges_issued__c}"/> </apex:pageBlockSection> </apex:actionRegion> ...

Any Ideas? I know how it works and I think it would be okay but I think that users would complain about having to click outside of the checkbox even after they have already checked the box.

 

Thanks!

Message Edited by MSVRad on 10-16-2009 11:10 AM
  • October 16, 2009
  • Like
  • 0

I am trying to write a controller extension where I have created two custom checkbox fields and I want to create two boolean properties to be used with these checkboxes.

 

I have

if(checkbox1 == 'true'){ ca = true; } if(checkbox2 == 'true'){ cred = true; } public Boolean cred{ get{ if(cred == null){ cred = false; } return cred; } set; } //Property for client agreement checkbox public Boolean ca{ get{ if(ca == null){ ca = false; } return ca; } set; }

I am not sure how to set the checkbox to true or false in apex code. I get an error saying "Comparison Argument must be compatible types:Schema.SObjectField, string"

 

Any ideas on how to handle this?  I am trying to use this boolean property to render pageblock sections in a visualforce page.

 

Thanks.

  • September 21, 2009
  • Like
  • 0

I have written a simple trigger that populates a custom lookup field on the Contact object with the Data from a Standard lookup field on the Account object.

 

I am having some issue testing this trigger as everytime I try to create a dummy contact to test on I get an error.

 

Here is the trigger:

 

trigger PopulatePracticeContact on Contact (before update, before insert) { //Set of Account Ids Set<Id> AccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { AccountIds.add(contactNew.AccountId); //A set of Accounts } Map<Id, Account> pAccounts = new Map<Id, Account>([SELECT a.id, a.parentid, a.Name FROM Account a WHERE a.id IN :AccountIds]); for(Contact fcon : Trigger.New){ fcon.Related_Practice_Account__c = pAccounts.get(fcon.AccountId).ParentId; } }

 

 

Here is what I have started for the Test Class... I am not really sure how to test this anyway, so any suggestions would be greatly appreciated.

 

public with sharing class PopulatePracticeContactTest {

  static testMethod void PopulatePracticeContactTest(){

 

Account pAcc1 = new Account(Name = 'TestAccount1', BillingState = 'MN', Practice_ID__c = '1234', Operational_status__c = 'Prospect', recordTypeId = '012700000009R7B');

insert pAcc1;

Account fAcc1 = new Account(Name = 'TestAccount2', BillingState = 'OH', Facility_ID__c = '4321', Operational_status__c ='Pending', recordTypeId = '012700000009R7G', ParentId = pAcc1.id);

insert fAcc1;

 

Contact pCon1 = new Contact(LastName = 'TestContact1', AccountId = pAcc1);

insert pCon1;

Contact fCon1 = new Contact(LastName = 'TestContact2', AccountId = fAcc1);  insert fCon1;

 

}

}

 

The error that I get is this:

 

Save error: Invalid initial expression type for field Contact.AccountId, expecting: Id PopulatePracticeContactTest.cls 

 

Update: I didn't review this before I posted it - I did make a copy/paste error I just pasted the trigger twice.  The test class that I actually started writing is now added.

Message Edited by MSVRad on 09-08-2009 06:44 AM
  • September 03, 2009
  • Like
  • 0

I am trying to write a validation rule for two picklists.

 

If one picklist (StageName) is on option "Closed Lost" then the second picklist "Lost Reason" cannot be "null" or a value must be selected.

 

I tried this:

 

AND (
ISPICKVAL( StageName , "Closed Lost"),
ISNULL( Lost_Reason__c )
)

 

Then I get an error saying that the ISNULL function cannot be used on a picklist.

 

Is there a function that I can use for this purpose or do I need to write an apex trigger?

  • August 21, 2009
  • Like
  • 0

I am trying to pre-populate a custom lookup field on the Contact object with an account. This Account is the parent of the Account in the standard "Account Name" field on the Contact page. Facility is a child account, Practice is a parent account.

 

Here is what I have. It does not work - this is probably the 5th version of this trigger I have tried writing. I have logged a case with premier support - it has been escalated but I have not heard anything back.

 

Any Suggestions would be greatly appreciated.

trigger PopulatePracticeContact on Contact (before insert, before update) { //Set of Account Ids Set<Id> FacilityAccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { //Facility Record Type == 012700000009R7G, always Child Account if(contactNew.Account.parentId != null && contactNew.Account.RecordTypeId == '012700000009R7G') { FacilityAccountIds.add(contactNew.AccountId); //A set of Facility Accounts } } Contact [] con = Trigger.new; con = [SELECT c.Id, c.Name, c.Related_Practice_Account__c, c.AccountId FROM Contact c WHERE c.AccountId IN :FacilityAccountIds]; Account [] pAccounts; pAccounts = [SELECT a.id, a.parentid, a.Name, (SELECT id, AccountId, Related_Practice_Account__c, Related_Practice__c FROM Contacts WHERE AccountId IN :FacilityAccountIds) FROM Account a WHERE a.id IN :FacilityAccountIds]; if(con.size()> 0){ if((con[0].AccountId == pAccounts[0].Id) && (pAccounts[0].ParentId != null)){ pAccounts[0].ParentId = con[0].Related_Practice_Account__c; } update con[0]; } }

 

  • August 19, 2009
  • Like
  • 0
I have set up a custom owner field (lookup) and would like to have our status (picklist) and type (picklist) fields required if it is filled out.  The validation rules I've tried don't seem to work.  Any ideas?

I am creating a visualforce page, and I would like an action to occur "onchange" of a picklist.

 

Here is what I have for the visualforce page for the section I am trying to rerender:

<apex:pageBlockSectionItem > <apex:outputLabel value="Stage" /> <apex:selectList value="{!SelectedStage}" size="1"> <apex:selectOptions value="{!StageOptions}" /> <apex:actionSupport reRender="oppForm" event="onchange" status="showCloseoutSection" /> </apex:selectList> </apex:pageBlockSectionItem> <apex:actionStatus startText="(rendering closeout information...)" id="showCloseoutSection"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Closeout Information" rendered="{!Opportunity.StageName == 'Contract Signed'}" id="closeoutBlock" columns="1"> <apex:inputField value="{!Opportunity.Win_Lost_Reason__c}"/> <apex:inputField value="{!Opportunity.Competitor_Lost_To_Or_Replaced__c}"/> <apex:inputField value="{!Opportunity.Price_CT_Prelim__c}"/> </apex:pageBlockSection> </apex:actionRegion>

 

Here is what I have so far for my controller:

 

 

public class OpportunityClosedLost { public Opportunity opp; public apexpages.standardController controller {get; set;} //Used to determine if the action is an insert or update. public Boolean bUpdate{get; set;} public opportunityClosedLost(ApexPages.StandardController stdController) { // constructor controller = stdController; this.opp= (Opportunity)stdController.getRecord(); Opportunity opps = (Opportunity)stdController.getRecord(); opps = [SELECT RecordTypeId, StageName FROM Opportunity WHERE id=:system.currentpageReference().getparameters().get('id')]; //VRC opportunity if(opps.RecordTypeId =='012700000009RIb'){ isVrc = true; } //vRad Alliance Opportunity if(opps.RecordTypeId =='012R00000000M08'){ isAlliance = true; } //EC Opportinity if(opps.RecordTypeId =='012700000005KwS'){ isEc = true; } } public List<SelectOption> getStageOptions(){ List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('null','-- Select One --')); Schema.DescribeFieldResult oppStage = Schema.sObjectType.Opportunity.fields.StageName; for (Schema.PickListEntry oppPickVal : oppStage.getPicklistValues()){ // create a selectoption for each pickval options.add(new SelectOption(oppPickVal.getValue(),oppPickVal.getLabel())); } return options; } public Boolean isVrc{ get{ if(isVrc == null){ isVrc = false; } return isVrc; } set; } public Boolean isAlliance{ get{ if(isAlliance == null){ isAlliance = false; } return isAlliance; } set; } public Boolean isEc{ get{ if(isEc == null){ isEc = false; } return isEc; } set; } public String SelectedStage{ get {return SelectedStage;} set; } }

 

Right now it does not render the pageblocksection that has the <actionRegion> tags around it. Any suggestions as to what I am doing wrong or as to why it is not rendering?  The actionstatus does appear even though nothing is rendered.  I also noticed that when i select an option from the picklist that is suppose control the rendering of the pageblocksection The option does not get saved when save is clicked.

 

Thanks!

Message Edited by MSVRad on 08-12-2009 10:23 AM
  • August 12, 2009
  • Like
  • 0