Method Community

 

Automatically generating work orders, can't add job items.

Last post 11-13-2015 2:47 PM by GroGreen. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-10-2015 7:50 AM

    Automatically generating work orders, can't add job items.

    I've created a button to automatically generate work orders for all customers of a certain class. This works great, however I can't get the action to insert job items into the work order that was just created.

    I've done this by:

    • Looping through my customer list, looking for all the customers that are active
    • Insert Record into the Activity table for the work order
    • Insert Record into the ActivityJobItems table for the job item for the work order.

    I'm assuming this has something to do with the fact the job items are in a different table and they aren't linking with the Activity (work order) I just created.

    Can anyone point me in the right direction for this?

    Thanks!

  • 11-11-2015 11:33 AM In reply to

    Re: Automatically generating work orders, can't add job items.

    Greetings.

    I have a landscape business and I dont work for Method and I can see what your tying to do. While in the work order (wo) have you studied how the "bring job items" action works?  

    Also study how the create invoices button works in the create invoice screen.  That button has lots of actions on inserting items into invoices.  Might learn somthing from that too. 

  • 11-11-2015 12:33 PM In reply to

    Re: Automatically generating work orders, can't add job items.

    Hi John,

    Thanks for the reply, much appreciated.

    I've looked at these buttons, but I'm still missing something that I can't figure out.

    As I mentioned, I can create the work orders fine, but something is stopping me from inserting the (predetermined) job items. I figure it is to do with me trying to insert records into two different tables at the same time. Possibly the record ID of the work order(activity) that was just created?

    Thanks again,

    Greg

  • 11-13-2015 2:27 PM In reply to

    Re: Automatically generating work orders, can't add job items.

    Hi Greg,

    Thanks to John for the Suggestions, definitely some worthwhile actions to look into there.

    Greg, What Im assuming you are missing here that you are not using the correct RecordID when Inserting the Job Items into the Activity.

    When you use the Insert Records Into Table Action when Creating the Activity, The last field in the action is Action Result (for Record ID), when you then go to add the Job Items, youll need to use the Insert Records Into Table action once more to assign this Action Result to the ActivityNo field.

    The reason this works on the stock screen, is because the Customer dropdown actually pre-saves the Required Activity Fields, meaning there is an ActivityNo to be assigned.

    Hopefully this clears things up. Let me know how you go, Happy to help if you need more assistance

    Thanks Greg.

    Regards,

    Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 11-13-2015 2:47 PM In reply to

    Re: Automatically generating work orders, can't add job items.

    Oh wow... it worked!! Amazing, thank you!

    We do snow removal. What I did was create a button that creates work orders for all of our snow removal customers for our plow run. As we never know exactly when we're going out, this way I can instantly create all the work orders for a large number of customers right before we leave for our run. Awesome!!

Page 1 of 1 (5 items)