How do pull an attribute from one entity into another entity

Hi Guys

I have a form that captures the "Applicant" details and once they click the save button it takes them to another form to capture the "Respondent" details, the next form to capture is the dependant form then the expenses form ant then the application form. I want the foreign attribute "Respondent.ApplicantId" to be the same as the "Id" in the Applicant entity. However that is not the case with my app, the form creates a new "ApplicantId" in the Respondent table, it is not using the one from the Applicant table.

Note: I want the same process to happent with the Dependent and Application entities.I have created the following Client Actions

GetApplicantID

GetRespondentID

GetDependantID

GetExpensesID

What do i do next, please help.


HI Diemiso,

I am not very clear about what you want but if you want your Applicant and Respondent entity in one to many relation then your structure is correct if the type of ApplicantId of tyle Applicant Identifier then usually when it is create that time outsystems set it automatically. But still if it is not correct you can set it yourself.

If you want you applicant and respondent entity in one to one relationship then you should remove id autoincrement primary attribute and set applicantid as identifier.

Please let me know if you were asking something else.


Hi Nikhil

Thank you for your prompt response. So if you look at the two entities below, I want the value of the "ApplicantId" in the Respondent table to be the same as the value of the "Id" attribute in the Applicant table. But at the moment they are not the same. So the ApplicantId in the Respondent table should be 20 and not 0.








Diemiso Solomon wrote:


Hi Nikhil

Thank you for your prompt response. So if you look at the two entities below, I want the value of the "ApplicantId" in the Respondent table to be the same as the value of the "Id" attribute in the Applicant table. But at the moment they are not the same. So the ApplicantId in the Respondent table should be 20 and not 0.









Hi Diemiso,

Have you debugged your logic where you are creating the entry in your RespondantData?

where you are assigning the Applicant.Id to RespondantData.ApplicationId?

I think you need to check you code or if possible please share sample oml or snapshot of your code.

Regards,

Manish Jawla


Hi Manish

I have created the following Client Action. And im assigning the applicantID to respondent.applicantId on the "Save" button. Hope this makes sense. Please see the screenshots below




Diemiso Solomon wrote:

Hi Manish

I have created the following Client Action. And im assigning the applicantID to respondent.applicantId on the "Save" button. Hope this makes sense. Please see the screenshots below




HI Diemiso,

Can you plese also share screenshot of you getApplicantId client action. I want to see how are you getting applicationid in this client action.

Ideally after filling application form when you redirect to respondent screen that time you should send application id in an input parameter.


This is the ApplicantId one. Am I doing it incorrenctly?



Solution

Yes, you are assigning nullidentifier to ApplicantId and and returning from getApplicantId action. So obviously it will save 0 in respondent as you are assigning nullidentifier.

You should create an input variable on your respondent details screen and in your below action after creating applicant you will get applicant id. Assign this applicant id to redirect action highlighted with red box below

Solution

Thanks, let me try it. I will give you feedback once done