D365-UI-Test icon indicating copy to clipboard operation
D365-UI-Test copied to clipboard

Save entity failed

Open HenkRademaker opened this issue 3 years ago • 4 comments

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

HenkRademaker avatar Nov 19 '21 10:11 HenkRademaker

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

DigitalFlow avatar Nov 22 '21 10:11 DigitalFlow

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

https://user-images.githubusercontent.com/84443679/142864809-2cf2c0cb-1f48-454b-9514-68ec4dda05d3.mp4

HenkRademaker avatar Nov 22 '21 12:11 HenkRademaker

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

DigitalFlow avatar Nov 26 '21 13:11 DigitalFlow

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

julianYaman avatar Jan 11 '22 13:01 julianYaman