How to assign user who presses button as newly created record owner
Hello, I have a Button/Function on the Opportunity module that creates a custom record called "Pro Forma". I would like for the Owner field on the newly created Pro Forma record to be the user that initiated the creation via clicking the Button. Here is the code snippet that currently uses the Opportunity Owner as the Pro Forma Owner, but ideally that would be the user creating the Pro Forma.
- oppDetails = zoho.crm.getRecordById("Opportunities",oppId.toLong());
- info oppDetails;
- mp = Map();
- mp.put("Opportunity",oppId);
- mp.put("Owner",ownerId);
- create = zoho.crm.createRecord("Pro_Formas",mp);
- info mp;
- info create;
- openUrl("https://crm.zoho.com/crm/org700735448/tab/CustomModule2/" + create.get("id") + "/edit?layoutId=2985578000000363706","same window");
- return "Pro Forma Created";