function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Maksym MarshaliukMaksym Marshaliuk 

Football score extracting numbers

I have text field 'Score__c' which defines Score of footbal match. Like '1:2'. I need co create validation rule named 'Validate scores in Score__c cannot be negative numbers (even though represented as a string)'. I stuck on a problem because i dont know how can i extract first number and compare is with second. 
Best Answer chosen by Maksym Marshaliuk
PriyaPriya (Salesforce Developers) 
Hi Maksym,

One approach can be checking the '-' sign in validation rule. If the field value contain '-', then give the error message. 

so try like this :-
Error Condition Formula
	CONTAINS( Score__c ,'-')

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan