Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS 90 Customer
boboy
Posts: 8
Registered: 11-27-2010
0

Change label text with oUIObj.SetVar

I'm trying to change the text of a label  created in customizer.

I'm running this script from within user created button.

 

I tried:

retVal = oUIObj.SetVar("Test Label", "New Label")

 

but I get error message: "Variable Type Invalid".

 

I tried the same for the MAS label "Comment" in Sales Order Header:

retVal = oUIObj.SetVar("Comment", "test") ,  but instead of changing the text of "Comment" label the value of the Comment textbox was set to "test".

 

How can I address the name of the label then? Is it even possible?

Switcher
BigLouie
Posts: 2,687
Registered: 10-28-2008
0

Re: Change label text with oUIObj.SetVar

Have you ever thought of just going into Custom Office and pulling up the panel and editing. I mean it's just a text box on a panel.

Big Louie No MBA but BMOC
--------------------------------------------------------------------------
You have enemies? Good. That means you've stood up for something in your life.
Sage MAS 90 Customer
boboy
Posts: 8
Registered: 11-27-2010
0

Re: Change label text with oUIObj.SetVar

Yes, I did, but it's not the case here.

I need to change it dynamically depending on some logic in the script.

Super Contributor
connex
Posts: 794
Registered: 10-29-2008
0

Re: Change label text with oUIObj.SetVar

You would still go into Customizer to get the name of the object. It probably starts with "ML_"

Dan Burleson
Sage Authorized Consultant - Ask me about advanced scripting!
e-mail me here
Sage MAS 90 Customer
boboy
Posts: 8
Registered: 11-27-2010
0

Re: Change label text with oUIObj.SetVar

Only some MAS labels are named ML_NAMEOFTHELABEL.

 

These labels can be changed with:

retVal = oUIObj.SetVar("ML_NAMEOFTHELABEL.", "some text")

 

It worked for ML_CUSTNAME:

retVal = oUIObj.SetVar("ML_CUSTNAME", "my customer")

Their type is Multi-Line, however other labels and user created labels are Text type.  I wish I could somehow change them.



Sage Employee
daburke
Posts: 11
Registered: 09-11-2009
0

Re: Change label text with oUIObj.SetVar

Using customizer you can  hide the text label.  Then create a new ML label that you will populate.

Sage MAS 90 Customer
boboy
Posts: 8
Registered: 11-27-2010
0

Re: Change label text with oUIObj.SetVar

But by adding ML field I would have to add another UDF to the table and this is what I want to avoid, by being able to manipulate the contents of the text label.

 

I found that the name of my label object is "Fonted_text_5", but I can not change the text it contains in any way.