• Admin1112
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 13
    Replies

getting unknown property error when saving the vf page.

 

controller

 

public class sosSurvey {

   public Boolean selected { get; set; }
   public String Strength { get; set; }
   public String value { get; set; }

 
 public List<SelectOption> Items {
            get {
                List<SelectOption> options = new List<SelectOption>();
                
Schema.DescribeFieldResult dfr = SOSSurveys__c.strength_against_our_competition__c.getDescribe();
List<Schema.PicklistEntry> pickListEntries = dfr.getPicklistValues();
                                            
                return options;
            }
        }
 
    public String getStrength() {
        return Strength;
    }
 
    public void setStrength(String strength) {
        this.Strength = Strength;
    }
}

 

 

--------------

 

vf page

 

 

<apex:pageBlockSectionItem >
 <apex:outputLabel value="2)What do you think is our strength against our competition ?"/>
  <apex:selectCheckboxes value="{!SOSSurveys__c.strength_against_our_competition__c}">
<apex:selectOptions value="{!Items}"/>
</apex:selectCheckboxes >
 </apex:pageBlockSectionItem>

 

 

 

getting unknown property error when saving the vf page.

 

controller

 

public class sosSurvey {

   public Boolean selected { get; set; }
   public String Strength { get; set; }
   public String value { get; set; }

 
 public List<SelectOption> Items {
            get {
                List<SelectOption> options = new List<SelectOption>();
                
Schema.DescribeFieldResult dfr = SOSSurveys__c.strength_against_our_competition__c.getDescribe();
List<Schema.PicklistEntry> pickListEntries = dfr.getPicklistValues();
                                            
                return options;
            }
        }
 
    public String getStrength() {
        return Strength;
    }
 
    public void setStrength(String strength) {
        this.Strength = Strength;
    }
}

 

 

--------------

 

vf page

 

 

<apex:pageBlockSectionItem >
 <apex:outputLabel value="2)What do you think is our strength against our competition ?"/>
  <apex:selectCheckboxes value="{!SOSSurveys__c.strength_against_our_competition__c}">
<apex:selectOptions value="{!Items}"/>
</apex:selectCheckboxes >
 </apex:pageBlockSectionItem>

 

 

 

I have a trigger that captures the approver ID in an approval process and updates a field with it on the Opportunity. I'm trying to write the unit test for it, but I'm running into errors. It is saying that there are required fields, but I have no idea what these fields are or how to set them. Has anyone been able to resolve something like this before?

 

Below is the specific error message, trigger code, and test code. Thank you so much for the help!

 

Trigger:

rigger TagSalesPlanner on Opportunity (after update) {

for (Opportunity opp : Trigger.new) {
Opportunity OldOpp = Trigger.oldMap.get(opp.ID);
if ((oldopp.ApprovalStatus__c != 'Approved' && opp.ApprovalStatus__c == 'Approved') || (oldopp.ApprovalStatus__c != 'Rejected' && opp.ApprovalStatus__c == 'Rejected')){

//get list of Approved Opportunities
List<Opportunity> ApprovedOpps = [SELECT ID, ProposalApprovers__c
FROM Opportunity
WHERE Id in: trigger.new];
    system.debug('* * * * Approved Opps List* * * *' + ApprovedOpps);

//get list of related Approval Processes
List<ProcessInstance> ap = [SELECT ID, TargetObjectID
                            FROM ProcessInstance
                            WHERE TargetObjectID in : ApprovedOpps];
                            system.debug('processInstance List' + ap);

List<ProcessInstanceStep> actor = [SELECT ActorID,ProcessInstanceID
                                   FROM ProcessInstanceStep
                                   WHERE (StepStatus='Approved' OR StepStatus='Rejected') AND ProcessInstanceID in: ap];
                                   system.debug('processInstanceStep List' + actor);

/*****************************************************
To get the list of proposal approvers in the opportunity record , I have created Maps and List to get the records.
**********************************************************/

Map<ID,List<ID>> pactors = new  Map<ID,List<ID>>();
 List<ID> l;
for(ProcessInstanceStep pa : actor){
        if(pactors.get(pa.ProcessInstanceID) == null){
           l = new List<ID>();
           l.add(pa.ActorID);
           pactors.put(pa.ProcessInstanceID,l);
           }
        else
            pactors.get(pa.ProcessInstanceID).add(pa.ActorID);
    
    }
  system.debug('processinstancemap '+ pactors);  
  
  
Map<ID,List<ID>> actors = new Map<ID,List<ID>>();
for(ProcessInstance pi: ap){
    actors.put(pi.TargetObjectID,pactors.get(pi.ID));
}
    system.debug('Process Instance map'+ actors);

for(Opportunity opp1 : ApprovedOpps){
    List<ID> approverIds = actors.get(opp1.ID);
    system.debug('approver Ids'+ approverIds);

opp1.ProposalApprovers__c='';
for (Integer i=0; i<approverIds.size(); i++){
    opp1.ProposalApprovers__c = opp1.ProposalApprovers__c + ','+ approverIds[i];}
    system.debug('Proposal approvers'+ opp1.ProposalApprovers__c);
}
update ApprovedOpps;
}
}
}

 

Unit Test

@isTest(SeeAllData = true)
private class Test_TagSalesPlanner{
    static testMethod void testTagSalesPlanner(){

//Set up the test records for Master Terms

Account account = new Account();
    account.Name='TestAccount';
    account.website='test.com';
    account.Industry='Entertainment';
       insert account;

Opportunity opportunity = new Opportunity();
    opportunity.AccountId = account.Id;
    opportunity.Name = 'Test Opportunity';
    opportunity.CloseDate = System.today();
    opportunity.StageName = 'In Negotiations';
    opportunity.Amount = 10000.00;
    opportunity.Type = 'New Client';
    opportunity.HasMasterDDForm__c = null;
    opportunity.approvalstatus__c = 'Not Submitted';
    opportunity.rate_type__c = 'CPM';
    
    System.debug('******** Pricebook Entry ID***********' + opportunity.PricebookEntryID__c);
    System.debug('******** Pricebook Entry Name__c ***********' + opportunity.workflowPricebookEntryName__c);
    
    insert opportunity;
    
    List<Opportunity> oppList1 = [SELECT id, workflowPricebookEntryName__c, PricebookEntryID__c FROM Opportunity WHERE id =:opportunity.id];
    System.debug('********* Pricebook Entry ID After Insert*****' + oppList1[0].PricebookEntryID__c);
    System.debug('********* Pricebook Entry Name After Insert*****' + oppList1[0].workflowPricebookEntryName__c);
    
ProposalFlight__c proposalflight = new ProposalFlight__c();
   proposalflight.opportunity__c = opportunity.Id;
   proposalflight.flightbudget__c = 100;
   proposalflight.flightstartdate__c = system.today();
   proposalflight.flightenddate__c = system.today()+60;
   proposalflight.approvalstatus__c = 'Not Submitted';
   proposalflight.versiontype__c = 'Master Terms';
   insert proposalflight;
   
ProcessInstance processInstance = new ProcessInstance();
    processInstance.TargetObjectID = opportunity.ID;
    processInstance.Status = 'Pending';
    insert processInstance;
    
ProcessInstanceStep piStep = new ProcessInstanceStep();
    piStep.StepStatus = 'Approved';
    piStep.ProcessInstanceID = processInstance.ID;
    piStep.ActorId = '00570000001ups6';

//cause trigger to fire    
    Test.startTest();
    insert piStep;
    Test.stopTest();
    system.debug('*********Approver IDs***********' + opportunity.ProposalApprovers__c);
    
//Validate that the Opportunity Flight Approval Status was updated
    List<Opportunity> oppList = [SELECT id, approvalstatus__c FROM Opportunity WHERE id =:opportunity.id];
    System.assertequals('Approved', oppList[0].approvalStatus__c);
   
//Validate that the Proposal Flight Approval Status was updated
    List<ProposalFlight__c> pfList = [SELECT id, approvalstatus__c FROM ProposalFlight__c WHERE id = :proposalflight.id];
    System.assertequals('Approved',pfList[0].approvalstatus__c);   
   }
   }

 

Error Message:

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ProcessDefinitionId, CurrentNodeId]: [ProcessDefinitionId, CurrentNodeId]Class.Test_TagSalesPlanner.testTagSalesPlanner: line 45, column 1

 

 

Is it possible to make multi-radio buttons alignment like displayed in the following link. I would like to display questions as multi-radio buttons in a visualforce page. The questions should be displayed without titles, and only one header for all the questions.  

 

Link to the image: https://docs.google.com/open?id=0B5RulK-LtShFcTVueDZfUXJqWTA

 

Thanks for help,

 

All the bet,

 

Anzar.

 

 

 

We have a custom object that has a description field of type "text".

 

Requirement is to manage translations of the value of the description field.

 

Only options that comes to my mind are

 

Option 1

- Create a new custom object with may be master-detail relationship, to track the translations of the field values. Pros - new translations can be added without any issue.

 

Option 2

- Create new custom fields for each of the languages that the original value needs to be translated in. Basically add description_fr, description_sp fields. Obviously, the downside of this approach is that if there is new language tomorrow then it will require schema change.

 

Question

1. Does Salesforce provides out-of-box way to manage translations? Translation Bench seems to work with UI elements and not with values.

2. Are there any other options?

 

Thanks

Hello everyone,

I am seeking some help and advice regarding email templates.

Our ORG currently is configured with Accounts >> Opportunities >> Opportunity Line Items (multiple "items" per opp is possible).

What I'm trying to accomplish is:

Pull Account Information, Pull Opportunity Information, BUT ALSO pull Opportunity Line Items for an email template.

Currently, if I send an email template from the opportunity object, it only pulls account and opportunity information.

Anyone have the same problem?  I've tried using VF/APEX templates but I'm pretty new to that.

Please help.

Thanks
I'm merging in product line items into a visualforce template and I'd like the products to sort the same way they are in the Opportunity. Does anyone know how to do this? Here is my code..

Thanks, Chris
Code:
<messaging:emailTemplate subject="Product Quote" recipientType="Contact" relatedToType="Opportunity">
<messaging:htmlEmailBody >       
<html>
        <body>
         <STYLE type="text/css">
               Body {font-size: 11px; font-face: verdana } 
               TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center } 
               TD  {font-size: 11px; font-face: verdana } 
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
             <font face="arial" size="2">
 <p>Dear {!recipient.name},</p>
         <table border="0" >
                 <tr > 
                     <th>Product Name</th><th>Quantity</th><th>Total Price</th><th>Monthly Fee</th>
                  </tr>
  <apex:repeat var="oli" value="{!relatedTo.OpportunityLineItems}">
       <tr>
           <td>{!oli.PricebookEntry.Product2.Name}</td>
           <td>{!oli.Quantity}</td>
           <td>${!oli.TotalPrice}</td>
           <td>${!oli.Extended_Monthly_Fee__c}</td>
       </tr>
 </apex:repeat> 


    </table>
    <p>
<apex:repeat var="opp" value="{!relatedTo}">
<p>
Total Subscription fees: ${!opp.X1St_Yr_ACV_Subscript__c}<br>
Total Services fees: ${!opp.Professional_Services__c}<br>
</p>
 </apex:repeat>     
    
    <p>
        Please contact me with any questions,
<apex:repeat var="o" value="{!relatedTo.Owner}">
<p>
{!o.Name}<br>
{!o.CompanyName}<br>
{!o.Phone}<br>
<a href="mailto:{!o.Email}">{!o.Email}</a><br>
</p>
 </apex:repeat> 
       <p />
 </font>
        </body>
    </html>


</messaging:htmlEmailBody>       
</messaging:emailTemplate>

 

  • November 19, 2008
  • Like
  • 0
 
     We are having two Lists of check box groups which are displayed in two pageblocksections> our requirement is to display the two groups in two columns.The code is like this
                        <apex:pageblockSection title="Rules" columns="0">
                        <apex:selectCheckboxes value="{!selectedRules}">
                                <apex:selectOptions value="{!rules}"/><br/>
                        </apex:selectCheckboxes><br/>
                                   </apex:pageblockSection>
                       
                 <apex:pageblockSection title="Agents">
                    <apex:selectCheckboxes value="{!selectedAgents}">
                            <apex:selectOptions value="{!agents}"/><br/></p>
                    </apex:selectCheckboxes><br/></p>
                   </apex:pageblockSection>
    Could any one suggest on how to align these two as two columns in a pageblock?
 
 
 
 
 
 
  
I am trying to automatically submit a record for approval in a visualforce page but hitting some problems.  I tried following the Apex Approval Processing example (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_example.htm) but I get this error:

Code:
System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval 
process found.

 
So I thought I needed to create a ProcessInstance but trying to insert this results in:

Code:
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, 
Required fields are missing: [ProcessDefinitionId, CurrentNodeId]: [ProcessDefinitionId, CurrentNodeId]

 
I have set up an approval process for my custom object and it is active so that doesn't seem to be the problem.  This is a controller extension for my VF page and the 'record' variable is the object that has been passed into the page.  Here is my function that uses the submit for approval :

Code:
public void SubmitApproval()
    {
/* Attempting to set up a ProcessInstance
ProcessInstance approvalProcess = new ProcessInstance(); approvalProcess.TargetObjectId = record.Id; //approvalProcess.ProcessDefinitionId = ; approvalProcess.Status = 'Started'; //approvalProcess.CurrentNodeId = ; //insert approvalProcess;
*/

// Create an approval request
  Approval.ProcessSubmitRequest approvalRequest = new Approval.ProcessSubmitRequest(); approvalRequest.setComments('Testing Approval Submit'); approvalRequest.setObjectId(record.Id); Approval.ProcessResult approvalResult = Approval.process(approvalRequest); if (!approvalResult.isSuccess()) { ApexPages.Message error = new ApexPages.Message(ApexPages.Severity.ERROR, 'There was an error with the Submit For Approval Request.'); ApexPages.addMessage(error); } }

 
Edit:  Just a quick update.  If I submit the record for approval using the normal way I can then create a commandButton that approves the pending request.  This approval doesn't run into any problems at all.  I must be missing something from my Submit request.






Message Edited by XactiumBen on 06-24-2008 03:21 AM

Message Edited by XactiumBen on 06-24-2008 03:50 AM