Introduction
In this article, we will learn how to create a Vendor using Zoho CRM in ASP.NET MVC Web application.
Let’s begin
Please read this article first of all here.
C# Code Example
Open the HomeController.cs file and add the below code in it.
public void CreateVendors() { ZCRMModule moduleInsAccounts = ZCRMModule.GetInstance("accounts"); //module api name BulkAPIResponse<ZCRMRecord> response1 = moduleInsAccounts.GetRecords(); List<ZCRMRecord> relatedLists = response1.BulkData; List<ZCRMRecord> listRecord = new List<ZCRMRecord>(); ZCRMRecord record; record = ZCRMRecord.GetInstance("vendors", null); //To get ZCRMRecord instance record.SetFieldValue(relatedLists[0].CreatedBy.FullName, relatedLists[0].CreatedBy.Id); record.SetFieldValue("Company", "your company name"); record.SetFieldValue("Mobile", "your mobile no"); record.SetFieldValue("Phone", "your phone no"); record.SetFieldValue("Vendor_Name", "your vendor name"); record.SetFieldValue("Customfield", "CustomFieldValue"); listRecord.Add(record); ZCRMModule moduleIns = ZCRMModule.GetInstance("vendors"); BulkAPIResponse<ZCRMRecord> responseIns = moduleIns.CreateRecords(listRecord); //To call the create record method Console.WriteLine("HTTP Status Code:" + responseIns.HttpStatusCode); }
Get All Vendors Data
Open the HomeController.cs file and add the below code in it.
public void GetAllVendorsData() { ZCRMModule moduleIns = ZCRMModule.GetInstance("vendors"); //module api name BulkAPIResponse<ZCRMRecord> response = moduleIns.GetRecords(); List<ZCRMRecord> relatedLists = response.BulkData; }
if you have any questions or issues about this article, please let me know and more details here