You need to sign in to do that
Don't have an account?
Rabbani sayyed 8
Hi all, I need a validation rule where field can allow only primary numbers? is it possible with trigger ? if yes any sample code for this? or is this possible with config only? if yes any idea
Hi all, I need a validation rule where field can allow only primary numbers? is it possible with trigger ? if yes any sample code for this? or is this possible with config only? if yes any idea
public void prime(){
for(integer i=1;i<=100;i++)
{
integer count=0;
for(integer j=i; j>=1;j--)
{
if(math.mod(i,j)==0 )
{
count++;
}
}
if(count==2 || count==1){
system.debug(i);
}
else{
//system.debug('not prime');
}
}
}