New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot able to update a candidate #141

Closed
manrick653 opened this Issue Mar 9, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@manrick653

manrick653 commented Mar 9, 2017

[FATAL]: local_project.sdkrouting_0_1.sdkrouting - tJavaRow_1 {
"errorCode" : 500,
"errors" : [ {
"detailMessage" : "missing required property: userType",
"propertyName" : "userType",
"severity" : "ERROR",
"type" : "MISSING_REQUIRED_PROPERTY"
} ],
"entityName" : "Candidate",
"errorMessage" : "error persisting an entity of type: Candidate"
}
com.bullhornsdk.data.exception.RestApiException: {
"errorCode" : 500,
"errors" : [ {
"detailMessage" : "missing required property: userType",
"propertyName" : "userType",
"severity" : "ERROR",
"type" : "MISSING_REQUIRED_PROPERTY"
} ],
"entityName" : "Candidate",
"errorMessage" : "error persisting an entity of type: Candidate"
}

UserType class does not have the parameter based constructor.
Please help

@johnsully83

This comment has been minimized.

Show comment
Hide comment
@johnsully83

johnsully83 Jun 26, 2017

Member

Hello,

This error has to do with using a Candidate object that we requested from the SDK. I.e., I'm guessing you code looks (at a very high-level) like this:

Candidate aCandidate = bullhornData.findEntity(Candidate.class, myCandidateId);
aCandidate.setCustomText1('Some value');
bullhornData.updateEntity(aCandidate);

What we want to do instead is create a new instance of the Candidate for persisting via the APIs. This ensures we're only sending the fields we want to update to the REST APIs:

Candidate myCandidate = new Candidate(myCandidateId); //this sets the id field on the candidate
myCandidate.setCustomText1('Some value');
bullhornData.updateEntity(aCandidate);

This is a best practice, mainly because it removes any ambiguity around what you're updating. Basically we only want to populate fields on the object we're sending to the APIs that we actually want to change.

Member

johnsully83 commented Jun 26, 2017

Hello,

This error has to do with using a Candidate object that we requested from the SDK. I.e., I'm guessing you code looks (at a very high-level) like this:

Candidate aCandidate = bullhornData.findEntity(Candidate.class, myCandidateId);
aCandidate.setCustomText1('Some value');
bullhornData.updateEntity(aCandidate);

What we want to do instead is create a new instance of the Candidate for persisting via the APIs. This ensures we're only sending the fields we want to update to the REST APIs:

Candidate myCandidate = new Candidate(myCandidateId); //this sets the id field on the candidate
myCandidate.setCustomText1('Some value');
bullhornData.updateEntity(aCandidate);

This is a best practice, mainly because it removes any ambiguity around what you're updating. Basically we only want to populate fields on the object we're sending to the APIs that we actually want to change.

@manrick653

This comment has been minimized.

Show comment
Hide comment
@manrick653

manrick653 Oct 12, 2017

thanks for the suggestion @johnsully83

manrick653 commented Oct 12, 2017

thanks for the suggestion @johnsully83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment