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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set value in Javascript

(0) ShareShare
ReportReport
Posted on by 694

Boa noite,

Eu tenho dois Javascript, onde cada um retorna a soma dos pedidos de dois filtros certos pedidos.

O resultado da consulta A vem por exemplo 13560.98789 e resultado B por exemplo 2290.09878, posso adicionar ambos via javascript, mas não consigo configurá-lo em um campo decimal, mas já tentei parseFloat (campo) sem sucesso, ainda saberia como pode fazer isso via Javascript?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello Ricardo,

    Can you please post your questions using English? Regarding your issue (luckily I know how to use online translators) - can you please provide code that you use?

  • Ricardo Rodrigues dos Santos Profile Picture
    694 on at

    Helo Butenco!

    Below is the function I'm using, the var group_mass and the sum_mice is returning the sum of the right result.

    My var sum_total sums the two fields sum_group and sum_mice right, I get an alert in the function, but I can not set the value of the new_field field, it is of the currency type

    / * Search the Sub Accounts and make the Sum of the CCA Requests -> Event Schedule * /

        var customer_id= Xrm.Page.getAttribute ("customer_id"). getValue () [0] .id;

        var sum_group = GetSum_Group_No_Group (customer_id, [['new_date', 'on-or-after', GetDataInitialLastSeisMeses ()], ['new_date', 'on-or-before', GetDataFimLastSeisMeses ()]));

        var sum_field = GetSomaPedidos_Mice_Nao_Grupo (customer_id, [['new_date', 'on-or-after', GetDataInicioLastSeisMeses ()], ['new_date', 'on-or-before', GetDataFimLastSeisMeses ()]));

    var sum = sum_group + sum_field;

    // alert (sum);

    Xrm.Page.getAttribute ("new_field"). SetValue (sum);

    Would you help me?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    First thing - Butenko, not Butenco. And this is my lastname. You can call me Andrew.

    Here is why your code doesn't work - use setValue, not SetValue like following:

    Xrm.Page.getAttribute ("new_field"). setValue (sum);

  • Ricardo Rodrigues dos Santos Profile Picture
    694 on at

    Hello,

    Sorry for the mistake, the code worked, thank you.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans