Custom function to lookup from another module

Custom function to lookup from another module

The code works when executed manually.

But does not work when set with workflow rule as when a new quote is created?

what am I missing? 

accDetails = zoho.crm.getRecordById("Accounts",accidtoLong());
mp = Map();
mp.put("Shipping_Street",ifnull(accDetails.get("Shipping_Street"),""));
mp.put("Shipping_City",ifnull(accDetails.get("Shipping_City"),""));
mp.put("Shipping_Country",ifnull(accDetails.get("Shipping_Country"),""));
mp.put("Shipping_State",ifnull(accDetails.get("Shipping_State"),""));
updateResp = zoho.crm.updateRecord("Quotes",quoteId.toLong(),mp);
info mp;
info updateResp;