Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS Partner
JKatulka
Posts: 217
Registered: 07-19-2010
0

Passing variable to script in external link button

I've added an external link button to the IM Item Vendors Maintenance screen and attached a script to it.

 

The CI_ItemCode table has a UDF which contains data that I need to reference in the IM Item Vendors Maintenance script.

 

All of the CI_ItemCode business object's fields, including the UDF I need to reference, are available in the External Link Definition's Variable list, but any CI_ItemCode variables I add to the script come over blank.

 

Am I doing something wrong?  I'm also passing a couple of variables from the ItemVendor business object - these work fine.

 

I would use a business object in the script to retreive the value I need from CI_Item, but this script MUST run on the client as it launches a process that must show up on the client workstation.

 

Any help/suggestions with this would be appreciated.

 

Justin
Sage MAS Partner
JKatulka
Posts: 217
Registered: 07-19-2010
0

Re: Passing variable to script in external link button

Well, I tried getting around this by adding the CI_Item UDF to the Item Vendors Maintenance screen and accessing the value using oUIObj.GetValue,  but I'm getting 'Object required: oUIObj'.

 

I thought a script with oUIObj could be run on the client, but I guess I was wrong.

Justin
Sage Employee
jepritch
Posts: 237
Registered: 08-25-2009
0

Re: Passing variable to script in external link button

Hi Justin,

 

The problem you are encountering is that the Item Code Ui and Item Vendor UI run in 2 separate memory spaces, as they are separate UI objects.  To actually get the values from the Item business object, they would need to be stored or passed through to the other object, or retrieved (as you stated), through the business object, which you can't access if you are running on the client.

Sage MAS Partner
JKatulka
Posts: 217
Registered: 07-19-2010
0

Re: Passing variable to script in external link button

Thank you for the reply jepritch.

 

I've actually added the CI_ItemCode UDF (Display Only) to the Item Vendor screen and it appears with the expected value.

 

The populated field is there staring me right in the face - I just need to get the value into my script!

 

While item code and item vendor are separate UI objects, shouldn't I be able to access the populated UDF on the item vendor screen using the item vendor's oUIObj?

 

Is oUIObj available when running the script on the client?

Justin