web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

javascript code for multiply two field

(0) ShareShare
ReportReport
Posted on by

I want to multiply two field as below:

function multiply()

{
var val1 = Xrm.Page.getAttribute(‘new_tax′).getValue();
var val2 = Xrm.Page.getAttribute(‘baseamount′).getValue();

if(val1==null)return;
if(val2==null)return;

var result = val1*val2;
Xrm.Page.getAttribute(‘tax’).setValue(result);
}

unfortunately I meet an error

'multiply' is undefined.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi,

    please try to change the function to

    var multiply = function () {}

  • Community Member Profile Picture
    on at

    the same error :(

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    The function could not be located in the files.

    Please check whether it is available in the file and publish.

  • Community Member Profile Picture
    on at

    what do you mean by file or files?

  • Community Member Profile Picture
    on at

    Please check if the web resource where you write your javascript function is added to the form. Also please make sure that the form is published.

    using F12 debugging tool, make sure that the javascript resouces is loaded and the function is available. Keeping F12 window open clears the cache automatically.

    Jithesh

  • ganeshm Profile Picture
    on at

    Well try to use "debugger;" in ur js and check it loaded in the form .

    Still facing the same error better to use the oob features by changing the 'tax' field as calculate field type.you can perform the same operation in them.

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Click Edit Library and find out the the function is available.

    JavascriptFormOnload.PNG

  • Community Member Profile Picture
    on at

    I cant add and use simple field in action of calculated field.

  • ganeshm Profile Picture
    on at

    Created field(existing field) cannot be convert to calculated field.so try create a new field and use it

  • Community Member Profile Picture
    on at

    I have to fill 'new_tax' manual and when I Create it as calculated field,it become read only and should fill automatically.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans