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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Work Order messing up thanks to Run Time Error '91

(0) ShareShare
ReportReport
Posted on by

I've been working on a large job for a few months. I've been in and out of the work order for this job multiple times over this time, but when I tried to open it today, I got a run time error "Run-Time Error 91 Object Variable or With Block Variable Not Set"

When we first started with RMS (in 2007), we had some transactions on hold get stuck thanks to the same error. They have just been left hanging out there because they didn't effect inventory in any way. However, the work order does cause issues. If I just put everything back in, the system will say I need to order $45,000 worth of equipment that I don't need.

Is there a way to fix the run time error?

or

Is there a way to delete the work order that's held up?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    To Delete:  

    Log into SO Manager and goto the purchase order screen.  Select the purchase order and choose delete (button on the right side).  Click Yes to confirm.

    To fix we would need to track done the cause of the issue in the work order.  Error 91 can be just about anything.  

    First thing to try is to open SO Admin and connect to database.  Then under Database menu run a a ReIndex.  

    Also one question:  Since the entry of the purchase order, have you deleted any suppliers, items, or categories/departments from the database?  This can cause problems.

    Thanks

    Ed

  • Community Member Profile Picture
    on at

    It's actually a Work Order that's messed up, not a Purchase Order. Is there a way to delete a Work Order?

    I don't believe we deleted any items, suppliers, or categories.

    When I do the ReIndex, do I need to shut down any RMS programs on the other computers first?

  • Verified answer
    Community Member Profile Picture
    on at

    sorry about that.  I read the post but was working on a Purchase Order problem for a client.  

    So normally you delete a workorder like this:

    Recall the work order and delete off all items on the sales screen.  Then press tender.  Select the option which is Save Changes.  

    This will then remove the work order from the recall list.

    But if you can't recall the workorder then you are going to have to delete the records from the database manually.  

    Please make a Backup for the database First.  Also note this will make your books not balance, unless you account for the workorder deposit. 

    Open SO Admin.  Connect to the database.  Click the "New Query" sheet of paper button.  Then type in the following.  Select * from [order] where type =2 .  This will list the open workorders in the system.  

    Write down the number in the ID column.  also note the amount in the Deposit column.  This is the amount deposited to hold the order.  This is reflected in several tables and financial reports.

    Then run these next two queries, replace everything after id = 

    delete from [order] where id = {the ID number you wrote down} 

    delete from [orderentry] where orderid = {the ID number you wrote down} 

    delete form [orderhistory] where orderid = {the ID number you wrote down} 

    Also you could try fixing the issue,  If you see any large numbers in the select statement.  

    Good Luck.

  • RMS Wizard Profile Picture
    1,205 on at

    Follow Ed Weber's instructions to remove the offending work orders.

    To avoid this problem in the future make sure not to delete any table entries used for item attributes. For example, in Store Operations Manager, Database, Discounts you can create discount schemes for items. If a discount scheme is applied to an item and that item is saved on a work order, the associated scheme is saved along with it. If you then delete the scheme and try to recall that work order in POS, Error 91 will appear since the referenced table entry is now missing.

    As a general rule never delete database table entries that may be in use somewhere in the system as this will orphan those records.

  • Community Member Profile Picture
    on at

    Thank you both! I think this will be the solution, but something's not working right and I can't do the back up. Frighteningly, it looks like the database has not been backed up for a year! (although the owner thinks I'm not reading it right).

    Anyway, I'm not taking a chance on messing up everything, so I'm having our tech services guy come out on Monday.

    Oh, and as to the concern about a deposit, we don't use the deposit feature (we just do an over payment on their account and apply it to the sale when all is said and done), so that fortunately won't cause any problems.

  • Community Member Profile Picture
    on at

    This ended up working, but it took me a little bit to realize I needed to delete the brackets {} as well.

    Thank you for your help!!!!!!

  • Suggested answer
    Community Member Profile Picture
    on at

    I am glad to here everything is working again.   Thanks for the feedback.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans