• paulo.orquillo
  • NEWBIE
  • 25 Points
  • Member since 2010

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

I'm trying to customize the controller I found here, but I keep geting the error message on Line 25-

 

Multiple markers at this line

- Save error: expecting a left angle bracket, found

'todelete'

- expecting a left angle bracket, found 'todelete'

 

" public list todelete = newlist();"

 

Here's the whole controller-

 

public class AccountsController {

/* I set the Account and Case Objects
here for use through out the code*/
public Account acct { get; private set;}
public Case[] caseItems { get; private set; }
private ApexPages.StandardController controller;

// constructor, loads the Account and
// any cases associated with it

void caseItems(id id) {
acct = [SELECT Id, Name, Type, AccountNumber, Site,
      (SELECT Id, CaseNumber, Status, Reason,Origin,
      Subject FROM Cases) FROM Account
      where id = :id limit 1];
//Hook caseItems to the query above
 caseItems = acct.Cases;
}

//Define the id
id accountid;

/* A List Method to delete the Cases assigned*/
public list todelete = new list();

public AccountsController (ApexPages.StandardController c)
{
/* this will kickoff you main page */
controller = c;
/* to get this current Account Id*/
accountid = c.getRecord().id;
/*kick off the init() function*/
init();
}
public AccountsController () {
accountid =
ApexPages.CurrentPage().getParameters().get('id');

init();

}

void init() {
/* load up Cases
basically we defined caseitems up on top, so
when the page loads then caseItems(accountId)
will go through the query and list out the
Items assoicated with it */
caseItems(accountid);  
}

public PageReference save() {
try {
upsert caseItems;
if ( todelete.size() > 0 ) {           
delete todelete;   
}
caseItems(acct.id);
}
catch ( DmlException exc) {
      ApexPages.addMessages(exc);
      return null;
}
return null;
}


/* your Delete functionality*/
public PageReference del() {

string delname = ApexPages.CurrentPage().getParameters().get('delname');
system.assert( delname != null );
integer gone = -1;
integer i = 0; 

for ( i=0; i< caseItems.size(); i++ ) { 
if (caseItems[i].CaseNumber== delname) { 
gone = i;
} 
}
if ( gone >= 0) { 
todelete.add(caseItems.remove(gone) ); 
}
return null;
}

public PageReference add() {
// insert a new line, after user clicks Add
Case cs =  new Case(
AccountId = acct.id,
Subject = 'hello', Status = 'Low',
Reason = 'Other',Origin='Low'
);
caseItems.add ( cs );
return null;
 }
}

 How do I fix this?  I have a limited understanding of APEX!

  • February 08, 2013
  • Like
  • 0

Hi Folks,

 

Need some input on the issue. I have this issue currently happening on two sfdc accounts with 2 different types of callouts to specific web services. Both are REST.

 

Error on both.

 

EXCEPTION_THROWN|[27]|System.CalloutException: Read timed out

 

One is a PHP app webservice and another one is a Java app webservice.

 

Both are working fine when accessed directly through the browser or another client, except for SFDC. Both SFDC apps stopped working at exactly the same time today. 

 

Anyone else experiencing the same issue? 

 

Thanks,

Paulo

 

 

Hi,

 

Is there a way to retrieve the Routing Address(FromAddress) from the Email2Case functionality?

 

If we have multiple Email2Case I would like to check if the Case created was created with which routing address.

 

Thanks,

Paulo

Hi, I have created  trialforce for our application, but the Help & Training link goes to the login screen with error

 

You have attempted to access a page that requires a salesforce.com login. If you are already a user of the system, please login below.

 

Can the Help & Training link be enabled on a trialforce?

 

TIA, 

Paulo

Hi newbie here and have already read alot and researched on the topic before posting but need more help for straight forward response.

 

I've created a wizard for a custom object for creating new records.  If I dont use the wizard and use the platform I can create a new record with all the validations I made working- they appear on the field being validated. But when I create my wizard I'm not getting any validation errors next to the field, it only displays the error in field for required.

 

eg. I have a validation rule that checks a birthdate to make sure user is above 15 years old.

 

If I try to save my record I then get an error.

 

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must be 15 yrs old or older.: [Birth_Date__c]

 

I appreciate any tips and suggestions for the proper approach to take.

HI..

 

I am trying to write a custom button with Onclick javascript..

 

On click of button on OpportunityLineItem i want value from my custom field to be copied to standard field(Unit price) 

 

Here is my code...

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

Var OppId={!GETRECORDIDS( $ObjectType.OpportunityLineItem )};

var Opp = new sforce.SObject("OpportunityLineItem");
Opp.Id = OppId ;
Opp.UnitPrice = "{!OpportunityLineItem.Customfield__c }",replace ',' -->;
updateRecords.push(Opp);
result = sforce.connection.update(updateRecords);

 

 

I get Unexpected identifier when i click on the button...

 

Please help

 

Thanks

Hi Folks,

 

Need some input on the issue. I have this issue currently happening on two sfdc accounts with 2 different types of callouts to specific web services. Both are REST.

 

Error on both.

 

EXCEPTION_THROWN|[27]|System.CalloutException: Read timed out

 

One is a PHP app webservice and another one is a Java app webservice.

 

Both are working fine when accessed directly through the browser or another client, except for SFDC. Both SFDC apps stopped working at exactly the same time today. 

 

Anyone else experiencing the same issue? 

 

Thanks,

Paulo

 

 

Hi All,

I am trying to get the count() of a particular set of accounts based on the search criteria. In the controller everything looks good and also in the debug logs , I am getting the desired outputs. The problem is when I try fetching the aggregate result in the page, I am getting the following error : Unknown property 'String.inti'

 

I am posting my code hereby,

 

page:

<apex:page controller="accountSearch">
<script>
function information()
{
method1();
alert('ddd');
var pbs1=true;
alert(pbs1);
}
</script>
<apex:form >
<apex:pageBlock >
<apex:outputLabel value="Enter your search text:" >
<apex:inputText value="{!searchVar}">
</apex:inputText>
</apex:outputLabel>
<apex:commandLink value="Search" action="{!getAccounts}" />


<apex:pageBlockTable value="{!accList}" var="acc" rendered="{!IF(count,true,false)}" >
<apex:column headerValue="Account Name">
<apex:commandLink action="{!getID}" value="{!acc.name}">
<apex:param name="var1" value="{!acc.id}"/>
</apex:commandLink>
</apex:column>
</apex:pageBlockTable>

<apex:dataTable value="{!wrapList}" var="wrp" rendered="{!IF(count,true,false)}" border="1" >
<apex:column >
<apex:facet name="header">Count:</apex:facet>
<apex:outputText value="{!wrp.inti}"></apex:outputText>
</apex:column>
</apex:dataTable>

<apex:actionFunction name="method1" action="{!method1Action}"/>

<apex:pageBlockSection title="Account Information" rendered="{!IF(op1,true,false)}" collapsible="false" onclick="information()">
<apex:outputPanel rendered="{!IF(pbs1,true,false)}">
<apex:repeat value="{!selectedAccount}" var="selectedAcc" >
<td>
<tr>
<apex:pageBlockSection >
<apex:outputField value="{!selectedAcc.Name}"></apex:outputField>
</apex:pageBlockSection>
</tr>
</td>
</apex:repeat>

</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller :

