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

Field statecode not generated #198

Open
akiraquenot opened this issue Dec 17, 2020 · 4 comments
Open

Field statecode not generated #198

akiraquenot opened this issue Dec 17, 2020 · 4 comments
Labels

Comments

@akiraquenot
Copy link

akiraquenot commented Dec 17, 2020

I am currently migrating my TS files to use XDT.
For some reason, the generation process does not manage fields which are placed in the footer of the form ('statecode' field in my case).

So the following line of code fails on build because "Object 'this.formContext.getAttribute("statecode")' is possibly 'undefined' (TS2532)":
this.formContext.getAttribute("statecode").setValue(customentity_statecode.Inactive);

Is that a bug or is there any way to make it work?

Thank you in advance!

Environment

  • CRM/D365/CDS version: 9.1.0000.25849
  • Tool version: 5.4.1
@magesoe
Copy link
Collaborator

magesoe commented Dec 17, 2020

According to some random blogs you have to get it by going through the control, but that seems weird to me. Anyway getControl("footer_statecode").getAttribute() should work

@akiraquenot
Copy link
Author

Thanks @magesoe for your answer, I tried this way too but same result, the control is not recognized and it displays the same error message...

In fact I have nothing concerning 'statecode' field in my generated form.d.ts

@DeanHolmes
Copy link

DeanHolmes commented Dec 17, 2020 via email

@akiraquenot
Copy link
Author

@DeanHolmes Thank you for the information.

It is sad that XDT cannot manage that... For now, I manually created the method getAttribute("statecode") in the generated file to make the rule work.

@misoeli misoeli added the bug label Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants