Zoho creator + zoho books integration - zoho

So been given this recent task, create a form for new customers and integrate it with zoho books.
I know almost nothing about Deluge or zoho platform.
anyway this is what i have achieved so far:
1-Create the form ✅
2-On form submission->create new contact on zoho books ❌
Here is my form:
I managed to create the new contact on zoho books but i am not able to push the last 3 fields to zoho books("Legal Document", "Accounts Document" and "Tax Document").
This last 3 fields have a file attached.
Heres the script:
cpList = List();
firstName = input.Contact_Name.first_name;
lastName = input.Contact_Name.last_name;
contactName = firstName + " " + lastName;
contactMap = Map();
contactMap.put("contact_name",contactName);
contactMap.put("company_name",input.Company_Name);
contactMap.put("website",input.Website);
contactMap.put("twitter",input.Twitter);
/////////
//contactMap.put("skype_name",input.Skype_Name);
billingMap = Map();
billingMap.put("zip",input.Billing_Address.postal_Code);
billingMap.put("country",input.Billing_Address.country);
billingMap.put("address",input.Billing_Address.address_line_1);
billingMap.put("street2",input.Billing_Address.address_line_2);
billingMap.put("city",input.Billing_Address.district_city);
billingMap.put("state",input.Billing_Address.state_province);
contactP = Map();
contactP.put("salutation",input.Contact_Name.prefix);
contactP.put("first_name",firstName);
contactP.put("last_name",lastName);
contactP.put("designation",input.Designation);
contactP.put("department",input.Department);
contactP.put("contact_salutation","Mr/Mrs");
contactP.put("mobile",input.Mobile_Phone);
contactP.put("phone",input.Phone_Number);
contactP.put("email",input.Email);
//Skype does not work here or on the contactMap
//contactP.put("skype_name",input.Skype_Name);
contactP.put("is_primary_contact",true);
contactMap.put("billing_address",billingMap);
// Custom Fields
cpList.add(contactP);
cFields = List();
cFields.add({"index":"1","value":input.Registration_Number});
cFields.add({"index":"2","value":input.Industry});
cFields.add({"index":"3","value":input.VAT});
//next doesn’t work
//cFields.add({"index":"4","value":input.Legal_Form});
cFields.add({"index":"5","value":input.Tax_Dossier_No});
cFields.add({"index":"6","value":input.Legal_Rep_SSN_No});
cFields.add({"index":"7","value":input.Balance_Sheet.toDecimal()});
cFields.add({"index":"8","value":input.Annual_Turnover.toDecimal()});
These are the fields :
//cFields.add({"index":"9","value":input.Legal_Document});
//cFields.add({"index":"10","value":input.Accounts_Document});
//cFields.add({"index":"11","value":input.Tax_Document});
contactMap.put("custom_fields",cFields);
contactMap.put("contact_persons",cpList);
params = Map();
params.put("JSONString",contactMap);
createContact = invokeurl
[
url :"https://books.zoho.eu/api/v3/contacts?organization_id=..."
type :POST
parameters:params
connection:"..."
];
Somehow, if i dont use the last 3 fields i can add a new contact on zoho books,
but if i add the last 3 fields the call is not made, no new contact on zoho books
My issu, how can i upload the files to zoho books?
Thank You

You have to create a connection from zoho Oauth. That connection will integrate your creator and books. You have to enable insert from zoho creator to zoho books in that connection.
Put here the connection name in connection webhook. You need must add organization id. createContact = invokeurl [ url :"https://books.zoho.eu/api/v3/contacts?organization_id=..." type :POST parameters:params connection:"..." ];

The last 3 fields are File type and you must send them as attachements to your invokeurl.

Related

How to fetch data from Zoho Books to Zoho Creator? 200+ records

I need to fetch Data from Zoho Books to Zoho Creator.
How to get Invoice, Estimate, Customer data?
How to fetch 200+ records?
Through single API call we will get only 200 records.
First we have to make a connection from Zoho Creator to Zoho Books ,
For that Go to Zoho Creator/ Setup/ Connection and Make a connection (Select Zoho books module only).
Now you have to go to Zoho Books and in settings you will find User and Roles, Assign user to that email in which you want to fetch the data. Make that email Role as Admin.
you need to accept the invitation from Zoho books.
For example here I am fetching Invoice module from Zoho Books to Zoho Creator.
void invoice()
{
organizationID = input org_id number;
invlist = List();
pageList = {1,2,3};
itemList = List();
customerList = List();
i = 0;
for each page in pageList
{
i = i + 1;
invoices = invokeurl
[
url :"https://books.zoho.in/api/v3/invoices?page=" + page + "&per_page=200&organization_id=" + organizationID
type :GET
connection:"zohobooks"
];
invoices = invoices.get("invoices");
info "invoices" + invoices;
for each findItems in invoices
{
info "findItems" + findItems;
invoiceID = findItems.get("invoice_number");
customerID = findItems.get("customer_name");
balanceID = findItems.get("balance");
dateID = findItems.get("date");
amountID = findItems.get("total");
itemID = findItems.get("line_items");
statusID = findItems.get("status");
// Invoice is form name, We are inserting data in that form
insert into Invoice
[
Added_User=zoho.loginuser
Invoice_Number=invoiceID
Customer_Name=customerID
Balance=balanceID
Date_field=dateID
Amount=amountID
Status=statusID
]
}
}
info invlist;
}
Please check related to Zoho License Subscription usage and restriction.
The link is
Zoho Help Link
If you have exhausted the usage limit take help from Zoho for increasing your usage limit as per your company requirement.

Zoho creator integration with zoho books

So i recently started working with the Zoho platform so im quite new to it, ive been assigned the following task:
Build a Customer form on zoho creator with various different fields (name, company name, billing address and some extra custom fields.
Integrate the data from the form to the zoho books platform.
Basically, a user submit the form and on submission a new record on zoho books its created.
enter image description here
enter image description here
My issue, when the form is submitted theres no new customer on zoho books.
Can someone help me please
Thank You
cpList = List();
firstName = input.Contact_Name.first_name;
lastName = input.Contact_Name.last_name;
contactName = firstName + " " + lastName;
contactMap = Map();
contactMap.put("contact_name",contactName);
contactMap.put("company_name",input.Company_Name);
contactMap.put("website",input.Website);
billingMap = Map();
billingMap.put("zip",input.Billing_Address.postal_Code);
billingMap.put("country",input.Billing_Address.country);
billingMap.put("address",input.Billing_Address.address_line_1);
billingMap.put("street2",input.Billing_Address.address_line_2);
billingMap.put("city",input.Billing_Address.district_city);
billingMap.put("state",input.Billing_Address.state_province);
contactP = Map();
contactP.put("first_name",firstName);
contactP.put("last_name",lastName);
contactP.put("designation",input.Designation);
contactP.put("department",input.Department);
contactP.put("contact_salutation","Mr/Mrs");
contactP.put("mobile",input.Mobile_Phone);
contactP.put("phone",input.Phone_Number);
contactP.put("email",input.Email);
contactP.put("is_primary_contact",true);
contactMap.put("billing_address",billingMap);
cpList.add(contactP);
contactMap.put("contact_persons",cpList);
params = Map();
params.put("JSONString",contactMap);
createContact = invokeurl
[
url :"https://books.zoho.eu/api/v3/contacts?organization_id="
type :POST
parameters:params
connection:"books"
];
This was the way i was able to make it work.
There might need to be an authentication token for 'books' included in the headers. Check the books.zoho API documentation to see if there is information regarding creating and using an API token.
Also by adding detailed:true to the invokeurl call you can get some visibility into any information or error-messages in the response from invokeurl. Here is some example code:
response = invokeurl
[
url : "https://books.zoho.eu/api/v3/contacts?orgainization_id=20077348839
type :POST
parameters:datamap
connection:"books_contact_auth"
detailed:true
];
// To see all headers and content
info response;

How to fetch data from Zoho Inventory into Zoho Creator

response = zoho.inventory.getRecords("Item","i inserted ID in here");
var = response.get("Product Name");
for each hey in var
{
insert into SKU #SKU is a form in Zoho Creator
[
Added_User=zoho.loginuser
Item_Name=hey #Item_Name is my field in SKU
]
}
Above code not fetching the Product Name Data from Inventory into Zoho Creator
To serarch in Inventory you must use:
<response> = zoho.inventory.getRecords(<module>, <org_id>, [<criteria_map>], [<connection>]);
The module is Items. In "Settigs" -> "Profile organization" you can obtain your org_id. It returns a map and you have to iterate over response.get("Items")
I you want to get a single item and you have the ID you can use the next function
<response> = zoho.inventory.getRecordsByID(<module>, <org_id>, <record_id>, [<connection>]);
If you want to view the reponse, you can use "info response;" or "alert response;" depend where you are using it.
Are you sure, you are using the correct link name of 'Product Name' field, try 'Product_Name' instead.
Please Used the Correct API Name for fetch out in Map.
getRecords()- used to get all records (200) at time & for Individual records try this:getRecordsByID()
response = zoho.inventory.getRecords("Item","i inserted ID in here");
Org id is missing in this get record code.
var = response.get("Product Name");
make sure you are using a correct api name of the product name

Retrieve Customer Entity in Dynamics CRM 2016

As we know Dynamics CRM has a specific attribute value: Customer. This value combines the Client and Account entity, but I'm blind or MSDN doesn't have specification about retrieving this field in query.
For example:
QueryByAttribute query = new QueryByAttribute(entName);
query.ColumnSet = new ColumnSet(new String[] { searchAttr });
query.Attributes.Add(searchAttr);
query.Values.Add(searchValue);
EntityCollection retrived = service.RetrieveMultiple(query);
This code accepts entity name and searches the attribute's name and value, but when I run it I don't know which type of entity I get from my DataSouce: Client or Account.
So the question is: is it possible to retrieve Customer entity in one query?
No, you must first know which entity you are trying to retrieve.
Get the value held within the Customer field as an EntityReference:
var customer = entity.GetAttributeValue<EntityReference>("customerid");
Get the LogicalName of the EntityReference:
var customerEntity = customer.LogicalName;

Discover Google calendar created with service account

I created new Google calendar with API v3 in c# with Service account. I also set ACL rule:
var permission = new AclRule()
{
Scope = new AclRule.ScopeData() { Type = "domain", Value = "mydomain.com" },
Role = "reader",
};
Problem is how can users of domain "nicely" add this calendar to "Other calendars" in calendar.google.com site?
They can add it if they enter calendar id, which is not user friendly, since id is some random string:
4b123456789glvpvasaaaaaaaar4#group.calendar.google.com
. I though I could search by calendar summary. But this is not the case. Only entering complete calendarId adds it to calendar list.

Resources