public with sharing class accountSearch {


public String olId { get; set; }
public String searchVar { get; set; }
public String var;
public String var1{get;set;}
public Account selectedAccount{get;set;}
public list<Account> accList = new list<Account>();
public boolean op1=false;
public boolean pbs1=false;
public boolean count=false;
public list<wrapClass>wrapList = new list<wrapClass>();
public list<AggregateResult> agr = new list<AggregateResult>();

public PageReference getAccounts() {
var='%'+searchVar+'%';
system.debug('aaaaaaaaaaaa'+var);
accList = [Select id,name,NumberOfEmployees from account where name LIKE:var ];
system.debug('vvvvv'+accList);
count=true;
getResult();
system.debug('ddddddddddddddddd');
return null;
}

public list<wrapClass> getResult()
{
agr=[Select name,Count(id) quantity from Account where id IN : accList GROUP BY name ];
system.debug('ccccccccccc'+agr);
String str='';
for(AggregateResult a:agr)
{
str +=a.get('quantity');
system.debug('nnnnnnnn'+str);
wrapList.add(new wrapClass(str)); ---here I am adding string to the wrapper class list
}
system.debug('rrrrrrrrrrr'+wrapList);
return wrapList;
}

public list<Account> getAccList(){
return accList;
}
public String getID()
{
String strId = apexpages.currentpage().getparameters().get('var1');
system.debug('lllllllllll'+strId);
selectedAccount=[Select name,OwnerId,Site,AccountSource,AnnualRevenue,NumberOfEmployees,Fax,Industry,Ownership,Phone,Rating,Type from Account
where id=:strId];
op1=true;
pbs1=false;
return null ;
}
public String getWrapList() {
return null ;
}

public String getWrp(){
return null;
}


public Boolean getOp1()
{
return op1;
}

public void setOp1(Boolean abc)
{
this.op1=abc;
}
public Boolean getPbs1()
{
return pbs1;
}

public void setPbs1(Boolean abc)
{
this.pbs1=abc;
}
public void method1Action()
{
pbs1=true;
}
public Boolean getCount()
{
return count;
}

public void setcount(Boolean abc)
{
this.count=abc;
}

public class wrapClass{
public wrapClass wrp{get;set;}
public String inti{get;set;}
public wrapClass(String agg
{
inti=agg;
system.debug('ssssssssss'+inti);
}
}
}

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

I am not sure as of why I am getting this error :  Unknown property 'String.inti' . Am I missing something?

 

 

 

Please help.

 

Cheers!!

  • April 28, 2013
  • Like
  • 0

I'm trying to customize the controller I found here, but I keep geting the error message on Line 25-

 

Multiple markers at this line

- Save error: expecting a left angle bracket, found

'todelete'

- expecting a left angle bracket, found 'todelete'

 

" public list todelete = newlist();"

 

Here's the whole controller-

 

public class AccountsController {

/* I set the Account and Case Objects
here for use through out the code*/
public Account acct { get; private set;}
public Case[] caseItems { get; private set; }
private ApexPages.StandardController controller;

// constructor, loads the Account and
// any cases associated with it

void caseItems(id id) {
acct = [SELECT Id, Name, Type, AccountNumber, Site,
      (SELECT Id, CaseNumber, Status, Reason,Origin,
      Subject FROM Cases) FROM Account
      where id = :id limit 1];
//Hook caseItems to the query above
 caseItems = acct.Cases;
}

//Define the id
id accountid;

/* A List Method to delete the Cases assigned*/
public list todelete = new list();

public AccountsController (ApexPages.StandardController c)
{
/* this will kickoff you main page */
controller = c;
/* to get this current Account Id*/
accountid = c.getRecord().id;
/*kick off the init() function*/
init();
}
public AccountsController () {
accountid =
ApexPages.CurrentPage().getParameters().get('id');

init();

}

void init() {
/* load up Cases
basically we defined caseitems up on top, so
when the page loads then caseItems(accountId)
will go through the query and list out the
Items assoicated with it */
caseItems(accountid);  
}

public PageReference save() {
try {
upsert caseItems;
if ( todelete.size() > 0 ) {           
delete todelete;   
}
caseItems(acct.id);
}
catch ( DmlException exc) {
      ApexPages.addMessages(exc);
      return null;
}
return null;
}


/* your Delete functionality*/
public PageReference del() {

string delname = ApexPages.CurrentPage().getParameters().get('delname');
system.assert( delname != null );
integer gone = -1;
integer i = 0; 

for ( i=0; i< caseItems.size(); i++ ) { 
if (caseItems[i].CaseNumber== delname) { 
gone = i;
} 
}
if ( gone >= 0) { 
todelete.add(caseItems.remove(gone) ); 
}
return null;
}

public PageReference add() {
// insert a new line, after user clicks Add
Case cs =  new Case(
AccountId = acct.id,
Subject = 'hello', Status = 'Low',
Reason = 'Other',Origin='Low'
);
caseItems.add ( cs );
return null;
 }
}

 How do I fix this?  I have a limited understanding of APEX!

  • February 08, 2013
  • Like
  • 0

Problem:- if i assign my user to a queue and then i want when new record is created for my object ( let it be Incident having field which has lookup on User) a field (let name it "Queue") should get autopopulated, how this can be acheived if i don't want to write trigger,

I am currently using two objects in the picture 

 

Account & Case

 

 

Account has a field Time_Zone__c which is a picklist with values EST , PST , CST ,MST

 

Case also has the same field Time_Zone__c

 

I have written trigger on case  which pulls the TimeZone automatically based on the Account Field.

 

Till here no issues

 

I have one more Field Client _Date__c(Date/Time) on Case which takes the same value as Created Date 

 

I have done this by just giving

 

Client_Date__c=System.Now()

 

 

My main issue is 

 

The Client_Date__c is taking the time zone of the created by user .But I want this to get updated based  on Time Zone field  on Case which is pulled from  Account 

 

 

I wanted to check out Juno and see if it had anything interesting to offer. I added a SalesForce project and successfully pulled everything down, but the next time I try to do something that requires a connection to the server, I get an error:

 

Unable to connect to organization with given login credentials.
Invalid username, password, security token; or user locked out.

 

I go into the project properties and my token and password are gone. I put them in again, click apply, ok, and choose Yes to refetch everything. The refetch works but when I go back into project properties the password and token are blank again. 

 

Any ideas?
Thanks,
Mikey

I have implemented a set of Apex triggers to automatically mark case milestones as complete when a case has an initial 'Send an Email' or 'Log a Call' has been done.  This all works fine.

 

However, I have an additional use case to un-complete case milestones when a case is re-opened.  Right now the last case milestone is marked as complete when a case is closed.  So in the event that a case is re-opened (Case.Status != 'Closed') the last case milestone should be marked as incomplete.  However when this happens in the context of a before update or after update trigger an exception is thrown because the entitlement process for the case hasn't completely exited.

 

When a case is re-opened the 'Entitlement Process End Time' is set to null and the case milestones can be edited manually.  So, I suspect that the scope of the transaction to set the case milestone to incomplete is being submitted with the setting of the end time to null.  Which means the case has still already exited the entitlement process when the trigger is trying update the milestone.

 

Here is snippet of the code from the on Case (after update):

 

trigger OpenMilestoneOnReopenCase on Case (after update) 
{
// The final resolution case milestone type's name is Final Resolution Time
	String finalResolutionCaseMilestoneName = 'Final Resolution Time';
	if (inDebugMode) System.Debug('OpenMilestoneOnReopenCase: finalResolutionCaseMilestoneName is ' + finalResolutionCaseMilestoneName);
    
   for (Case cas: Trigger.new)
    {
    	// If the case is being closed then exit
    	if (cas.Status == 'Closed')
    	{
    		continue;
    	}
    	
    	// Get each case milestone for the case
    	CaseMilestone[] caseMilestones = CaseHelpers.GetCaseMilestones(cas.Id);
    	for (CaseMilestone caseMilestone : caseMilestones)
    	{	
    		// If the case milestone is already incomplete then skip it because we only want to reopen completed milestones
    		if (caseMilestone.IsCompleted == false)
    		{
    			continue;
    		}
    		
    		// Get the milestone type so we can check to see if it's the final resolution case milestone
    		MilestoneType milestoneType = CaseHelpers.GetMilestoneType(caseMilestone.MilestoneTypeId);
			
		// Check to see if this case milestone type is the first final resolution milestone
		if (milestoneType.Name == finalResolutionCaseMilestoneName)
			{
				// Check to see if the final resolution case milestone is complete
				if (caseMilestone.IsCompleted == true)
				{
					// If it's complete then mark it as incomplete by nulling out the completion date
					// after nulling out the entitlement process end time
					caseMilestone.CompletionDate = NULL;
					database.update(caseMilestone);
				}

			}
    	}	
    }
}

 

I am interested in knowing if anyone can confirm my suspicions about the scope of the update transaction.  And if there any suggestions to managing the exit of the process and the setting of a case milestone as incomplete.

 

Doug

 

 

Hi newbie here and have already read alot and researched on the topic before posting but need more help for straight forward response.

 

I've created a wizard for a custom object for creating new records.  If I dont use the wizard and use the platform I can create a new record with all the validations I made working- they appear on the field being validated. But when I create my wizard I'm not getting any validation errors next to the field, it only displays the error in field for required.

 

eg. I have a validation rule that checks a birthdate to make sure user is above 15 years old.

 

If I try to save my record I then get an error.

 

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must be 15 yrs old or older.: [Birth_Date__c]

 

I appreciate any tips and suggestions for the proper approach to take.

I have a simple VisualForce window that works fine in my DE org.  It is basically a shell that passes context via {!} expressions to a Flex swf file.  Here is the source in the DE org:

 

<apex:page standardController="A_R_Summary__c" sidebar="true" showHeader="true">
   
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="SliderGraphic" width="100%" height="100%"
          codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="{!$Resource.SliderGraphic}" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#869ca7" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="flashVars" value="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}" />
    <embed src="{!$Resource.SliderGraphic}"
           width="100%"
           height="300"
           quality="high"
           bgcolor="#869ca7"
           name="SliderGraphic"
           align="middle"
           play="true"
           loop="false"
           quality="high"
           allowScriptAccess="sameDomain"
           type="application/x-shockwave-flash"
           pluginspage="https://www.adobe.com/go/getflashplayer"
           flashVars="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}">
    </embed>
  </object>
</apex:page>

 

Problems occur when I install it in another org.  The controller reference is updated with the namespace, but the {!} references are not.  The page cannot render and generates the error:


Unknown property 'testdfc1__A_R_Summary__cStandardController.A_R_Summary__c'

Here is the page in the installer org:

 

<apex:page standardController="testdfc1__A_R_Summary__c" sidebar="true" showHeader="true">



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="SliderGraphic" width="100%" height="100%"

codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

<param name="movie" value="{!$Resource.SliderGraphic}" />

<param name="quality" value="high" />

<param name="bgcolor" value="#869ca7" />

<param name="allowScriptAccess" value="sameDomain" />

<param name="flashVars" value="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}" />

<embed src="{!$Resource.SliderGraphic}"

width="100%"

height="300"

quality="high"

bgcolor="#869ca7"

name="SliderGraphic"

align="middle"

play="true"

loop="false"

quality="high"

allowScriptAccess="sameDomain"

type="application/x-shockwave-flash"

pluginspage="https://www.adobe.com/go/getflashplayer"

flashVars="arId={!A_R_Summary__c.account__r.id}&arDate={!A_R_Summary__c.Date__c}&accountId={!A_R_Summary__c.id}">

</embed>



</object>



</apex:page>

 

 

As you can see, the controller attribute is updated to include the namespace, but the other references are not.  If I attempt to manually prefix these {!} references in the DE org with the namespace, I cannot save the file.

 

Can someone help me?  Thanks!

 

Dave

 

  • May 12, 2009
  • Like
  • 0