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 365 | Integration, Dataverse...
Suggested Answer

Autocalculate javascript field from excel importing

(0) ShareShare
ReportReport
Posted on by 27

Hi friends. 

I have an entity with a calculate field that onload event form gets a javascript value. It works fine manually record creation. But importing from excel....

I need to import using this excel template lots of records. It works, but...... this javascript calculate field does not refresh

I have to edit each record and save it again without changes. After, once in every year, those records had to recalculate (Programmed Process task) 

My 2 question:

- Is possible to update the field value during the import?

- Is possible to create a bussiness process to refresh selected records?

Thanks in advance

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Gardagantxo2007,

    Can you please post the condition and action for your calculated field. You need to populate the values specified in the calculated field calculation for the field to display the value correctly.

    It sounds to me like you are trying to use On Load JavaScript instead of using a proper calculated field. On Load JavaScript does not trigger when importing an Excel file.

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Partner,

    JavaScript works only on client side i.e. when you access form on a browser and not on server side i.e. when you importing record through Excel.

    Mayee you could use workflows/flow to update your fields which will run when you import the records.

  • Gardagantxo2007 Profile Picture
    27 on at

    Hi again, thanks for the response Adrian a Leuh.

    Yesterday I post a response, but I can't see it. Something was wrong publishing, I think.

    I have a form field that contains a initial year (like 2013 value for example)

    I have a form field (option set named period) that contains: 1 year, 2 years, 3 years,.......

    I need the dif between current year and initial year: 2023 -2013 = 10 (Javascript value stored on  javascript var difyear)

    I have a yesno field updated by this calc like:

        If period == " 2 year" and difyear == (2,4,6,8,10,12,14,16.....) then  yesno=true

        If period == " 3 year" and difyear == (3,6,9,12,15,18.....) then  yesno=true

    .........................................

    I don´t know how to do with workflows. I'm not an expert. Any idea?

    How can I get current year in a workflow condition to evaluate the dif between initialyear?

    I think it is possible with a plugin, but I'm not an expert programmer.

    Thanks in advance.

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Partner,

    it's hard to compare difference between two dates and grt difyear in the workflow.

    Maybe you can try to use power automate to create one flow, it can get difyear:

    https://powerusers.microsoft.com/t5/General-Power-Automate/Getting-years-between-two-dates/td-p/815131 

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 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans