Skip to content
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

Save entity failed #29

Open
HenkRademaker opened this issue Nov 19, 2021 · 4 comments
Open

Save entity failed #29

HenkRademaker opened this issue Nov 19, 2021 · 4 comments

Comments

@HenkRademaker
Copy link

Hi.

When I run this code:

await xrmTest.Navigation.openCreateForm("contact");
await xrmTest.Attribute.setValue("lastname", "UI test");
await xrmTest.Entity.save(true);

Then gives that the following error:

Basic operations UCI › Create and save new contact

page.evaluate: Evaluation failed: Objectpage.evaluate: Evaluation failed: Object

  48 |         await xrmTest.Attribute.setValue("lastname", "UI Test");
  49 | 
> 50 |         await xrmTest.Entity.save(true);
     |            ^
  51 | 
  52 |         // await xrmTest.Attribute.setValue("primarycontactid", [{
  53 |         //     id: "C0A634A1-42C5-EB11-BACC-0022487FBED8",

  at Entity.save (node_modules/d365-ui-test/src/xrm/Entity.ts:91:39)
  at Object.<anonymous> (spec/demo-ui-test.spec.ts:50:9)

Is this a known error or do I something wrong?

I simply want to open a create form, set some field values and save the record.

But that fails..

Kind regards,

Henk Rademaker
D365-UI-Test error

@DigitalFlow
Copy link
Member

Hi @HenkRademaker,

can you check whether there are other required fields on the form which you missed filling out?
Usually this is the reason for this type of error.

Kind regards,
Florian

@HenkRademaker
Copy link
Author

Hi Florian,

Thanks for reply.
But.. there are no other required fields than only lastname.
I've record a video, so you can see the flow.
At the end, very briefly you can see that save action does start.. but immediately ran into the error.

Kind regards,

Henk Rademaker

Media1_Trim.mp4

@DigitalFlow
Copy link
Member

Hi @HenkRademaker,

I'm currently working on improving the failure message when saving fails so that we can see the exact error in your case.

In our instances saving still works, so in the mean time you might want to try on a different entity?
It might also be that you have a custom script on the form which prevents saving for doing some asynchronous action and starts saving again.

Kind regards,
Florian

@julianYaman
Copy link
Contributor

Also experienced the same issue. Solved it with a workaround by using customButton and the data-id of the 'Save' button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants