2

Normally with Parse code I can add whatever fields I want using put, and if they don't exist in the table (and the table permissions allow it) parse will create the field(s). However, this doesn't work with the User table. If I add the fields from the web interface everything works, but if not the code will not create the fields. Is this a limitation particular to the User table, or am I missing something? The permissions allow client creation of fields. Following is Android code.

currentUser.setEmail(uname);
currentUser.setUsername(uname);
currentUser.put("phoneNumber", settings.getAgentPhone());
currentUser.put("company", settings.getAgentCompanyName());
currentUser.put("agentName", settings.getAgentName());
currentUser.saveEventually();
2
  • try to use currentUser.saveInBackground(); Commented Mar 3, 2015 at 5:56
  • I'm not certain, but I don't think that would have any different outcome. Adding the fields at signup works though. Commented Mar 5, 2015 at 15:30

2 Answers 2

1

I found the answer here: Parse.com: with parseUser, how can I save data in a column I created in parse from the class?

For some reason, you cannot add columns to the User table with a save operation from client code, but you can via the "signup" operations (signUp,signUpInBackground). I have not found any reference to this in the parse documentation.

Sign up to request clarification or add additional context in comments.

Comments

0

I would think that the User class has some sort of "special restrictions". Have you tried using the master key in Cloud Code?

Parse.Cloud.useMasterKey();

Using the master key would essentially allow you to bypass most, if not all, restrictions (essentially gives you administrative permissions)

4 Comments

No, I haven't tried that. This project doesn't involve any cloud code so I will have to decide if it would be easier to do by using cloud code or just manually adding the fields. Unfortunately there are many apps to update or I would have just done it already.
Ya...the user class always gives me the trouble. Cloud code would technically involve more code but it would probably get the job done :)
@nasch hey, just want to know if you figured out your problem yet? :)
I decided to just do it by hand since it's a one-time thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.