Populating a user pick list failing if user is not an admin or portal owner

Populating a user pick list failing if user is not an admin or portal owner

I have a function that, until recently worked fine.  The function essentially copies another project.  One aspect of this copying was to take the value of a UDF that is a User Pick List, find the correct user id for that user, and populate the corresponding pick list UDF in the target project.

Recently (I can't say exactly how long ago), this aspect of the copying started to fail, and actually caused the entire copying to fail.  I've isolated the user pick list updates and removed them from the main update, so MOST of my copy process works.

The curious thing about this is, if the ID on the "source" project belongs to a user who is an Admin or the Portal Owner, the population of the "Target" project's User Pick List field works just fine.  Any other user profile seems to cause it to fail.

The gist of how I do this is to get a list of portal users, and compare the user to my "source" user:

userresp = invokeurl
[
url :endPoint + portalId + "/users/"
type :GET
connection:"projectusers"
];
//info userresp;
users = userresp.getJSON("users").toJSONList();
for each  user in users
{
curruser = user.getJSON("name");
if(curruser == salesperson1)
{
salesperson1id = user.getJSON("id");
//info "Sales Person: " + salesperson1;
//info "Sales Person ID: " + salesperson1id;
}
...
}

I then try an update using a map with this entry:

editmp2.put("UDF_USER1",salesperson1id);

if salesperson1id belongs to an admin or portal owner, everything works.  The other profiles fail.
Any help?

Thanks,

George

      Zoho Developer Community









                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources



                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources


                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources


                                                              Zoho Sprints Resources


                                                                Qntrl Resources


                                                                  Zoho Creator Resources


                                                                    Zoho WorkDrive Resources



                                                                      Zoho Campaigns Resources


                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • Functions

                                                                          Functions

                                                                        • Meetups

                                                                          Meetups

                                                                        • Kbase

                                                                          Kbase

                                                                        • Resources

                                                                          Resources

                                                                        • Digest

                                                                          Digest

                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner





                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now