How to get authtoken for Books function to get List of PO ?
Hello,
I'm trying a small test function in Books Automation for module Purchase Order to get the list of billed PO. This test should run standalone for now. Later I plan to attach the function to a button or link for admin to run it.
Surprisingly, it requires at least one known PO to get the list of the others. Arguments are mandatory, I don't need them.
- void test_getpostatus( map purchaseorder , map organization , map user ) {
- organizationID = <hidden>;
- poSearch = {"status":"billed"};
- poList = zoho.books.getRecords("Purchaseorders",organizationID, poSearch);
- info poList;
- }
When I execute the function, it fails...
{"code":14,"message":"Invalid value passed for authtoken."}
How do I get a valid Books authtoken, so this Books function can run inside Books ?
PS:
I copied this script inside CRM standalone function:
- String getPOStatus() {
- organizationID = <hidden>;
poSearch = {"status":"billed"};
poList = zoho.books.getRecords("Purchaseorders",organizationID,poSearch);
info poList;
return ""; - }
and this works ! How funny :)
Regards