ASP.NET MVC

How To Create Product Using Zoho CRM In ASP.NET MVC

Introduction

In this article, we will learn how to create a Product 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 CreateProducts()
{
    try
    {
     
        ZCRMModule moduleIns1 = ZCRMModule.GetInstance("accounts"); //module api name
        BulkAPIResponse<ZCRMRecord> response1 = moduleIns1.GetRecords();
        List<ZCRMRecord> relatedLists = response1.BulkData;
        List<ZCRMRecord> listRecord = new List<ZCRMRecord>();
        ZCRMRecord record;

        record = ZCRMRecord.GetInstance("products", 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("Full_Name", "Your full name");
        record.SetFieldValue("Phone", "Your phone no");
        record.SetFieldValue("Product_Name", "Your Product name");
        record.SetFieldValue("Customfield", "CustomFieldValue");
        record.SetFieldValue("Price_Book_Name", "Price_Book_Name");
        listRecord.Add(record);

        ZCRMModule moduleIns = ZCRMModule.GetInstance("products");
        BulkAPIResponse<ZCRMRecord> responseIns = moduleIns.CreateRecords(listRecord); //To call the create record method
        Console.WriteLine("HTTP Status Code:" + responseIns.HttpStatusCode); //To get 
    }
    catch (Exception ex)
    {

        
    }

}

 

Get All Products Data

public void GetAllProductsData()
 {
     ZCRMModule moduleIns = ZCRMModule.GetInstance("products"); //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

 

 

Sagar Rana

Sagar Rana is a Web Developer in Vision Infotech. He has strong skills and knowledge of ASP.NET C#, ASP.NET MVC, .Net Core, Jquery, JavaScript, WEB API, React.js, ADO.Net, Entity Framework, SQL and different integration like Xero, Stripe, Zoho CRM, Square, PayTM, PayKUN, RazorPay, Quickbook Desktop etc.

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

3 years ago