147
Views
12
Comments
Solved
Demo: How To Create and Use Actions (DATABASE ERROR)

Hello, everyone!

I'm having some difficulties to finish this lesson:

Demo: How To Create and Use Actions

I have followed the step-by-step guide twice, but the same error appears on the screen everytime I try to finish it. The only part I didn't follow the guide exaclty the same way was the login part - the video suggests me to use 'edward.taylor' as username, but I do not have its password. So I tried to login as my normal user account. The error is reproduced below:

 Can anyone help me out of this? I'll be really thankfull!

2021-05-21 21-56-03
Anderson!
Solution

The 'CreatedBy' (in Order table) is 'Employee Identifier' data type. And in the 'OrderCreateOrUpdate' action you are setting it as user identifier (GetUserId()).

You must either set the current Employee Id in the assign of the action or change the type from 'CreatedBy' to User Identifier, if you want to register who created the record


2022-04-29 09-08-10
Pramod Torase

Hi frederico,

The ID you are inserting in foreign key column it should be present in parent table.

for example:

if there r 2 entities order and employee .

 createby is the foreign key in order table of type employeeId .

now if you r inserting data in order table then the id you inserting in order tables createdby column should be present in employee table


regards,

Pramod.

2021-05-21 21-56-03
Anderson!

As Pramod said, see what is the EmployeeId passed in the action and check if it exists in the parent table.


2021-11-03 19-55-34
Asher

Can you post the title of the course you are working on? The video title doesn't help me find your guide.


2022-02-27 13-31-46
Frederico Bonassa

Sure!

I'm working on a Guided Path and sending to you the printscreens.

The issue I'm facing some troubles is in this course specifically:

2021-11-03 19-55-34
Asher

Okay, I'm looking at the project now. I'll let you know what I see.

2021-11-03 19-55-34
Asher

Okay, I think I see the issue. Can you post your current OML for comparison?

2022-02-27 13-31-46
Frederico Bonassa

Sure!

Here it goes.

Orders Management.oap
2021-05-21 21-56-03
Anderson!
Solution

The 'CreatedBy' (in Order table) is 'Employee Identifier' data type. And in the 'OrderCreateOrUpdate' action you are setting it as user identifier (GetUserId()).

You must either set the current Employee Id in the assign of the action or change the type from 'CreatedBy' to User Identifier, if you want to register who created the record


2022-02-27 13-31-46
Frederico Bonassa

Thank you so much, Anderson! Worked like a charm!

That was exactly the problem I had to solve, but I was struggling to find where and how lol

Best regards!

2021-05-21 21-56-03
Anderson!

You welcome! I hope you can enjoy the benefits of working with this platform. Anything just ask! Have a great journey!

2023-01-08 03-06-27
Budi Darmawan

Thank you, your solution is very clear.

2023-07-17 16-14-14
Lilia Lopes

I was having the same error, and this HELPED! It is very clear to understand your explanation, I made the changes and now it works fine. Thank you so much Anderson. 🙌

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.