• Joe Stolz
  • NEWBIE
  • 95 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 8
    Questions
  • 29
    Replies
Hello guys.I made a VisualForce page. How do I add this page to standart page Layouts (Account).

I found this link - http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/
But I do not see item menu - VisualForce pages.


Thanks to all



 
  • July 27, 2015
  • Like
  • 0
I have a VisualForce page where a number of opportunity fields are availble to edit. This page works as needed on the standard opportunity page layout, but I have a new requirement to make the page available in a console. When the save button is clicked, the whole screen refreshes and only the opportunity is visible, not the list view or custom components. I know this has something to do with the save commandLink target that I have specified, but I am unsure of what my target should be within the console. Any suggestions? 

I need the record page to refresh with the values once the save link is clicked.

Thank you,
Joe
I have a number of inputfields where I would like the label to be above the input. Is there a standard easy way to accomplish this that my Google searching missed?

My Code is:
<apex:page standardController="Opportunity" showHeader="false" sidebar="false">     
<apex:form >        
    <apex:pageBlock title="" id="OppPageBlock" mode="edit">             
        <apex:pageMessages />             
            <apex:pageBlockButtons location="bottom" >                 
                <apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/>                 
                <apex:commandButton value="Cancel" action="{!cancel}"/>             
            </apex:pageBlockButtons>                        
        
<!-- Qualification Stage -->        
        
        <apex:pageBlockSection title="Qualification Fields" columns="1" showHeader="FALSE" rendered="{!opportunity.StageName == 'Qualification_RPA'}">                 
            <apex:inputField value="{!opportunity.Accept_or_Reject_Work_Order_Email__c}"/> 
            <apex:inputField value="{!opportunity.NTE_Certified_Partner__c}"/> 
            <apex:inputField value="{!opportunity.Reason_for_Rejection__c}"/> 
            <apex:inputField value="{!opportunity.Save_WO_Email_to_Box__c}"/> 
            <apex:inputField value="{!opportunity.Create_Job_in_Sage_PJ__c}"/>             
        </apex:pageBlockSection>

And here is the result:
User-added image

I have a narrow space to work with and things would be much better if the label could be formatted over top of the input.

Thank you,
Joe
Hello,

I am just learning Visualforce and am finding all sorts of uses for it in my Org. I was given a request for a simple way for internal users to submit cases to a queue. This led me to create a quick Visualfoce page, which works, except for assigning the case to a queue. Could someone help me with how to assign a case completed on this VF page to a specific queue?
 
<apex:page standardController="Case" showHeader="true" sidebar="true">
<apex:form id="theForm">
  <apex:pageBlock title="Submit your CP support requests below" id="casePageBlock" mode="edit">
    <apex:pageMessages />
    <apex:pageBlockButtons location="bottom">
      <apex:commandButton value="Save" action="{!save}" id="theButton"/>
      <apex:commandButton value="Cancel" action="{!cancel}"/>
    </apex:pageBlockButtons>
    <apex:actionRegion >
      <apex:pageBlockSection id="masterPageBlock" title="Master" showHeader="false">
        <apex:inputField id="casTyp" value="{!Case.Type_of_Request__c}"/>
        <apex:inputField id="casOwn" label="Owner" value="{!case.OwnerId}" rendered="false"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection id="thePageBlock" title="The Fields" showHeader="false" columns="2">
        <apex:inputField id="casAcc" label="CP's Account Name" required="true" value="{!case.AccountId}"/>
        <apex:inputField id="casCon" label="Who is your contact?" value="{!case.ContactId}"/>
        <apex:inputField id="casOpp" label="What opportunity is this related to?"  value="{!case.Related_Opportunity__c}"/>
        <apex:inputField id="casPri" label="What is the priority of this request" required="true" value="{!case.Priority}"/>
        <apex:inputField id="casDes" label="Please describe what you would like done" required="true" value="{!case.Description}"/>
      </apex:pageBlockSection>
    </apex:actionRegion>
  </apex:pageBlock>
</apex:form>
</apex:page>

The queue Id is 00Gi00000043ioY.

Thank you,
Joe Stolz
In my Org we have a picklist field for our opportunity statuses. There's a workflow that moves the stage to 'Awarded' when the status is set to 'Close-Won.' I have a trigger that creates a custom object when a certain opportunity record type reaches 'Awarded.' I only want one object created. Everything works well as long as users follow the script of moving the status instead of the status and stage. But users always seem to find a way to break what I create (or I just didn't create them well enough).

So here is my trigger:
trigger CreatePMopp on Opportunity (after update) 
{

List<Phasing_PM_Info__c> ppi = new List<Phasing_PM_Info__c>();
List<RecordType> rtypes = [Select Name, Id From RecordType where sObjectType='Opportunity' and isActive=true];
Map<String,String> opportunityRecordTypes = new Map<String,String>{};
    for(RecordType rt: rtypes) opportunityRecordTypes.put(rt.Name,rt.Id);

    for ( Opportunity o : Trigger.new )
        if ((o.RecordTypeId==opportunityRecordTypes.get('RPA Capital')) && ( o.StageName=='Close-Won') && (Trigger.oldMap.get(o.id).Status__c!='Close-Won'))
        {
            ppi.add (new Phasing_PM_Info__C(
                Name = o.Name,
                PM_Opportunity__c = o.Id));
        }
    insert ppi;
}

I could make the workflow trigger a hidden checkbox as well as update the stage, but I wanted something more straighforward. Have any of you been able to solve for this and would be willing to help me out?

Thank you,
Joe Stolz 
I have the V3 Box integration on my Org and it is a huge part of our daily workflow. We have field workers who create reports using GoCanvas which does have a Box integration but is limited in where I can drop the completed forms. What I am looking for is a way to find the Box Folder ID attached to an opportunity so I can drop the completed forms into the correct folder. Does anyone know if I can find this data someone in SFDC? The Box app did create a Custom Field called FolderID on the opportunity object, but there is no reportable information in this field that I can access. 

Does anyone have an ideas on this one or should I just go straight to Box and ask for an answer?
I have been searching for answers and testing solutions all day for this. Any help would be greatly appreciated.

We use a large number of workflow tasks that are assigned to different members of our opportunity teams depending on what stage the opportunity enters. We do not want our users to change when these tasks are due, but we also do not want tasks to be due during non business days. Both of these solutions I have solved for, but I cannot solve for both at the same time. I have a trigger in place that changes the date of tasks that fall due on Saturdays or Sundays.
trigger WeekendTasks on Task (after insert, after update)
{
for (Task tas : Trigger.new)
{
if (tas.RecordTypeID == '012i00000011lsq' && tas.ActivityDate != null)
{
Date origin = Date.newInstance(1900,1,6);
Date due = tas.ActivityDate;
Integer x = origin.daysBetween(due);
Integer day = Math.mod(x,7);
if (day < 2 )
{
Task tt = new Task
(
Id = tas.Id,
ActivityDate = (tas.ActivityDate + 1)
  );
update tt;
}
}
}
}
This works perfectly for our needs, but when I combine this with my Task Validation Rule:
AND( ISCHANGED( ActivityDate ), RecordType.Name ="RPA Auto Task" ,$Profile.Name <>"System Administrator", $Profile.Name <>"RPA Director")
My users receive this error:
 
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger WeekendTasksUpdate caused an unexpected exception, contact your administrator: WeekendTasksUpdate: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 00Te000000DlLGREA3; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Only Administrators and Directors are able to change task due dates.: [ActivityDate]: Trigger.WeekendTasksUpdate: line 18, column 1".
This only happens when a workflow tasks falls on the weekends and the trigger trys to change the task due date which is prevented by my validation rule. I tried to follow Bob Buzzard's guide (http://bobbuzzard.blogspot.com/2011/11/bypass-validation-rules-from-apex.html) on setting a custom checkbox on the task but could not get this to work. I believe the issue comes because my trigger fires after update/insert, but I do not know enough about apex to fix this.

Any ideas on how to make the validation rule and trigger play nice with each other? I would love the ability to run the trigger as an admin each time, but that does not seem possible either.
Our Org has a number of workflow generated tasks to help our users know what to do for an opportunity depending on which stage the opportunity is in. This is working well, but we are running into the issue of tasks coming due on weekends. I know this has been asked a number of times and I have done some digging and found an answer here (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008uTgIAI) that worked quite well for a specific subject.

I am very new to Apex triggers and could use some help customizing the code to only work for opportunities of certain record types. Here is the code I am using:
trigger WeekendTasks on Task (after insert)
{ for (Task tas : Trigger.new)
  {  if (Opp.RecordType == 'RPA NTE-Perm' , 'RPA NTE(No Bid)' , 'RPA RFQ' , 'RPA Capital')
   {   Date origin = Date.newInstance(1900,1,6);
      Date due = tas.ActivityDate;
        Integer x = origin.daysBetween(due);
     Integer day = Math.mod(x,7);
     if (day < 2 )
     {    Task tt = new Task (
          Id = tas.Id,
           ActivityDate = (tas.ActivityDate + 2),
        Description = String.valueOf(day)    );
           update tt;
     } 
   }
  }
}
This trigger does not work as you probably already knew. If I replace the bold underlined line with:
if (tas.Subject == 'Change Stage - Awarded')
Everything works perfectly, but I do not want the trigger to fire off the Subject.  Could someone help me out with how to fire this trigger only for tasks associated with opportunity record types RPA RFQ, RPA NTE-Perm, RPA Capital and RPA NTE(No Bid)?

Thank you
We have a number of different opportunity teams and they vary by parent account. I found and customized a trigger to copy the account team (Which we do not use for sales tracking purposes) to the opportunity team. This works perfectly, but we want this as automated as possible. What I would like to do is have the Parent Account Team copied to the Child Account Opportunity Team. Could someone help me out with this?

Here is the code I am using to copy the Child Account Team to the Opportunity Team:

trigger SetOpportunityTeam on Opportunity (after insert) {
List<OpportunityTeamMember> oppTeamMembersList = new List<OpportunityTeamMember>();

Map< Id , Id > opportunityIdToAccountId = new Map< Id , Id >();
for(Opportunity o : Trigger.new)  {
    if(o.StageName == 'Qualification_RPA')   {
        opportunityIdToAccountId.put(o.Id,  o.AccountId );
    }
}


Map<id, List<AccountTeamMember > > accountIdToAccountTeamMembers = new    Map<id,  List<AccountTeamMember > > ();
for(AccountTeamMember accountTeamMember : [SELECT a.UserId,a.User.Name,a.TeamMemberRole, a.Id, a.AccountId
                        FROM AccountTeamMember a
                        WHERE a.TeamMemberRole IN ('National Operations Manager','Account Coordinator','National Account Manager','Sales Leader','Director of Account Management','Director of Operations') AND
                        a.AccountId in :opportunityIdToAccountId.values() ])   {

        List<AccountTeamMember > accountTeamMembers = ( accountIdToAccountTeamMembers.get(accountTeamMember.Accountid) == null) ?
                                                       new  List<AccountTeamMember >() :
                                                       accountIdToAccountTeamMembers.get(accountTeamMember.Accountid);

        accountTeamMembers.add(accountTeamMember);
        accountIdToAccountTeamMembers.put(accountTeamMember.Accountid, accountTeamMembers);

}



for(Opportunity o : Trigger.new) {
    if(o.StageName == 'Qualification_RPA')   {
        Id accountId  = opportunityIdToAccountId.get(o.Id);
        for ( AccountTeamMember accountTeamMember : accountIdToAccountTeamMembers.get(accountId) )  {
            OpportunityTeamMember opportunityTeamMember  = new OpportunityTeamMember();
            opportunityTeamMember.UserId = accountTeamMember.UserId;
            opportunityTeamMember.TeamMemberRole = accountTeamMember.TeamMemberRole;
            opportunityTeamMember.OpportunityId = o.ID;
            oppTeamMembersList.add(opportunityTeamMember);
        }
     }
}

insert oppTeamMembersList;
}
I have a VisualForce page where a number of opportunity fields are availble to edit. This page works as needed on the standard opportunity page layout, but I have a new requirement to make the page available in a console. When the save button is clicked, the whole screen refreshes and only the opportunity is visible, not the list view or custom components. I know this has something to do with the save commandLink target that I have specified, but I am unsure of what my target should be within the console. Any suggestions? 

I need the record page to refresh with the values once the save link is clicked.

Thank you,
Joe
Hi Guys,

I developed a new form ("object") and opened a new Tab for it. I can see the tab in my user and in other users, but not in one specific user. I've tried changing the settings of the profile of that user, and changing the users profile, but still nothing works.

Do you have any suggestions?

Shani
I have a number of inputfields where I would like the label to be above the input. Is there a standard easy way to accomplish this that my Google searching missed?

My Code is:
<apex:page standardController="Opportunity" showHeader="false" sidebar="false">     
<apex:form >        
    <apex:pageBlock title="" id="OppPageBlock" mode="edit">             
        <apex:pageMessages />             
            <apex:pageBlockButtons location="bottom" >                 
                <apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/>                 
                <apex:commandButton value="Cancel" action="{!cancel}"/>             
            </apex:pageBlockButtons>                        
        
<!-- Qualification Stage -->        
        
        <apex:pageBlockSection title="Qualification Fields" columns="1" showHeader="FALSE" rendered="{!opportunity.StageName == 'Qualification_RPA'}">                 
            <apex:inputField value="{!opportunity.Accept_or_Reject_Work_Order_Email__c}"/> 
            <apex:inputField value="{!opportunity.NTE_Certified_Partner__c}"/> 
            <apex:inputField value="{!opportunity.Reason_for_Rejection__c}"/> 
            <apex:inputField value="{!opportunity.Save_WO_Email_to_Box__c}"/> 
            <apex:inputField value="{!opportunity.Create_Job_in_Sage_PJ__c}"/>             
        </apex:pageBlockSection>

