• sapnajaamdar
  • NEWBIE
  • 25 Points
  • Member since 2010

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

Hi All,

 

Is there a way to avoid hardcoding username & pswd in javscript for the login() method. Im using 21.0 ajax toolkit

 

var res = sforce.connection.login('username' , 'password');

 

Coz it becomes difficult to change the user credentials in every environment. I tried to get infor on whether sessionId can be used instead of logging in again, but did not find mush help. Can anyone please throw some light on this.

 

And if we have to use the login() method, Should we use the system admin credentials? Or should we create a dummy user whose pswd never changes? What is the best way to do it?

 

Regards,

Sapna

Hi All,

 

We have a requirement to display user confirmation pop up  on-click of std ‘Save’ button on opportunity page layout.

We have achieved it through JS on home page component. It works neatly for the normal edit page but does not work well on the inline edit page.

The problem is that although the pop up message gets displayed, the "SAVE' thereafter does not happen. Appreciate any help on this.

Below is the code snippet for inline edit page:

 

function overrideTheSavebtn(){

var URL = document.location.href;

if(URL.indexOf('006') > 0){

var probab = document.getElementById('opp12');

if( probab.value!='90')

{

document.getElementsByName('inlineEditSave')[0].onclick = function(){

var choice = confirm('All orders will be deleted if you change the probability to less than 90. Do you want to continue?'); return choice;};}

}}

/* add a method onload */

var oldonload = window.onload;

if (typeof window.onload != 'function') {

window.onload = oldonload; }

else { window.onload = function() {

if (oldonload) { oldonload();}

overrideTheSavebtn();}}

</script>

 

 

Regards,

Sapna

Hi All,

 

Is there a way to avoid hardcoding username & pswd in javscript for the login() method. Im using 21.0 ajax toolkit

 

var res = sforce.connection.login('username' , 'password');

 

Coz it becomes difficult to change the user credentials in every environment. I tried to get infor on whether sessionId can be used instead of logging in again, but did not find mush help. Can anyone please throw some light on this.

 

And if we have to use the login() method, Should we use the system admin credentials? Or should we create a dummy user whose pswd never changes? What is the best way to do it?

 

Regards,

Sapna

Hi All,

 

We have a requirement to display user confirmation pop up  on-click of std ‘Save’ button on opportunity page layout.

We have achieved it through JS on home page component. It works neatly for the normal edit page but does not work well on the inline edit page.

The problem is that although the pop up message gets displayed, the "SAVE' thereafter does not happen. Appreciate any help on this.

Below is the code snippet for inline edit page:

 

function overrideTheSavebtn(){

var URL = document.location.href;

if(URL.indexOf('006') > 0){

var probab = document.getElementById('opp12');

if( probab.value!='90')

{

document.getElementsByName('inlineEditSave')[0].onclick = function(){

var choice = confirm('All orders will be deleted if you change the probability to less than 90. Do you want to continue?'); return choice;};}

}}

/* add a method onload */

var oldonload = window.onload;

if (typeof window.onload != 'function') {

window.onload = oldonload; }

else { window.onload = function() {

if (oldonload) { oldonload();}

overrideTheSavebtn();}}

</script>

 

 

Regards,

Sapna