Last active
November 19, 2023 17:38
-
-
Save vratiu/23ff5b9b588ac4478c573eea12e4f33d to your computer and use it in GitHub Desktop.
Sidecar CheatSeet
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
//create a bean from console | |
var callbean = App.data.createBean('Calls', { | |
"name": "issue 80737 call log", | |
"date_start": "2016-10-08T03:15:30+00:00", | |
"duration_minutes": 15, | |
"duration_hours": 0, | |
"assigned_user_id": "6ff50560-3589-23fa-eced-56ebf8835e3d" | |
}); | |
// save the bean to server | |
callbean.save(); | |
// fetch existing bean | |
var retbean = App.data.createBean('Calls', {id:"29300593-a362-640b-0f9a-577f9e45637a"}); | |
//fetch it from the server | |
retbean.fetch(); | |
//also grab related collections | |
retbean.fetch({related: true}); | |
//get related bean Collections | |
retbean.getRelatedCollection("activities") | |
//get sugar auth token | |
App.api.getOAuthToken(); | |
// build a link url "rest/v10/Calls/123/link/assigned_user_link/345" | |
App.api.buildURL("Calls", "assigned_user_link", {id:"123", "link":true, relatedId:"345"}); | |
//call ajax | |
App.api.call("create", linkUrl); | |
//global search a module | |
App.data.createMixedBeanCollection().fetch({limit: 20 , module_list:['KBContents'], query: "slow internet"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment