web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

remove draft/not created line from grid

(0) ShareShare
ReportReport
Posted on by

Hello All,

I want to remove the line from grid if its validation fails in the validatewrite() method of form datasource. How can i achieve this?

Thank you

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

    Hi Jeff,

    If the validation fails, then the record won't be written to the table.

    You can try calling the FormDataSource.delete() method and check whether it works.

    Thanks,

    Girish S.

  • JeffGreenrc Profile Picture
    on at

    You are correct, the record wont be written to the table. But I want to remove this record.

    When I am using FormDatasource.delete() or FormDataSource.deletemarked(), it is removing the other line and not this new draft/uncreated line. Although this new line is checked in the grid.

  • GirishS Profile Picture
    27,843 Moderator on at

    If the validation fails, try to set the cursor position to the previous last inserted record against the header. You can use findRecord method of the FormDataSource. Also try using positionToRecord of FormDataSource and see if it deletes the error line.

    Thanks,

    Girish S.

  • JeffGreenrc Profile Picture
    on at

    Thanks for the suggestion.

    Can you give sample code for this.

  • GirishS Profile Picture
    27,843 Moderator on at
  • GirishS Profile Picture
    27,843 Moderator on at

    Also try calling the FormDataSourceName.clear(). For example, HcmWorker.clear() or HcmWorker.delete().

    Thanks,

    Girish S.

  • JeffGreenrc Profile Picture
    on at

    I tried calling buffer.delete() as well but its giving the same result i.e. deleting already saved/created line and not the new/draft line.

    buffer = formdatsource.cursor()

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
SajeedMullaji Profile Picture

SajeedMullaji 698

#2
Martin Dráb Profile Picture

Martin Dráb 327 Most Valuable Professional

#3
CU10121822-0 Profile Picture

CU10121822-0 320

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans