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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

Script Error received when saving Purchase Order... Cannot read property 'length' of undefined

(0) ShareShare
ReportReport
Posted on by 15

Hello Everyone, 

I have am receiving a script error when saving a Purchase order in Dynamics 365. I reported the issue and shared the error with Microsoft. They advised me that there is custom code in our form, that is unsupported by the break-fix team. I have only used the API customization in advanced options. 

Can anyone advise what the error may be caused by, and how to fix it? The log file is pasted below. 

TypeError: Cannot read property 'length' of undefined
at Function.i.ValidateWorkOrderSchedule (xyz.dynamics.com/.../PurchaseOrder.Library.js:13:66501)
at Function.i.RunValidations (xyz.dynamics.com/.../PurchaseOrder.Library.js:13:45635)
at i.OnSave (xyz.dynamics.com/.../PurchaseOrder.Library.js:13:45874)
at Mu.executeFunction (xyz.dynamics.com/.../app.js
at xyz.dynamics.com/.../app.js
at o (xyz.dynamics.com/.../app.js
at Iu._executeIndividualEvent (xyz.dynamics.com/.../app.js
at Iu._executeEventHandler (xyz.dynamics.com/.../app.js
at Object.execute (xyz.dynamics.com/.../app.js
at O._executeSyncAction (xyz.dynamics.com/.../app.js

I have the same question (0)
  • Pratik Jog Profile Picture
    95 on at

    Hi admin4media,

    As the log suggests , you are checking length of a variable which is either undefined or null , add debugger on the PurchaseOrder javascript and check where you're getting the error. If possible share the custom code written in PurchaseOrder.js and we can help. Also please mask the organization name while sharing the log in future. i.e 4media-group shouldn't be visible.  

  • Vigsan_MS Profile Picture
    Microsoft Employee on at

    Hello,

    Looks like this is the customization related to Dynamics 365 customer engagement but this forum is for Dynamics 365 for finance and operations.

    Could you please repost in the customer engagement forum to get a swift support.

    Thanks

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Moved to D365 Customer Service forum.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 25 Most Valuable Professional

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 16

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans