This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - BOM export with Java (html field code)

BMoberg - Thursday, August 21, 2014 9:55 AM:


I've tried the java-script to open a BOM in Excel, as specified in Programmers guide, 7.22 on page 61.

The problem is that it isn't always reliable.

Here's the steps to reproduce:
1) I open a part
2) I click on the button to execute the script, I confirm the ActiveX, and it opens correctly in Excel.
3) I close Excel
4) I add another part to the BOM and save it (I do not close the form! Just press save)
5) I click on the button to execute the script, Now I don't need to confirm the ActiveX?, and it opens without the change, in Excel!
6) I then close both excel and the part, and then re-opens the part.
7) I click on the button to execute the script, I now need to confirm the ActiveX again, and it opens correctly in Excel.

So, how can I make the script open the correct BOM every time? Clear a cache in the script?
I don't want to close the form in order to have the lastet BOM configuration.

 



DavidSpackman - Wednesday, August 27, 2014 4:34 AM:

Hi Benny, 

 

The function that gets the BOM data is MyOnloadHandler(). This function queries the server to get the Part BOM data.

If you have a look at the code it is only called once when the form is loaded.

 

To solve this you could also call MyOnloadHandler() from within openExcel(), that way every time you press the button the server will be queried.

 

However you may also have some other issues

  • If you make a change to the Part BOM, but have not saved the Part itemtype, that information will not have been saved back to the server.

 

It is possible to check the item to see if changes have been made and have not been saved back to the server. If you want I can provide a solution to help.

 

However it is already possible to export the BOM tab to Excel (See the Export to Excel button in the BOM tab)

Why do you need another button?



BMoberg - Wednesday, August 27, 2014 7:20 AM:

Thanks for the reply David,

I'll try that solution!
I quess there is also a possibility to add a "save function" in the button as well to control that everything is saved.
We use Aras 100% customized (no OOTB items) so that we control and understand everything we need, thats why I'm trying this