Creating a new record

Creating a new record

Hi,

I am trying to figure out the custom function for the automation rule trigged when an invoice is created in Zoho CRM using Deluge scripting.

The custom function should create a record (Operation) in the custom module Operations with the Operation Name = Subject (from the Invoices module) and Quantity for this Op = Quantity for the main product/the first in the list (from the Invoices module).

I wrote something like this, but it doesn't work:

void CreateOperationForOrder   ( string invoiceID )  
invoiceDetails  =  zoho. crm.getrecordbyid(  "Invoices" , invoiceID.toString());   
//   //    
operationName  =  invoiceDetails.get("Subject")  ;    
quantityForThisOp  =  invoiceDetails.get("Quantity")  ;    
temp  =  Map()  ;    
temp.put(  "Quantity for this Op",  product);   
temp.put(  "Custom Module1 name",  operationName);   
operationCreate  =  zoho. crm.create(  custommodule1 , temp , 1); 

Please help with the scripting,
Thank you