• ForeFront Corp
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Trying to add a button that creates records utilizing this method:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_createRecord.htm

It appears salesforce uses the Moment JS library in regards to the event object and it is causing an error on modal creation when the button is clicked. 

The error throws in libraries and name of it: force:calendarLibrary.js. If you open this file in developer console in chrome, then you can click on { } button to see it in formatted way, then you need line 197. Small video demonstration:
https://www.screencast.com/t/gFJ9K0Ah 

Stack Trace:
Error is happening in sf js, this stack trace of the error "Object.toUserTime()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:9:553
Object.writeStartDateTimeToActivityDate()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:55:262
Object.init()@https://ffcommdemo-developer-edition.na30.force.com/libraries/force:calendarLibrary.js:61:407
onInit()@https://ffcommdemo-developer-edition.na30.force.com/components/sfa/eventDateTime.js:1:508" 

Appears to be an error in Moment.Js library being used
https://github.com/moment/moment-timezone/issues/468