Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

Disappearing information onload

Posted on by 155

I have a datetime field on the entity invoice that it automatically filled with JavaScript onload function.

I can see the date for one seconded then it is gone.

I have commented out the remaining JavaScript so it is not being deleted by JavaScript.

I have disabled all the processes on the entity invoice.

No System jobs ran.

There are no plug-in trace logs.

How can I find what is altering my field?

  • Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Moderator on at
    RE: Disappearing information onload

    Disable your onload function and open an invoice record which has value for this date and time field. Check if the field value is still getting cleared. If so, there must be some JS code or business rule triggering to clear this field value. If not, you need to review your onload JS code.

  • Gansea Profile Picture
    Gansea 155 on at
    RE: Disappearing information onload

    Hi Pavan,

    I have tried with different browsers, different users and in InPrivate with the same error.

  • pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: Disappearing information onload

    Hi Gansea,

    Just try to isolate your issue, is this issue occurring only for you, did u check in your team mates machine by any chance.

    I believe this might be related to cache in your browser, try to use InPrivate window and see....as you dont have any other customizations and logic running on this field.

    https://dynamicconsulting.com/2019/11/02/how-to-clear-your-cache/

    Hope this helps..

    Cheers,

    PMDY

  • Gansea Profile Picture
    Gansea 155 on at
    RE: Disappearing information onload

    Hi Charan

    1. Yes, it is a custom date and time field?

    2. No, there isn't any other javascript function overwriting my value

    3. I have disable all the javascript events registered on this form and it still isn't working

    4. var now = new Date();

    Xrm.Page.getAttribute("test_invoicedate").setValue(now);

    Xrm.Page.getAttribute("test_invoicedate").setSubmitMode("always");

    var date = Xrm.Page.data.entity.attributes.get("test_invoicedate");

    console.log(date);

    The console log shows the correct date, but at somepoint later it is overwritten.

    console.log(date); is the last line of code in the invoice onload javascript

  • Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Moderator on at
    RE: Disappearing information onload

    1. Is this is custom date and time field?

    2. Check if there is any other javascript function overwriting your value

    3. Disable all the javascript events registered on this form and check if that is working

    4. Please share your javascript code here which sets the date and time field value

  • Gansea Profile Picture
    Gansea 155 on at
    RE: Disappearing information onload

    Hi Manoj Mane,

    The processes and Business Rules are disabled.

    I cannot disable the JavaScript onload form because it is the JavaScript onload form that populates the DateTime field.

    I have disabled all the other JavaScript code in the old load form.

    I still have the same problem that the date time disappears one second after it is created / displayed

    Any other ideas?

  • Manoj Mane Profile Picture
    Manoj Mane 1,012 on at
    RE: Disappearing information onload

    Hi Gansea,

    Can you please the field dependency and cross verify that there are no active Process/Business Rule or any Power Automate is there.

    Also, Can you disable the JavaScript on Load of a form for the debugging purpose.

    Thanks,
    Manoj Mane.

    Please mark this as VERIFIED if it helps. image

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans