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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Delete Resource Type Machine

(0) ShareShare
ReportReport
Posted on by

/// <summary>
/// Inserts or updates the data in target.
/// </summary>
/// <param name="_target">
/// A target buffer.
/// </param>
/// <param name="_callInsertLogic">
/// if value is true then call standard insert API otherwise (false) by-pass.
/// </param>
/// <param name="_callValidateLogic">
/// if value is true then call standard validate API otherwise (false) by-pass.
/// </param>
/// <returns>
/// Returns updated target buffer.
/// </returns>


public Common insertUpdate(Common _target, boolean _callInsertLogic = false, boolean _callValidateLogic = false)
{
Common ret;

if (_target.TableId == tableNum(WrkCtrTable))
{
_target.(fieldNum(WrkCtrTable, IsIndividualResource)) = NoYes::Yes;
}

ret = super(_target, _callInsertLogic, _callValidateLogic);

return ret;
}

Class is DMFWrkCtrTableEntity

 I am just getting started with DMF in dynamics AX and need a little help with the above code.

I have to delete all records from Resource, that are of type Machine. (WrkCtrTable)
But i have to do it beforehand, that every time i want to insert a CSV file, i need to run a code that executes the above request.
The problem i'm having is that every time a new record is read from the CSV, i am not finding it correct to code the delete logic inside the insertUpdate because the previous record read might be deleted as well (if of type machine).
I want to run the delete code only one time, that is before the update is executed, but i am having trouble finding the right methods to implement the logic.

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello Enea,

    Why is it that you need to delete the machine resources?

    Can you explain because I do not understand why this is needed.

    Many thanks,

    Ludwig

  • Community Member Profile Picture
    on at

    Hi,

    The updating logic requires that before each import,  automatically delete all machine type resources. The resources will be recreated through the interface starting from the data contained in the path passed by Machine Management, in this case i import the data from the CSV file.

    This is needed because later on, i have to update each new Resource of type machine with a newly generated working hours Calendar.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Enea,

    If I understand you correctly then your resource machine data come from 'outside' and you constantly create / import new ones. Before you can do that, you always delete the existing ones. Is my understanding right?

    Assuming that this is correct, why you delete the existing resources and do not only import the new ones?

    Best regards,

    Ludwig

  • Community Member Profile Picture
    on at

    Yes, you understood it correctly!

    Tbh, i don’t really know why i should make that approach.

    This is a requirement straight from the functionals. I dont know all the relations behind it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 653

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 463 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 308 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans