• vivekjain
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I am trying to write an trigger for a fomula calculation as it is hitting the character limits.

 

Formula is:

Value(CASE( LEN( text( Area_Range__c ) ), 5, Left(text(Area_Range__c ), 1), 6, Left(text(Area_Range__c ), 1), 7, Left(text(Area_Range__c ), 2), 8, Left(text(Area_Range__c ), 2), 9, Left(text(Area_Range__c ), 3), 10, Left(text(Area_Range__c ), 3), 11, Left(text(Area_Range__c ), 4), 12, Left(text(Area_Range__c ), 4), 13, Left(text(Area_Range__c ), 5), 14, "0", 15, "50000", 16, "750","0"))

 now the trigger is something like this

trigger PropertyValue on Property__c (before insert, before update) {

    Property__c thisProp;
    {
    for(Property__c prop: Trigger.New)
    
  {
  	list<Property__c> propNew=[select id, test_1__c, Budget_Range__c from Property__c];
  	 {
  	 	    if(propNew.Budget__c=='ABC')
    	
    {
				prop.test_1__c = CASE( LEN( text( prop.Budget_Range__c ) ), 5, Left(text(prop.Budget_Range__c ), 1), 6, Left(text(prop.Budget_Range__c ), 1), 7, Left(text(prop.Budget_Range__c ), 2), 8, Left(text(prop.Budget_Range__c ), 2), 9, Left(text(prop.Budget_Range__c ), 3), 10, Left(text(prop.Budget_Range__c ), 3), 11, Left(text(prop.Budget_Range__c ), 4), 12, Left(text(prop.Budget_Range__c ), 4), 13, Left(text(prop.Budget_Range__c ), 5));
			    
			}

}
}
    }
}

 It is giving error 

Save error: Method does not exist or incorrect signature: text(String) PropertyValue.trigger /src/triggers line 13 Force.com save problem

I am trying to write an trigger for a fomula calculation as it is hitting the character limits.

 

Formula is:

Value(CASE( LEN( text( Area_Range__c ) ), 5, Left(text(Area_Range__c ), 1), 6, Left(text(Area_Range__c ), 1), 7, Left(text(Area_Range__c ), 2), 8, Left(text(Area_Range__c ), 2), 9, Left(text(Area_Range__c ), 3), 10, Left(text(Area_Range__c ), 3), 11, Left(text(Area_Range__c ), 4), 12, Left(text(Area_Range__c ), 4), 13, Left(text(Area_Range__c ), 5), 14, "0", 15, "50000", 16, "750","0"))

 now the trigger is something like this

trigger PropertyValue on Property__c (before insert, before update) {

    Property__c thisProp;
    {
    for(Property__c prop: Trigger.New)
    
  {
  	list<Property__c> propNew=[select id, test_1__c, Budget_Range__c from Property__c];
  	 {
  	 	    if(propNew.Budget__c=='ABC')
    	
    {
				prop.test_1__c = CASE( LEN( text( prop.Budget_Range__c ) ), 5, Left(text(prop.Budget_Range__c ), 1), 6, Left(text(prop.Budget_Range__c ), 1), 7, Left(text(prop.Budget_Range__c ), 2), 8, Left(text(prop.Budget_Range__c ), 2), 9, Left(text(prop.Budget_Range__c ), 3), 10, Left(text(prop.Budget_Range__c ), 3), 11, Left(text(prop.Budget_Range__c ), 4), 12, Left(text(prop.Budget_Range__c ), 4), 13, Left(text(prop.Budget_Range__c ), 5));
			    
			}

}
}
    }
}

 It is giving error 

Save error: Method does not exist or incorrect signature: text(String) PropertyValue.trigger /src/triggers line 13 Force.com save problem