Method Only Works when There Is A BreakPoint

Questions, tips and tricks and techniques for scripting in Servoy

Method Only Works when There Is A BreakPoint

Postby itgenetics » Tue Jan 10, 2012 4:59 pm

Hi Guys,

Really frustrated I have composed the method below:

Code: Select all
function get_bom_items_pt_1() {
   globals.bb_so_order_id = forms.opl_frm_order_lines.soh_order_number
   forms.dev_order_lines_table.controller.show()
   forms.dev_order_lines_table.controller.find()
   forms.dev_order_lines_table.sor_order_id = globals.bb_so_order_id
   forms.dev_order_lines_table.sor_bom_master = "1"
   forms.dev_order_lines_table.controller.search()
      while (databaseManager.getFoundSetCount(forms.dev_order_lines_table.foundset) > 0) {
      globals.bb_product_id = forms.dev_order_lines_table.sor_product_code
      globals.bb_bom_master_qty = forms.dev_order_lines_table.sor_quantity
      forms.dev_bom.controller.show()
      forms.dev_bom.controller.find()
      forms.dev_bom.bom_parent = globals.bb_product_id
      forms.dev_bom.controller.search()
         while (databaseManager.getFoundSetCount(forms.dev_bom.foundset) > 0) {
            globals.bb_component_id = forms.dev_bom.bom_child
            globals.bb_bom_qty = forms.dev_bom.bom_child_qty
            forms.dev_order_lines_table.controller.show()
            forms.dev_order_lines_table.controller.newRecord()
            forms.dev_order_lines_table.company_id = globals.bb_company_id
            forms.dev_order_lines_table.sor_order_id = globals.bb_so_order_id
            forms.dev_order_lines_table.sor_product_code = globals.bb_component_id
            forms.dev_order_lines_table.sor_operational = "1"
            forms.dev_order_lines_table.sor_po_qty = globals.bb_bom_qty * globals.bb_bom_master_qty
            forms.dev_bom.controller.show()
            forms.dev_bom.controller.omitRecord()   
         }
      forms.dev_order_lines_table.controller.omitRecord()
      }
}


However, it only seems to work when there is a breakpoint set at the second while statement. Can anyone help with this? This is my first largish method and I have found it quite laborious....

Thanks in advance
itgenetics
 
Posts: 63
Joined: Fri Apr 08, 2011 11:26 am
Location: Cambridge, UK

Re: Method Only Works when There Is A BreakPoint

Postby itgenetics » Tue Jan 10, 2012 5:02 pm

Just to be a little more specific: the records that were created earlier in the script seem to vanish.
itgenetics
 
Posts: 63
Joined: Fri Apr 08, 2011 11:26 am
Location: Cambridge, UK

Re: Method Only Works when There Is A BreakPoint

Postby itgenetics » Tue Jan 10, 2012 5:28 pm

I've answered my own question! I had not loaded all records back at the end of the method. That meant that if I tried to run it again the omitted records stayed omitted. Important lesson learnt!
itgenetics
 
Posts: 63
Joined: Fri Apr 08, 2011 11:26 am
Location: Cambridge, UK


Return to Methods

Who is online

Users browsing this forum: Bing [Bot] and 2 guests