Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Add editable field in Grid with a view as Datasource

Posted on by 250
Hello,
I have a form with Simple List pattern with a custom view as DS.
The grid contains fields originating from the view.
I have added a custom string control which needs to be edited.
It is not linked to any data source and it used by an edit method to record the field value of the record in the grid.
However, I am unable to edit the form string control. It gets stuck as if in allowEdit(false) mode.
I have tried changing the allowEdit(true) of theformstring control in post init. But it is still uneditable.
Is there any way to do this particular task?
  • Verified answer
    Jason0810M Profile Picture
    Jason0810M 250 on at
    Add editable field in Grid with a view as Datasource
    Hello,
    It is indeed impossible to add an edit field on the grid which originates from a view.
    I am using a view because there were many aggregations and filters.
    Funtionally, the field values need not be stored physically as they were being used to be inserted and displayed in the grid.
    If the user clicks on a specific button, the records (together with the custom field) needs to be processed.
    If the user exits form and re-opens, the field values need to be reset to 0.
    As a solution, I have created a new temp table.
    I then used the table as DS instead of the view and the data from the view is copied to the temp table.
    This has fixed my issue.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,605 Super User 2024 Season 1 on at
    Add editable field in Grid with a view as Datasource
    This happens if the datasource has allow edit false or it is a view where this edit method is in same line. So instead you can add a button on the same form, and on click it opens a dialog where you can add your edit method in that dialog which will update the field you are interested in.


    I have one more doubt here. If this particular form has been developed in such a way that no edit should be allowed. But can you tell us why this edit method has been implemented on the top of this? 
  • Layan Jwei Profile Picture
    Layan Jwei 7,339 Super User 2024 Season 2 on at
    Add editable field in Grid with a view as Datasource
    Hi Jason,

    I think you are saying that this control is linked to an edit method, did you create this method? if yes, then can you share the code for the edit method please?

    Thanks,
    Layan Jweihan
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,271 Super User 2024 Season 2 on at
    Add editable field in Grid with a view as Datasource
     
    The view is read only, so try to use query instead of the view, also can you share the control properties?
     
    I have a question how the control is an edit method without being linked to the DataSource?
     
     
    Thanks,
    Waed Ayyad
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans