-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
5Replies
Visualforce - Fields are getting wiped after validation rule triggers for a format error per page refresh
We have a pretty lengthy visualforce page where consultants fill out their account plan. Quite a few fields are of type number -- also date, which is less problematic. If the user fills out 40 fields and happened to enter something other than a number into the corresponding number field, all 40 fields get wiped when they click save due to the refresh. I am looking for some alternatives here. I am using the Database.upsert() with the allornone parameter as false, but that functionality seems to be undefined, with little documentation found online. Also, we do not want to change the number fields to free form text, due to the fact that reporting would be difficult/impossible. I was thinking about using javascript to verify the format of the input. Any suggestions? Input would be appreciated.
Save Method Below
Save Method Below
public PageReference saveOverride() { plan.Opportunity_Name__c = oppId; //upsert plan; Database.upsert(plan, false); for(Integer i = 0; i < ADQR_records.size(); i++) { ADQR_records.get(i).Account_Plan__c = plan.Id; } upsert ADQR_records; for(Integer i = 0; i < Persona_records.size(); i++) { Persona_records.get(i).Account_Plan__c = plan.Id; } upsert Persona_records; for(Integer i = 0; i < Carrier_records.size(); i++) { Carrier_records.get(i).Account_Plan__c = plan.Id; } upsert Carrier_records; for(Integer i = 0; i < Theme_records.size(); i++) { Theme_records.get(i).Account_Plan__c = plan.Id; } upsert Theme_records; PageReference previous = new PageReference('/apex/Account_Plan_Page?value=' + oppId); previous.setRedirect(true); return previous;
-
- James Hayes
- July 07, 2017
- Like
- 0
- Continue reading or reply
Add Red and Green Banner Across Top of Account Page
I have used this formula, it gave me a field with a red or green flag. I would like a banner displayed across the top of the account.
IF( ISPICKVAL( Type, "Client"),
IMAGE("/img/samples/flag_red.gif","Customer Account"),
IMAGE ( "/img/samples/flag_green.gif","Prospect Account"))
Can I get some help? Appreciate it.
IF( ISPICKVAL( Type, "Client"),
IMAGE("/img/samples/flag_red.gif","Customer Account"),
IMAGE ( "/img/samples/flag_green.gif","Prospect Account"))
Can I get some help? Appreciate it.
-
- James Hayes
- March 31, 2017
- Like
- 0
- Continue reading or reply
IsClosed=FALSE is not pulling in Open opps
Hey All,
When using this apex class
It does not pull in the open opportunities when I tie it to an embedded VF page. The VFP pulls in all opportunities. I am not sure what I am missing here. THe VF code is below. Any assistance would be appreciated!
When using this apex class
public class MyOpportunityController3{ public List<Opportunity> oppList{get;set;} public MyOpportunityController3(ApexPages.StandardSetController controller) { oppList = new List<Opportunity>(); for(Opportunity opp : [SELECT id,name,amount,stagename,closedate,ownerid FROM Opportunity WHERE owner.id=:userinfo.getuserid() AND isClosed=False]) { oppList.add(opp ); } } }
It does not pull in the open opportunities when I tie it to an embedded VF page. The VFP pulls in all opportunities. I am not sure what I am missing here. THe VF code is below. Any assistance would be appreciated!
<apex:page standardController="Opportunity" recordSetVar="ops" sidebar="false" extensions="MyOpportunityController3"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:pageBlock Title="List of Opportunities"> <apex:pageblockTable value="{!ops}" var="o"> <apex:column > <apex:commandLink value="{!o.Name}" reRender="refresharea"> <apex:param name="OpportunityID" value="{!o.ID}"/> <apex:param name="OpportunityName" value="{!o.Name}" /> </apex:commandLink> </apex:column> <apex:column value="{!o.Amount}"/> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.Closedate}"/> <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton"/> </apex:pageBlockTable> <apex:pageBlockButtons > <apex:commandButton value="Edit" action="{!save}" id="editButton"/> <apex:commandButton value="Save" action="{!save}" id="saveButton"/> <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton"/> </apex:pageBlockButtons> </apex:PageBlock> <apex:pageBlock title="{!$CurrentPage.parameters.OpportunityName}" id="refresharea"> <apex:detail subject="{!$CurrentPage.parameters.opportunityID}" relatedList="false"/> </apex:pageBlock> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
-
- James Hayes
- February 27, 2017
- Like
- 0
- Continue reading or reply
Embedded visualforce link open in new window
Hey All,
I have embedded a VF page into the home screen that allows our sales users to inline edit their opportunities. However, when they click on the opportunity name, it opens the opportunity in the embedded window and I would like it to open it up in a new tab. The code is below, can I get some assistance on how to do this?
Appreciate all the help!
I have embedded a VF page into the home screen that allows our sales users to inline edit their opportunities. However, when they click on the opportunity name, it opens the opportunity in the embedded window and I would like it to open it up in a new tab. The code is below, can I get some assistance on how to do this?
Appreciate all the help!
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar="false"> <apex:form > <apex:pageBlock > <apex:pageMessages /> <apex:pageBlock > <apex:panelGrid columns="2"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="opp_table"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> </apex:pageBlock> <apex:pageBlockButtons > <apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"> </apex:commandLink> </apex:pageBlockButtons> <apex:pageBlockTable value="{!opportunities}" var="opp" id="opp_table"> <apex:column headerValue="Opportunity Name"> <apex:outputLink value="https://ap2.salesforce.com/{!opp.Id}" id="theLink">{!opp.name}</apex:outputLink> </apex:column> <apex:column headerValue="Stage"> <apex:inputField value="{!opp.stageName}"/> </apex:column> <apex:column headerValue="Sub Stage"> <apex:inputField value="{!opp.Deal_Desk_Sub_Stage__c}"/> </apex:column> <apex:column headerValue="Implementation Date"> <apex:inputField value="{!opp.Implementation_Kick_Off_Date__c}"/> </apex:column> <apex:column headerValue="Date of Demo"> <apex:inputField value="{!opp.Date_of_Demo__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
-
- James Hayes
- February 23, 2017
- Like
- 0
- Continue reading or reply
How do I reference My Opportunities
Hey All, I am trying to get a visualforce page to reference the "My Opportunities" view in salesforce. I am doing a list view on the left and a page view of the opportunity on the right. But, I only want it to view the opportunities that are associated to the owner opening the visualforce page.Here is my current code. <apex:page standardController="Opportunity" recordSetVar="ops" sidebar="false"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:pageBlock Title="List of Opportunities"> <apex:pageblockTable value="{!ops}" var="o"> <apex:column > <apex:commandLink value="{!o.Name}" reRender="refresharea"> <apex:param name="OpportunityID" value="{!o.ID}"/> <apex:param name="OpportunityName" value="{!o.Name}" /> </apex:commandLink> </apex:column> <apex:column value="{!o.Amount}"/> <apex:inlineEditSupport /> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.Closedate}"/> </apex:pageBlockTable> </apex:PageBlock> <apex:pageBlock title="{!$CurrentPage.parameters.OpportunityName}" id="refresharea"> <apex:detail subject="{!$CurrentPage.parameters.opportunityID}" relatedList="false"/> </apex:pageBlock> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Any help would be appreciated. I am fairly new at this. Thanks
-
- James Hayes
- February 22, 2017
- Like
- 0
- Continue reading or reply
The inline edit-Enabled Picklist Error
Hey All,
I am getting this error when trying to build an inline editable opportunity view.
"The inline edit-enabled dependent picklist 'Deal Desk Sub-Stage' requires its controlling field 'Stage' to be present on the page."
Here is my code,
The StageName is the controlling field. But it still gives this error. Can I get some help?
I am getting this error when trying to build an inline editable opportunity view.
"The inline edit-enabled dependent picklist 'Deal Desk Sub-Stage' requires its controlling field 'Stage' to be present on the page."
Here is my code,
<apex:page standardController="Opportunity" recordSetVar="Ops"> <apex:form > <apex:pageBlock title="My List of Opportunities"> <apex:pageBlockTable value="{!ops}" var="o"> <apex:column value="{!o.Name}"/> <apex:column value="{!o.Account.Name}"/> <apex:column value="{!o.Amount}"/> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.CloseDate}"/> <apex:column value="{!o.Go_Live_Date__c}"/> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.Deal_Desk_Sub_Stage__c}"/> </apex:pageBlockTable> <apex:inlineEditSupport /> </apex:pageBlock> </apex:form> </apex:page>
The StageName is the controlling field. But it still gives this error. Can I get some help?
-
- James Hayes
- February 22, 2017
- Like
- 0
- Continue reading or reply
Add Red and Green Banner Across Top of Account Page
I have used this formula, it gave me a field with a red or green flag. I would like a banner displayed across the top of the account.
IF( ISPICKVAL( Type, "Client"),
IMAGE("/img/samples/flag_red.gif","Customer Account"),
IMAGE ( "/img/samples/flag_green.gif","Prospect Account"))
Can I get some help? Appreciate it.
IF( ISPICKVAL( Type, "Client"),
IMAGE("/img/samples/flag_red.gif","Customer Account"),
IMAGE ( "/img/samples/flag_green.gif","Prospect Account"))
Can I get some help? Appreciate it.
- James Hayes
- March 31, 2017
- Like
- 0
- Continue reading or reply
How do I reference My Opportunities
Hey All, I am trying to get a visualforce page to reference the "My Opportunities" view in salesforce. I am doing a list view on the left and a page view of the opportunity on the right. But, I only want it to view the opportunities that are associated to the owner opening the visualforce page.Here is my current code. <apex:page standardController="Opportunity" recordSetVar="ops" sidebar="false"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:pageBlock Title="List of Opportunities"> <apex:pageblockTable value="{!ops}" var="o"> <apex:column > <apex:commandLink value="{!o.Name}" reRender="refresharea"> <apex:param name="OpportunityID" value="{!o.ID}"/> <apex:param name="OpportunityName" value="{!o.Name}" /> </apex:commandLink> </apex:column> <apex:column value="{!o.Amount}"/> <apex:inlineEditSupport /> <apex:column value="{!o.StageName}"/> <apex:column value="{!o.Closedate}"/> </apex:pageBlockTable> </apex:PageBlock> <apex:pageBlock title="{!$CurrentPage.parameters.OpportunityName}" id="refresharea"> <apex:detail subject="{!$CurrentPage.parameters.opportunityID}" relatedList="false"/> </apex:pageBlock> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Any help would be appreciated. I am fairly new at this. Thanks
- James Hayes
- February 22, 2017
- Like
- 0
- Continue reading or reply