Code works in one environment and not another

Hi

I hope someone can help. I have a locally installed instance of Aras, (v12 sp16) and a development instance, same version and service pack.  They connect to the same database.

I have created a button on the manufacturer part from to remove the link to a part and delete a link on the form.

The button code is client side script which initially gets the Manufacturer Part id and passes it to a server side method that does the job of removing the relationship with the Part item.

The client side script then removes a link on the form to the Part.

This all works well in my local installation but when I run it in the development environment the Manufacturer Part id isn't retrieved and passed to the server side method so results in an error.

The button code is:

var inn = aras.IomInnovator;
var mfpID = document.thisItem.getId();
var itemNum = document.thisItem.getProperty("item_number");

var result = aras.applyMethod("oipt_break_OEM_OI_link", "<mfPtID>" + mfpID + "</mfPtID><item_number>" + itemNum + "</item_number>" );
if(!result)
{
return; //no alert necessary, error message thrown by server method
}
else
{
var parentItm = document.thisItem;
var parentID = document.itemID;
var parentAction = 'view';
document.getElementById("part").innerText = "";
document.getElementById("partid").value = "";
// show new item in frame of previous item
top.aras.uiReShowItem(parentID,parentID, parentAction, 'tab view');
alert("Link to component removed.");
}

Can anyone tell me why the same code works in one environment and not in the other please?

Many thanks.

Parents
  • Is this one based on the "Method calls" sample from my own blog? This line looks far too familiar: "return; //no alert necessary, error message thrown by server method" 

    Some quick ideas:

    - Don´t use the "top" attribute. It´s aras.uiReShowItem and not top.aras.uiReShowItem. 
    - It´s document.thisItem.getID() and not document.thisItem.getId()

  • 0 オフライン in reply to AngelaIp

    Hi, yes it's very much based on your sample. It's very strange because I put the same development into our UAT environment and it works.

    I'll make those changes and see if it removes the problem.

    Many thanks.

  • It´s also aras.newIOMInnovator() and not aras.IomInnovator;

    And check the browser debugger for error messages.

    In general, always question samples you find on the internet. They are often outdated regarding both Innovator and JavaScript coding style!

    The training area in the subscriber portal has some hidden documents where Aras describes the does and don´ts in modern´ programming in Innovator. E.g. don´t use "top", don´t use "var", ...


    You are not forced to program as if you were still using Innovator 9.4 with Netscape Navigator:



    Edit: I have discovered that aras.IomInnovator; seems to be fine too, I just never used this variant :)

Reply
  • It´s also aras.newIOMInnovator() and not aras.IomInnovator;

    And check the browser debugger for error messages.

    In general, always question samples you find on the internet. They are often outdated regarding both Innovator and JavaScript coding style!

    The training area in the subscriber portal has some hidden documents where Aras describes the does and don´ts in modern´ programming in Innovator. E.g. don´t use "top", don´t use "var", ...


    You are not forced to program as if you were still using Innovator 9.4 with Netscape Navigator:



    Edit: I have discovered that aras.IomInnovator; seems to be fine too, I just never used this variant :)

Children
No Data