Refresh Sales Order lines after they are imported

Hi Forum,

I have a script that imports Sales orders from a SQL server, but because some of the lines are kits the components display at the end of the order.

Is there a way in BOI to refresh the Sales Order lines after is imported into Sage ?

Regards,

Manuel Roman

  • 0

    So you have the UI open on the Lines tab, with a BOI script adding lines data, and you want to refresh the grid?  If yes, the easiest way is to invoke the Totals tab (button) and have the user click back to Lines.  I've tried to find a better way to refresh a grid via script, without leaving Lines, but have been unsuccessful.

    If you are in a button script, this might work:

    oScript.LinesAdded = 1 'put in 1 or more
    retVal = oScript.LoadGrid("GD_Lines")    
    retVal = oUIObj.HandleScriptUI() 'this is not always needed

  • 0 in reply to Kevin M

    Hi Kevin,

    Thanks for the prompt response...

    I am importing the order from a SQL server into Sage via BOI.

    When the user opens the order the lines are showing as they are in the SQL table except that the kits components are at the bottom of the order.  I think that maybe doing a refresh the lines will accommodate accordingly ? just a thought...

    One thing though, on those orders i can go in and out or change something in the order and when i come back to the same order the lines are OK.  That's why i think that refreshing the lines it will solve the issue.

    Regards,

  • 0 in reply to mroman

    Look in the imported data for LineSeqNo.  If those values are not in the order you wish, refreshing will do nothing.

  • 0 in reply to Kevin M

    OK, Thanks Kevin...

    One more thing, What event should i use to trigger a script when the user clicks on the Accept button?

    Regards,

  • 0 in reply to mroman

    That is not enough information to base a good answer on.  It depends on what the script does.  If you are affecting line $ amounts in any way, then you need to trigger a script at PreTotals, not PreWrite / PostWrite.

    You can also replace the stock Accept button with your own button script, ending the script with an Invoke button for the regular (hidden) stock Accept button.