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
// Now, let's add a new Accounts record | |
$parameters = array( | |
'session' => $sessionId, | |
'module' => 'Accounts', | |
'name_value_list' => array( | |
array('name' => 'name', 'value' => 'New Account'), | |
array('name' => 'description', 'value' => 'This is an account created from a REST web services call'), | |
), | |
); | |
$json = json_encode($parameters); |
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
<?php | |
// specify the REST web service to interact with | |
$url = 'https://localhost/~jmertic/sugar7/ent/sugarcrm/rest/v10'; | |
// And admin username/password | |
$username = 'will'; | |
$password = 'will'; | |
// And the report_id you wish to export |
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
var sys = require('util'), | |
rest = require('restler'); | |
var baseurl = "<<instance URL>>/rest/v10" | |
// get oAuth token | |
var jsonData = {"grant_type":"password","username":"<<username>>","password":"<<password>>","client_id":"sugar"}; | |
rest.postJson(baseurl+'/oauth2/token', jsonData).on('2XX', function(data) { | |
if ( data.error ) { | |
sys.puts("Error: " + data.error_message); |
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
...abbreviated | |
<div class="dropdown-menu scroll pull-right"> | |
<ul role="menu"> | |
<li class="profileactions-profile"><a href="{{profileUrl}}">{{str "LBL_PROFILE"}}</a></li> | |
<li class="profileactions-employees"><a href="{{employeesUrl}}">{{str "LBL_EMPLOYEES"}}</a></li> | |
{{#if showAdmin}} | |
<li class="administration"><a href="#Administration">{{str "LBL_ADMIN"}}</a></li> | |
{{/if}} | |
<li class="profileactions-about"><a href="#bwc/index.php?module=Home&action=About">{{str "LNK_ABOUT"}}</a></li> | |
<li class="profileactions-logout"><a href="#logout/?clear=1">{{str "LBL_LOGOUT"}}</a></li> |
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
<?php | |
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
/* | |
* Copyright (c) 2013, John Mertic | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright notice, this |
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
<?php | |
function link_record_beans($bean1, $bean2){ | |
$m1 = $bean1->module_dir; | |
$m2 = $bean2->module_dir; | |
$rel=getRelationshipByModules($m1, $m2); //see link to previous post for this function | |
if($rel !== FALSE){ | |
if($rel[1] == $m1){ | |
$class = $bean1->object_name; | |
$id = $bean1->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
<?php | |
public function exportSanitize($value, $vardef, $focus, $row=array()) { | |
return $this->formatField($value, $vardef); | |
} |
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
<?php | |
$configurator = new Configurator(); | |
if (!isset($configurator->config['test_key1'])) { | |
$configurator->config['test_key1'] = 'test_value1'; | |
} | |
$configurator->handleOverride(); |
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
<?php | |
//set up options array | |
$options = array( | |
"location" => 'https://site14/sugar6/soap.php', | |
"uri" => 'http://www.sugarcrm.com/sugarcrm', | |
"trace" => 1 | |
); | |
//user authentication array | |
$user_auth = array( |
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
<?php | |
// specify the REST web service to interact with | |
$url = '<<your sugar instance URL>>/service/v4_1/rest.php'; | |
// And admin username/password | |
$username = '<<username>>'; | |
$password = '<<password>>'; | |
// And the report_id you wish to export |