-
Notifications
You must be signed in to change notification settings - Fork 26
/
SugarAccounts.yml
61 lines (55 loc) · 1.92 KB
/
SugarAccounts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- &id001 !ruby/object:Source
attributes:
name: SugarAccounts
refreshtime:
prolog: |
u = @source.login
p = Digest::MD5.hexdigest(@source.password)
ua = {'user_name' => u,'password' => p}
ss = client.login(ua,nil)
if ss.error.number.to_i != 0
p 'failed to login - #{ss.error.description}'
return
else
@session_id = ss['id']
uid = client.get_user_id(@session_id)
end
updated_at: 2008-12-17 01:06:32.812011 Z
deletecall: name_value_list.push({'name'=>'deleted','value'=>'1'}); result=client.set_entry(@session_id,'Accounts',name_value_list)
adapter: SugarAccounts
createcall: result=client.set_entry(@session_id,'Accounts',name_value_list)
type:
url: http://rhomobile.com/sugar/soap.php?wsdl
sync: |
result.entry_list.each do |x|
x.name_value_list.each do |y|
o=ObjectValue.new
o.source_id=@source.id
o.object=x['id']
o.attrib=y.name
o.value=y.value
o.save
end
end
method:
id: "1"
updatecall: result=client.set_entry(@session_id,'Accounts',name_value_list)
call: |
module_name = 'Accounts'
query = '' # gets all the acounts, you can also use SQL like 'accounts.name like '%company%''
order_by = '' # in default order. you can also use SQL like 'accounts.name'
offset = 0
select_fields = ['name','industry'] # this can't be an empty array
max_results = '10000' # if set to 0 or '', this doesn't return all the results
deleted = 0 # whether you want to retrieve deleted records, too
result = client.get_entry_list(@session_id,module_name,query,order_by,offset,select_fields,max_results,deleted);
password: testuser
login: testuser
epilog: client.logout(@session_id)
created_at: 2008-12-17 01:05:49
attributes_cache: {}
changed_attributes: {}
errors: !ruby/object:ActiveRecord::Errors
base: *id001
errors: {}
new_record_before_save: