Skip to main content
Post a question

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to make a sub grid fields editable and required

Like (0) ShareShare
ReportReport
Posted on 18 Jun 2021 10:20:49 by 15

Hi,

On the invoice form, there is a invoicedetail subgrid and few fields are enabled and required like the quantity.

I have created a new column and added to the subgrid but it's only in display mode.

I would like to make it editable and required.

I was exploring the subgrid properites and I found nothing interesting.

Then I tried using javascript but it doesn't work

var invoiceSubGrid = formContext.getControl("invoicedetailsGrid").getGrid();
var gridRows = invoiceSubGrid.getRows();
gridRows.forEach(function (row, i)
{
    var gridColumns = row.getData().getEntity().attributes;
    gridColumns.forEach(function(column, j) {
        varatrName = column.getName();
        varatrValue = column.getValue();
        column.setDisabled(false);
        column.setRequiredLevel("required");
    });
});

Thanks in advance

  • vnussbaum Profile Picture
    vnussbaum 15 on 21 Jun 2021 at 10:13:09
    RE: How to make a sub grid fields editable and required

    By default, the invoicedetail control was read only but you can modify the quantity.

    I tried to add the editable grib control and my custom field is still not editable. If I set it to required, the field is locked and I get the error message telling the field is required.

    I just tried as business required, something changed.

    Maybe it's a limitation for this specific table

  • Suggested answer
    Rui Carvalho Profile Picture
    Rui Carvalho on 21 Jun 2021 at 09:23:59
    RE: How to make a sub grid fields editable and required

    Hi,

    For Editable Sub-Grids please see the following documentation: docs.microsoft.com/.../use-editable-grids

    Under this:

    pastedimage1624267352969v1.png

    For field as required please see the following documentation: Create and edit fields with Dynamics 365 Customer Engagement (on-premises) | Microsoft Docs

    You will have 'Field Requirement'. You need to set the field as 'Business Required'

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,559 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,579 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete