Answered by:
CRM 2013 - Javascript Functions

Question
-
Hi,
I have created a javascript function that will read the data that is in the field Account Name.
I then have a different piece of javascript for when the data in account Name is changed.
What I want is for the data in account name is changed that the javascript there calls the first bit of javascript so that a message box can appear stating the old account name will be changed to the new account name
How do I do this?
Thanks, Shaun
S.Harrison
Tuesday, June 10, 2014 9:17 AM
Answers
-
Step 1: Create a global variable as ACCName
Step 2: call a js function on onload of form and
function
{
ACCName= old value
}
Step 3: Call another js function onchange of name
funtion onchange()
{
alert("Old name:"+ACCName + "New name:"+ your new name);
}
Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"
- Proposed as answer by Mr. Santosh Bhagat Tuesday, June 10, 2014 9:33 AM
- Marked as answer by Shaun Harrison Tuesday, June 10, 2014 9:49 AM
Tuesday, June 10, 2014 9:33 AM
All replies
-
Step 1: Create a global variable as ACCName
Step 2: call a js function on onload of form and
function
{
ACCName= old value
}
Step 3: Call another js function onchange of name
funtion onchange()
{
alert("Old name:"+ACCName + "New name:"+ your new name);
}
Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"
- Proposed as answer by Mr. Santosh Bhagat Tuesday, June 10, 2014 9:33 AM
- Marked as answer by Shaun Harrison Tuesday, June 10, 2014 9:49 AM
Tuesday, June 10, 2014 9:33 AM -
Thanks for the quick reply
How exactly do you declare a local variable?
Thanks, Shaun
S.Harrison
Tuesday, June 10, 2014 9:35 AM -
Got it working, thanks for your help
If anyone else wants to know to declare a global variable you simply don't define it
so normally you would have
var AccountName = ... ;
To have a global variable its simply
AccountName = .....;
S.Harrison
Tuesday, June 10, 2014 9:58 AM