Error in inserting the Applicant through ALF

Hai All

Currently i am doing job portal integration with AX for that i need to import the Applicant into ax through the Document service from C# and i getting the following error

Document could not be created. Error details: Error found when validating record.

Coding

JPApplicant.ApplicantServiceClient client = new ApplicantServiceClient();
JPApplicant.CallContext context = new JPApplicant.CallContext();
context.Company = “usmf”; //Company Name
AxdEntity_HcmApplicant HcmApplicant = new AxdEntity_HcmApplicant();
AxdApplicant applicant = new AxdApplicant();

JPApplicant.AxdEntity_DirPerson_DirPerson party = new JPApplicant.AxdEntity_DirPerson_DirPerson();
party.NameAlias = “ALFTesting”;
party.Gender = JPApplicant.AxdEnum_Gender.Male;
party.MaritalStatus = JPApplicant.AxdEnum_DirPersonMaritalStatus.Married;

JPApplicant.AxdEntity_DirPersonName personName = new JPApplicant.AxdEntity_DirPersonName();
personName.FirstName = “ALF”;
personName.MiddleName = "Testing ";
personName.LastName = “JP”;
party.DirPersonName = new JPApplicant.AxdEntity_DirPersonName[1] { personName };
HcmApplicant.DirPerson = new JPApplicant.AxdEntity_DirPerson_DirPerson[1]{party};
applicant.HcmApplicant= new AxdEntity_HcmApplicant[1] { HcmApplicant };

try
{

client.create(context, applicant);
Console.WriteLine(“Success”);
Console.ReadLine();
}
catch
{
throw;
}

Query

It means that a validation before saving the record failed, but it’s difficult to say which one without collecting more information. Simply debug the service.

Hi Martin,

i solved the issue i missed the two fields Applicant id and dirparty name after giving that two fields it gets inserted. thanks for the reply