And here is the result:
User-added image

I have a narrow space to work with and things would be much better if the label could be formatted over top of the input.

Thank you,
Joe
Hello guys.I made a VisualForce page. How do I add this page to standart page Layouts (Account).

I found this link - http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/
But I do not see item menu - VisualForce pages.


Thanks to all



 
  • July 27, 2015
  • Like
  • 0
Hello,

I am just learning Visualforce and am finding all sorts of uses for it in my Org. I was given a request for a simple way for internal users to submit cases to a queue. This led me to create a quick Visualfoce page, which works, except for assigning the case to a queue. Could someone help me with how to assign a case completed on this VF page to a specific queue?
 
<apex:page standardController="Case" showHeader="true" sidebar="true">
<apex:form id="theForm">
  <apex:pageBlock title="Submit your CP support requests below" id="casePageBlock" mode="edit">
    <apex:pageMessages />
    <apex:pageBlockButtons location="bottom">
      <apex:commandButton value="Save" action="{!save}" id="theButton"/>
      <apex:commandButton value="Cancel" action="{!cancel}"/>
    </apex:pageBlockButtons>
    <apex:actionRegion >
      <apex:pageBlockSection id="masterPageBlock" title="Master" showHeader="false">
        <apex:inputField id="casTyp" value="{!Case.Type_of_Request__c}"/>
        <apex:inputField id="casOwn" label="Owner" value="{!case.OwnerId}" rendered="false"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection id="thePageBlock" title="The Fields" showHeader="false" columns="2">
        <apex:inputField id="casAcc" label="CP's Account Name" required="true" value="{!case.AccountId}"/>
        <apex:inputField id="casCon" label="Who is your contact?" value="{!case.ContactId}"/>
        <apex:inputField id="casOpp" label="What opportunity is this related to?"  value="{!case.Related_Opportunity__c}"/>
        <apex:inputField id="casPri" label="What is the priority of this request" required="true" value="{!case.Priority}"/>
        <apex:inputField id="casDes" label="Please describe what you would like done" required="true" value="{!case.Description}"/>
      </apex:pageBlockSection>
    </apex:actionRegion>
  </apex:pageBlock>
</apex:form>
</apex:page>

The queue Id is 00Gi00000043ioY.

Thank you,
Joe Stolz
In my Org we have a picklist field for our opportunity statuses. There's a workflow that moves the stage to 'Awarded' when the status is set to 'Close-Won.' I have a trigger that creates a custom object when a certain opportunity record type reaches 'Awarded.' I only want one object created. Everything works well as long as users follow the script of moving the status instead of the status and stage. But users always seem to find a way to break what I create (or I just didn't create them well enough).

So here is my trigger:
trigger CreatePMopp on Opportunity (after update) 
{

List<Phasing_PM_Info__c> ppi = new List<Phasing_PM_Info__c>();
List<RecordType> rtypes = [Select Name, Id From RecordType where sObjectType='Opportunity' and isActive=true];
Map<String,String> opportunityRecordTypes = new Map<String,String>{};
    for(RecordType rt: rtypes) opportunityRecordTypes.put(rt.Name,rt.Id);

    for ( Opportunity o : Trigger.new )
        if ((o.RecordTypeId==opportunityRecordTypes.get('RPA Capital')) && ( o.StageName=='Close-Won') && (Trigger.oldMap.get(o.id).Status__c!='Close-Won'))
        {
            ppi.add (new Phasing_PM_Info__C(
                Name = o.Name,
                PM_Opportunity__c = o.Id));
        }
    insert ppi;
}

I could make the workflow trigger a hidden checkbox as well as update the stage, but I wanted something more straighforward. Have any of you been able to solve for this and would be willing to help me out?

Thank you,
Joe Stolz 
I have the V3 Box integration on my Org and it is a huge part of our daily workflow. We have field workers who create reports using GoCanvas which does have a Box integration but is limited in where I can drop the completed forms. What I am looking for is a way to find the Box Folder ID attached to an opportunity so I can drop the completed forms into the correct folder. Does anyone know if I can find this data someone in SFDC? The Box app did create a Custom Field called FolderID on the opportunity object, but there is no reportable information in this field that I can access. 

Does anyone have an ideas on this one or should I just go straight to Box and ask for an answer?
I'm a new admin, just learning and have a questions that should be easy to answer, but I'm stuck.

I created 3 Account Record types:  Client, Prospect and Consultant.  I also created separate page layouts for each Record Type and assigned them to the appropriate profiles (mine included). 

When I create a new Account, I get prompted to select the Record Type, as planned and based on that selection, the appropriate page layout is displayed.  However, once I save that record or try to open it again, I get a blank page.  What am I missing?  Thanks!

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.