SugarCRM REST: Difference between revisions
Jump to navigation
Jump to search
Jkuehlthau (talk | contribs) |
Jkuehlthau (talk | contribs) |
||
Line 16: | Line 16: | ||
===Date Fields=== | ===Date Fields=== | ||
Function ScriptedField | Function ScriptedField | ||
ScriptedField=FormatDate("@@ORG:renewal_date_c@@", "yyyy-MM-dd") | ScriptedField=FormatDate("@@ORG:renewal_date_c@@", "yyyy-MM-dd") | ||
End Function | End Function | ||
Revision as of 20:15, 6 October 2014
SugarCRM REST Origin
Sample Origin Filters
See the GET /<module> filterList in the SugarCRM REST Help: https://SERVER/rest/v10/help/
Note the [{...}] surrounding the filter. This is required.
[{"id":"84b1c05c-1043-05c8-ced8-53a2ed18427b"}]
A more complex filter:
[{"$or":[{"import_source_id_c":{"$not_null":""}},{"import_source_id_c":{"$not_equals":""}}]}]
Note that the $not_null operation still requires a blank string.
Mapping
Date Fields
Function ScriptedField ScriptedField=FormatDate("@@ORG:renewal_date_c@@", "yyyy-MM-dd") End Function
Datetime Fields
Function ScriptedField
ScriptedField=FormatDate("@@ORG:date_entered@@", "yyyy-MM-ddTHH:mm:ss")
End Function
VBScript Smart Lookup
When filtering in a smart lookup, the filter must use double-double quotes:
strSugarID = SmartLookup("Accounts","id","[{""import_source_id"":""84b1c05c-1043-05c8-ced8-53a2ed18427b""}]")