• yeshab
  • NEWBIE
  • 70 Points
  • Member since 2013
  • Solution Architect
  • CloudFountain


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
Hello,

In an opportunity, I have some record types "RA", "RB", "RC".
And there are stages 1,2,3,4,5

Stage |Probability in %
1 5 %
2 25 %
3 40 %
4 100 %
5 100 %

Right now, user is able to change the stage to 4 or 5 from 3,
But i want that user should go stage "4" before going through stage '5'.

What validation rule could i implement

Thank you for suggestion !
I have a test class that creates records for use in unit tests. One of the components creates an Opportunity record, but I don't know how to add a Record Type to the Opp. I know I can use RecordTypeID, but since I don't want to hardcode that, I am looking to use the Record Type name. Can anyone help me figure out the syntax I need to use? Thanks,
 
public static Opportunity createOppNew (Id acctId){ 
    Opportunity opp1 = new Opportunity();
      opp1.Name = 'Test Renewal Opp';
      opp1.StageName = 'Phase 1';
      opp1.CloseDate = Date.today().addYears(1);
      opp1.Renewal__c = 'Yes';
      opp1.Effective_Date__c = Date.today().addYears(1);
      opp1.RP_Contract_Start__c = Date.today().addDays(1);
      opp1.Term__c = 12;
      opp1.AccountId = acctId;
      opp1.RP_Customer_Engagement__c = 0;
    return opp1;
}

 
I have created a flow and implemented apex plugin class. when I try to save this flow as User Provisioning Flow, I get error:

User-added image


Implementation of my plugin class:


 global override Process.PluginDescribeResult buildDescribeCall() {
        
        Process.PluginDescribeResult describeResult = new Process.PluginDescribeResult();
        
        describeResult.inputParameters = new 
            List<Process.PluginDescribeResult.InputParameter>{ 
new Process.PluginDescribeResult.InputParameter('testInputParam',
                    Process.PluginDescribeResult.ParameterType.INTEGER, true),
                
                new Process.PluginDescribeResult.InputParameter('User', 
                    Process.PluginDescribeResult.ParameterType.STRING, true),
            
                new Process.PluginDescribeResult.InputParameter('UserProvAccount',
                    Process.PluginDescribeResult.ParameterType.STRING, true),            
                      
                new Process.PluginDescribeResult.InputParameter('UserProvisioningRequest', 
                    Process.PluginDescribeResult.ParameterType.INTEGER, true)
            }; 
describeResult.outputParameters = new 
            List<Process.PluginDescribeResult.OutputParameter>{ 
                               
                new Process.PluginDescribeResult.OutputParameter('testOutputParam', 
                    Process.PluginDescribeResult.ParameterType.INTEGER),
                
                new Process.PluginDescribeResult.OutputParameter('ExternalUserId', 
                    Process.PluginDescribeResult.ParameterType.STRING),
                    
                new Process.PluginDescribeResult.OutputParameter('ExternalUsername', 
                    Process.PluginDescribeResult.ParameterType.STRING)
          
            };
            
        return describeResult;

​}


not sure what am I missing or what is wrong?
Any pointers/suggestions would be nice.Thank you in advance.

 
  • November 10, 2015
  • Like
  • 0
I am doing a simple query on custom object like below:

SELECT Widget__c.Name,  Id, orderid__c, (SELECT Model__c.Name FROM Widget__c.Models__r) FROM Widget__c order by orderid__c

orderid__c is a numeric field, used to sort.
it works fine in the developer console query editor, but doesn't appear in ordered form in the code.

any help would be great!!!


Thanks,


  • September 03, 2014
  • Like
  • 0
I have to create vertical tab in visualforce page using jquery.
The tab headings values come from <apex:repeat> which is list of names

<head>
    <apex:includeScript value="{!URLFOR($Resource.jquery, 'jquery-ui-1.10.4.custom/js/jquery-1.10.2.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery, 'jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery, 'jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.jquery, 'jquery-ui-1.10.4.custom/css/ui-lightness/jquery-ui-1.10.4.custom.css')}"/>
     <apex:stylesheet value="{!URLFOR($Resource.jquery, 'jquery-ui-1.10.4.custom/css/ui-lightness/jquery-ui-1.10.4.custom.min.css')}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery,'jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.tabs.js')}"/>
    <script>
  $(function() {
$('#tabs').tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );;
$( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
  
  });
  </script>
  <style>
  .ui-tabs-vertical { width: 55em; }
  .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
  .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
  .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
  .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
  .ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
  </style>
</head>
<body>



<apex:repeat value="{!Categories}" var="assessmentcategory" >
  <div id="tabs">
  <ul>
    <li><a href="#tabs-{!assessmentcategory.name}">{!assessmentcategory.name}</a></li>
  </ul>
  <div id="tabs-{!assessmentcategory.name}">
   <p>{!assessmentcategory.name}</p>
  </div>
  </div>
</apex:repeat> 


Problem is only first item is in a tab the remaining elements appear as a link.

any pointers would be helpful.
I am displaying a set of questions and answer for it is either yes or no. these set of questions come from a object. the set method is not getting executed. below is my code

The objectName is the method that gets the set of questions from custom object.

<apex:repeat value="{!objectName}" var="q">
<apex:selectRadio value="{!Response}">
<apex:outputtext style="color:green;" escape="false" value="{!q.Questions__c}" />
<apex:selectOptions value="{!Answer}" />
</apex:selectRadio>

<apex:outputtext value="{!Answer}"/>
<apex:outputtext value="{!Response}"/>     
</apex:repeat>

---------------------------------------Class Code---------------------------------------------------------------
public List<SelectOption> getAnswer() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Yes','Yes'));
options.add(new SelectOption('No','No'));
return options;
}

public void setResponse(String[] Response) {


    if(Response != null)
      this.Response = Response;
    else{
        list<String> arrStr = new list<string>();
        arrStr.add('No');
      this.pResponse = arrStr;
    }
}

public string[] getResponse(){ return Response;}
  • March 13, 2014
  • Like
  • 0
Hello,

In an opportunity, I have some record types "RA", "RB", "RC".
And there are stages 1,2,3,4,5

Stage |Probability in %
1 5 %
2 25 %
3 40 %
4 100 %
5 100 %

Right now, user is able to change the stage to 4 or 5 from 3,
But i want that user should go stage "4" before going through stage '5'.

What validation rule could i implement

Thank you for suggestion !
Hello, I'm receiving an error message for something that I believe was custom built by our integration partners who are no longer working with us. Below is the message. I can get to the Apex Trigger Page, I just don't know what I should be changing. Can someone advise? Thank you!

Error:Apex trigger kell01_OpportunityTrigger caused an unexpected exception, contact your administrator: kell01_OpportunityTrigger: execution of AfterUpdate caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.AccountId: Trigger.kell01_OpportunityTrigger: line 108, column 1
I have a small controller that I'm using and I'm trying to figure out if there is a way I can pass a cookie to a visualforce page within a PageRefernece.   I'd like the cookie to be available on my visualforce page so I can just do {!someCookieValue}.

Do I need to create another controller for the visualforce page I'm returning?

Here is the code:
 
public with sharing class pageController {

  public PageReference getTemplate() {

   Cookie someCookieValue = ApexPages.currentPage().getCookies().get('thecookie');
   return Page.HomePageTemplate;
   }

}

 
I have created a flow and implemented apex plugin class. when I try to save this flow as User Provisioning Flow, I get error:

User-added image


Implementation of my plugin class:


 global override Process.PluginDescribeResult buildDescribeCall() {
        
        Process.PluginDescribeResult describeResult = new Process.PluginDescribeResult();
        
        describeResult.inputParameters = new 
            List<Process.PluginDescribeResult.InputParameter>{ 
new Process.PluginDescribeResult.InputParameter('testInputParam',
                    Process.PluginDescribeResult.ParameterType.INTEGER, true),
                
                new Process.PluginDescribeResult.InputParameter('User', 
                    Process.PluginDescribeResult.ParameterType.STRING, true),
            
                new Process.PluginDescribeResult.InputParameter('UserProvAccount',
                    Process.PluginDescribeResult.ParameterType.STRING, true),            
                      
                new Process.PluginDescribeResult.InputParameter('UserProvisioningRequest', 
                    Process.PluginDescribeResult.ParameterType.INTEGER, true)
            }; 
describeResult.outputParameters = new 
            List<Process.PluginDescribeResult.OutputParameter>{ 
                               
                new Process.PluginDescribeResult.OutputParameter('testOutputParam', 
                    Process.PluginDescribeResult.ParameterType.INTEGER),
                
                new Process.PluginDescribeResult.OutputParameter('ExternalUserId', 
                    Process.PluginDescribeResult.ParameterType.STRING),
                    
                new Process.PluginDescribeResult.OutputParameter('ExternalUsername', 
                    Process.PluginDescribeResult.ParameterType.STRING)
          
            };
            
        return describeResult;

​}


not sure what am I missing or what is wrong?
Any pointers/suggestions would be nice.Thank you in advance.

 
  • November 10, 2015
  • Like
  • 0
I have a trigger on a Parent Object_A to update records on a Child Object_B 

I have a Set<ID> myID to get current record from Object A.

Object_B has a Picklist field Status__c.

List<Object_B> ToUpdate = [SELECT id, Name, Status__c from Object_B WHERE Status__c = 'Open' OR Status__c = 'Late' AND Object_B.Object_A in ;myID];

I would like to choose records that have the picklist value of EITHER Open or Late and where the lookup for Object A has the ID from my set myId.
It all works perfectly if I do Where Status equals one value. But I can't figure out how to say one value or the other.

Thanks in advance
  • March 20, 2015
  • Like
  • 0
Presently I am using the following syntax but I am getting a blank pdf page with this. Can anyone please help me

<apex:page standardController="Report" renderAs="pdf">
  <apex:iframe src="/00OK0000000TZ2u"/>  
</apex:page>
I have a test class that creates records for use in unit tests. One of the components creates an Opportunity record, but I don't know how to add a Record Type to the Opp. I know I can use RecordTypeID, but since I don't want to hardcode that, I am looking to use the Record Type name. Can anyone help me figure out the syntax I need to use? Thanks,
 
public static Opportunity createOppNew (Id acctId){ 
    Opportunity opp1 = new Opportunity();
      opp1.Name = 'Test Renewal Opp';
      opp1.StageName = 'Phase 1';
      opp1.CloseDate = Date.today().addYears(1);
      opp1.Renewal__c = 'Yes';
      opp1.Effective_Date__c = Date.today().addYears(1);
      opp1.RP_Contract_Start__c = Date.today().addDays(1);
      opp1.Term__c = 12;
      opp1.AccountId = acctId;
      opp1.RP_Customer_Engagement__c = 0;
    return opp1;
}

 
I am doing a simple query on custom object like below:

SELECT Widget__c.Name,  Id, orderid__c, (SELECT Model__c.Name FROM Widget__c.Models__r) FROM Widget__c order by orderid__c

orderid__c is a numeric field, used to sort.
it works fine in the developer console query editor, but doesn't appear in ordered form in the code.

any help would be great!!!


Thanks,


  • September 03, 2014
  • Like
  • 0