• ali-kantar1.3897183320927883E12
  • NEWBIE
  • 20 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
<apex:page controller="worldcup">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!wc.Name}"/>
<apex:inputField value="{!wc.who_is_going_to_win__c}"/>
<apex:commandButton action="!{Save}" value="save"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

this is my VF page and the method i have used is :

public class worldcup {

    public worldcup() {

    }

public WorldCup__c wc;

public worldcup (ApexPages.StandardController controller) {
this.wc = (WorldCup__c)Controller.getRecord();
}

public WorldCup__c getwc(){
    return wc;
    }
   
    Public PageReference save(){
   
   WorldCup__c wc=[Select id,Name, who_is_going_to_win__c From WorldCup__c];
  
   upsert wc;
    return null;
    }

}

after i submitted a record on the VF page i recieved an error saying Formula Expression is required on the action attributes. am i missing the save attribute ? 
i have written this method but it keeps giving me this error :
Error: Compile Error: Variable does not exist: childOpps at line 14 column 23

public class StandardControllerExtension {
Account acct;
public StandardControllerExtension (ApexPages.standardController std)
{
acct = (Account)std.getRecord();
}
public List<Opportunity> getChildOpps() {
return [Select Name, Amount, StageName, CloseDate From Opportunity
Where AccountId = :acct.Id
and (IsWon = true or IsClosed = false)];
}
private void createTaskOnChildOpps () {
List<Task> tasksToInsert = new List<Task> ();
for (Opportunity opp : childOpps) {
if (!opp.isClosed) {
tasksToInsert.add (
new Task(
WhatId = Opp.Id,
OwnerId = opp.OwnerId,
ActivityDate =Date.today () + 3,
Status = 'Not Started',
Subject = 'Send follow-up email to pirmary contact'
)
);
}
}
if (tasksToInsert.size() >0 )insert taskToInsert;
}
public PageReference save() {
if (acct.Rating =='Hot') {
createTaskOnChildOpps();
}
update acct;
return new PageReference ('/' + acct.Id);
}
}

can anyone help me with this ? 
<apex:page controller="worldcup">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!wc.Name}"/>
<apex:inputField value="{!wc.who_is_going_to_win__c}"/>
<apex:commandButton action="!{Save}" value="save"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

this is my VF page and the method i have used is :

public class worldcup {

    public worldcup() {

    }

public WorldCup__c wc;

public worldcup (ApexPages.StandardController controller) {
this.wc = (WorldCup__c)Controller.getRecord();
}

public WorldCup__c getwc(){
    return wc;
    }
   
    Public PageReference save(){
   
   WorldCup__c wc=[Select id,Name, who_is_going_to_win__c From WorldCup__c];
  
   upsert wc;
    return null;
    }

}

after i submitted a record on the VF page i recieved an error saying Formula Expression is required on the action attributes. am i missing the save attribute ? 
i have written this method but it keeps giving me this error :
Error: Compile Error: Variable does not exist: childOpps at line 14 column 23

public class StandardControllerExtension {
Account acct;
public StandardControllerExtension (ApexPages.standardController std)
{
acct = (Account)std.getRecord();
}
public List<Opportunity> getChildOpps() {
return [Select Name, Amount, StageName, CloseDate From Opportunity
Where AccountId = :acct.Id
and (IsWon = true or IsClosed = false)];
}
private void createTaskOnChildOpps () {
List<Task> tasksToInsert = new List<Task> ();
for (Opportunity opp : childOpps) {
if (!opp.isClosed) {
tasksToInsert.add (
new Task(
WhatId = Opp.Id,
OwnerId = opp.OwnerId,
ActivityDate =Date.today () + 3,
Status = 'Not Started',
Subject = 'Send follow-up email to pirmary contact'
)
);
}
}
if (tasksToInsert.size() >0 )insert taskToInsert;
}
public PageReference save() {
if (acct.Rating =='Hot') {
createTaskOnChildOpps();
}
update acct;
return new PageReference ('/' + acct.Id);
}
}

can anyone help me with this ?