You need to sign in to do that
Don't have an account?
Linda 98
VALIDATE input text field value given by USER--URGENT
Hi
I am trying to validate the input text field given by user if it contains 'test' in its name.If so then when user clicks save button,record has to be saved by getting data from existing record on which button is clicked and clone the record(Not all fields.Some fields should be different)
If the userinput doesnt contain 'test ' then itt haas to show an error saying to enter corrrect name when he clicks on 'save'.
Please suggest some way .
I am not able to get ID of record on which VF page is opened.
Please help.Need this ASAP!!!!
I am trying to validate the input text field given by user if it contains 'test' in its name.If so then when user clicks save button,record has to be saved by getting data from existing record on which button is clicked and clone the record(Not all fields.Some fields should be different)
If the userinput doesnt contain 'test ' then itt haas to show an error saying to enter corrrect name when he clicks on 'save'.
Please suggest some way .
I am not able to get ID of record on which VF page is opened.
Please help.Need this ASAP!!!!
<apex:inputText id="testInp" value="{!attribute_value}" />
and you have a save button like this
<apex:commandButton value="Save" onclick="myJavascript();return false;" />
Javascript function:
function myJavascript(){
var val = document.getElementById("testInp").value;
if(val != ""){
if(val.indexOf("test") == -1){
alert("please enter the correct value");
}else{
// call your action function here
}
}
}
Additionally please note that if the id of the input element might be different. Please refer to the generated HTML and put the correct id otherwise document.getElementById() function will fail.
Please let me know if this helps.
If not then please post some code so taht we get a better undertsanding of your problem.
Thanks,
Kaustav
You need to use $Component.Path.to.Id in JavaScript
Sample Code:
https://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global_component.htm
/Raghu
Thanks,
Kaustav
I have done some modifications. Please refer to the inline comments. If this does not help you then please post your page and specify the location from which you are clicking the button. That is whether the button is present on the detail page of case record or the button is present in some other VF page.
Please let me know if you have further doubts.
Thanks,
Kaustav
1.I am trying to assign the case to queue with certain name.
So i did something liek this
group g= select id from group where name='test';
and newcaseownerid=g.id;
.
.
.
.
.
.then insert newcase;
Ownerid is not being populated.
2.As per my awareness,i think soql is not case sensitive.But it is only checking if i give the exact name.
For instance.:
i gave like this:
TeSt owner
But owner name is like this: TESt Owner
I get error saying invalid owner name.
It fetcheds record if i give TESt Owner only.
please help !
In salesforce go to setup - Manage Users - Queue - click to view the details of the required queue.
In the details page you will see a field called Queue Name.
Now let us consider the Queue Name value is 'Test Queue'
Using this value form the query like this
Group qGrp = new Group();
gGrp = [SELECT Id, Name FROM Group WHERE Type = 'Queue' AND DeveloperName = 'Test Queue' LIMIT 1];
This should give you the desired queue name.
As for the second issue, you are correct, in salesforce the value in the where clause do not need to match the exact case.
Can you please post your apex code so that we can check if there is anything else that is missing?
Thanks,
Kaustav
I am not able to update The new case owner id to queue id.
case newcase =new case;
newcase.Ownerid=gGrp.id;
insert newcase;
this doesnt work:(
2.I found out my issue...I am able to get my soql but issue is the point where i am checking if my user input exists in the list .
Here is my code:Please help me ASAP..Please..i need this done asap...
I have tried to recreate your requirement in my developer org.
Controller:
VF Page:
Thanks,
Kaustav