You need to sign in to do that
Don't have an account?
sfg1
Bypass validation rule using Javascript
I have made 3 fields required using validation rule.I have javascript button for closing case. When these 3 fields are null and if i try to close the case by clicking on javascript button, I am not able to close the case.
Now my requirement is either it should bypass the validation or populate 3 field values once i click on the javascript button.Please guide me in this.
Now my requirement is either it should bypass the validation or populate 3 field values once i click on the javascript button.Please guide me in this.
Can you share your javascript button code.
Thanks,
Vishal
1. you can use before update trigger to auto populate these values
2. On button click, by using id you can access those fields and auto populate the default values.
i am trying to close the Case as duplicate using javascript button.Now my requirement is before closing the case i need to fill 3 Date/time required fields Case Assigned,Workaround Provided and Restored.Please find my code.
{!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")}
{!requireScript("/soap/ajax/19.0/function.js")}
{!requireScript("/soap/ajax/19.0/apex.js")}
var URL1 = "/apex/closeCaseAsDuplicate?arun_id={!Case.Id}";
var URL2 = "/{!Case.Id}";
if( {!ISPICKVAL(Case.Status , 'Closed')} )
{
alert('The Case you wish to Close As Duplicate is already Closed! Please choose a different case to close.');
}
else
{
if(confirm('You are about to Close this Case As a Duplicate - Are you sure?'))
{
window.location.href = URL1;
}
else
{
window.location.href = URL2;
}
}
I think there is no need to navigate on new page to just closed a case, you can achieve it using following code in javascript button.
Please let me know if it will work for you.
Thanks,
Vishal
The reason i am navigating to new page is, there i will select duplicate case number.so that i can close the case. My Datetime datatype 3 fields should be in this format 8/26/2015 12:47 AM. Please help me in this.
How you find duplicate Case on your new page, means what is the common between two duplicate cases. Is it name or some other logic.
I am asking this question because we can find the duplicate case in your javascript button code and can close as well.
Thanks,
Vishal