Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Lock/unlock table from GP script

Posted on by 365

We have multiple users to run following script:

{add a batch activity record so that this doesn't get run twice}

set 'D_Batch Source' of table S_Batch_Activity_MSTR to "JTETRX";

set 'D_Batch #' of table S_Batch_Activity_MSTR to "JTETRX";

set 'D_User ID' of table S_Batch_Activity_MSTR to "PCONS";

change table S_Batch_Activity_MSTR;

save table S_Batch_Activity_MSTR;

.......

{Copy this code below below to clear the error}

set 'D_Batch Source' of table S_Batch_Activity_MSTR to "JTETRX";

set 'D_Batch #' of table S_Batch_Activity_MSTR to "JTETRX";

set 'D_User ID' of table S_Batch_Activity_MSTR to "PCONS";

change table S_Batch_Activity_MSTR;

remove table S_Batch_Activity_MSTR;

warning "Process Completed";

In this script, we have "save" " remove" record on table S_Batch_Activity_MSTR.  this script is in client side not in server side. How can we lock this table  while one user running script, and do not let other running it?

*This post is locked for comments

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Lock/unlock table from GP script

    It's not enough to add the batch activity record. You also need to change the Batch Status in the Batch Headers table. Also, it would help to know what you are trying to do.

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