Created
September 14, 2015 16:08
-
-
Save betobaz/8903da727396b6a346ce to your computer and use it in GitHub Desktop.
SugarCRM: Sidecar: save new bean with id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
events:{ | |
'click .button': '_createMeeting', | |
}, | |
_createMeeting: function(){ | |
var meeting = app.data.createBean('Meetings'); | |
meeting.set({ | |
// Create its UUID | |
id: app.utils.generateUUID(), | |
name: 'Test', | |
date_start: '2015-09-15'+'T09:00:00', | |
duration_minutes: 30, | |
duration_hours: 0, | |
parent_type: 'Accounts', | |
parent_id: '387643b8-626b-2a7c-86ff-55a5f9c3b44e', | |
parent_name: 'Acount test' | |
}); | |
// Force to save with POST | |
meeting.id=null; | |
meeting.save(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para que version de Sugar es este codigo Pedro?