Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to make a Form and it's Data Source User Independent

Posted on by Microsoft Employee

Hi All,

I have created a form in an user can filter records using dates and Print report.

I am making use of  a TempTable  as Form's Datasource.

So whenever an user open up this form the data will be deleted so that it's grid looks empty.

Now the problem is weird scenarios raising when multiple users accessing the form simultaneously.

For Ex :

simultaneously USER 1 and USER 2 accessing the form , now either of those two user has to wait or it wont works for both the users . I mean just going to not responding state.

Please suggest me a solution to proceed further.

Regards,

Nishath Salman N.

*This post is locked for comments

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to make a Form and it's Data Source User Independent

    Did you review article I posted before ? You need to change table type to "inMemory". Please review both articles provided by me and ask questions if any.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make a Form and it's Data Source User Independent

    I am very Sorry that I have confused you all by using the Term (TempTable).

    What here I mean Temp Table is , I am using few fields from (InventTableModule,InventTable,SalesLine) and have create a Table Called (tmp_InventTableModule) for Temporary Use.

    May Be I have incomplete info or less knowledge.

    Please let me know how to proceed further .

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to make a Form and it's Data Source User Independent

    If you use temporary table you don't need to delete anything because temporary table does not contain any data. Please read about temporary table on msdn msdn.microsoft.com/.../bb314749.aspx

    So using temporary table you will always have empty form.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make a Form and it's Data Source User Independent

    Sure I ll share my Code.  I would also like to tell that . I have written code to delete data in form's init() method  so that the Form's Grid should go empty whenever the Form is opened. That's how the Client's requirement is.  Because this form is used to filter some records and printing report as on.  So Every time it should open with Blank Grid so that every individual user will be able to print only required records.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to make a Form and it's Data Source User Independent

    Hi Microsoft Mania,

    Could you share your code or explain how do you use temp table for printing ? Because AX does not delete any data and each user should work with it's own version of a table.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make a Form and it's Data Source User Independent

    Hi Martin,

    Yes The Table is Temporary Only.

    Only Problem now is multiple users cannot access the form as there is just one Temp Table.

    Because if one has given Print command then the report should basically be using the Temporary data for records.  Meanwhile if second user opened the form the data will be deleted as per the requirement. But the Print request for the first user is still in Progress now due to second user open the same form it has deleted the data while it is being fetched by the First User Print Command.

    Hope you understand.

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: How to make a Form and it's Data Source User Independent

    Could you please elaborate what you mean by "either of those two user has to wait or it wont works".

    Is the table really temporary?

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to make a Form and it's Data Source User Independent

    Hi Microsoft Mania,

    Could you please give us details of your solution ?

    As far as I understand you use real table and delete data on form open ? That is not the best approach, please use temp table instead and you won't have this issue, you can find example in next blog post community.dynamics.com/.../ax-2012-using-temporary-table-as-form-s-datasource

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans