Hi all,
I am trying to automate some things using functions, but am getting stuck and am somewhat unsure why. I hope you can help me out.
Case: As a music publishing company, we register songs and how all royalties should divided among the writers. I have created a custom module for Song titles and placed a multi-select lookup to the Contact module containing our writers. As a result, a linked module is created in which we note down the writers share (among other things). Oftentimes this share is easily determined by dividing 100% over the amount of writers. I have added an Equal Splits field to the Song module to indicate this. I am having trouble getting these number in after multiple attempts, even after breaking up the code as much as possible.
My current attempt;
Just get the amount of composers that are involved and put it in a Song field.
Variables: Song ID = Titel
Target field = Composer Count
// Initialize
ls = List();
mp = Map();
// Get Related list and size
ls = zoho.crm.getRelatedRecords("LinkingModule1","CustomModule7",Titel);
totalshares = ls.size();
// Created updatemap
mp.put("Composer Count",totalshares);
// Update the field
update = zoho.crm.update("CustomModule7",Titel,mp);
The script should trigger on any change within a record, and Save & Execute does not return any errors. However, I am not seeing any fields being filled. I also tried hooking it up to the Contacts module directly, but to no avail.
Anyone got a clue how to perform this basic operation?