-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathSugarCases.yml
65 lines (59 loc) · 1.95 KB
/
SugarCases.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
62
63
64
65
--- &id001 !ruby/object:Source
attributes:
name: SugarCases
refreshtime: 2008-12-17 00:47:50
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 00:53:42.322990 Z
deletecall: "name_value_list.push({'name'=>'deleted','value'=>'1'}); result=client.set_entry(session_id,'Cases',name_value_list); "
adapter: ""
createcall: "result=client.set_entry(session_id,'Cases',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.object=x['id']
o.attrib=y.name
o.value=y.value
o.save
end
# add fields that didn't come back originally!: the assigned_to and account_id
entry_result=client.get_entry(session_id,'Cases',x['id'],['assigned_user_id','account_id'])
entry_result.entry_list[0].name_value_list.each do |y|
o=ObjectValue.new
o.object=x['id']
o.attrib=y.name
o.value=y.value
o.save
end
end
method:
id: "2"
updatecall: "result=client.set_entry(session_id,'Cases',name_value_list); "
call: |
select_fields = ['name','case_number','priority','status','type','description','resolution']
result = client.get_entry_list(session_id,'Cases','','case_number',0,select_fields,'10000',0);
password: password
login: adam
epilog: client.logout(session_id)
created_at: 2008-11-20 23:04:24
attributes_cache: {}
changed_attributes: {}
errors: !ruby/object:ActiveRecord::Errors
base: *id001
errors: {}
new_record_before_save: