Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Running error

Posted on by 365

While we run script as following: ( GP script SQL )

RUN ONLY THIS PORTION IF IT IS "STILL RUNNING" BUT ONLY DO THIS IF YOU ARE SURE ITS NOT}

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 "PCONT";

change table S_Batch_Activity_MSTR;

remove table S_Batch_Activity_MSTR;

warning "Process Completed";

IT show us error message box as:

A remove operation on table "S_Batch_Activity_MSTR' failed, because the record could not be locked.

Please help !

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Running error

    It sounds like you don't have a save table anywhere in your code which will add the record to the database table. You are setting the field values of the table buffer but not saving the table buffer to the database.

    When you installed Dex it should have installed a copy of SANSCRIPT.pdf which is one of the Online Help Manuals. It will explain all the commands much better than I can.

  • cwang Profile Picture
    cwang 365 on at
    RE: Running error

    can you tell me some command about GP,

    Release table

    get table

    change table

    remove table

    save table

    others

  • cwang Profile Picture
    cwang 365 on at
    RE: Running error

    Ok. I do as you said. It seems table no record, whatever we do the set process, why? can you tell me?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Running error

    It sounds to me like the record does not exist.

    I would usually use err() to test I have the record before removing it.

    e.g.

    change table S_Batch_Activity_MSTR;

    if err() = OKAY then

     remove table S_Batch_Activity_MSTR;

    end if;

    If you know the record does exist and there is some other issue you might like to try adding a check error to give you more information on why the change didn't work.

    e.g.

    change table S_Batch_Activity_MSTR;

    check error;

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans