Change Labels Smart Folder

good afternoon !
I'm developing hum register using smart folder.
You Have to Change labels dynamically assigned this Smart Folder,
I tried to do this way
run setFolderLabels on h_folder ( 'A | B | C | D | E | F | G').
but Returns Next Error
Procedure ADM2 / folder.w Has No Entry Point Para setFolderLabels. (6456)
How should I to do to change the labels?

progress 10.1C adm2

sorry errors
I do not know English
I only know Portuguese
I used google translator
 

Fabio

New Member
You can't change a label by other dynamically.

You need first remove all the labels and then add new labels.

Try this code:

Code:
  DEF VAR cOldLabels AS CHAR NO-UNDO.
  DEF VAR cNewLabels AS CHAR NO-UNDO INITIAL 'A|B|C|D|E|F|G'.
  DEF VAR i          AS INT  NO-UNDO.

  cOldLabels = DYNAMIC-FUNCTION('getFolderLabels' IN h_folder).

  DO i = 1 TO NUM-ENTRIES(cOldLabels, '|').
    RUN deleteFolderPage IN h_folder (i).
  END.

  DO i = 1 TO NUM-ENTRIES(cNewLabels, '|').
    RUN create-folder-page IN h_folder (i, ENTRY(i, cNewLabels, '|')).
  END.

Regards
 

RealHeavyDude

Well-Known Member
Whenever you are dealing with ADM2/Dynamics it is essential to know which super procedures are in your stack. With that knowledge you are able to examine the source code of them an see what is available to you.

In your case you can open the folder.w - which is the base object - source code ( you will find it in %DLC%\src\adm2 - where %DLC% is the installation directory of OpenEdge ). This allows you to examine which internal procuders and functions you can call on the "smart" object.

setFolderLabels is a function - not a procedure therefore ( coded in Internet Explorer IDE ):
Code:
dynamic-function ( 'setFolderLabels' in h_folder, input 'A|B' ).

But: FolderLabels is an ADM2 property ( an attribute of the object - if you want to, but this is not real OO ) and the respective get* and set* functions are in most cases ( as with yours ) are only getters and setters. They just get and set the value but do not perform anything with them. In most cases these properties are used within a specific funtionality - in this case during initializeObject.

That is why you most likely need to follow Fabio's approach. This object has not been designed to change the folder labels dynamically. But you should be careful because, if you delete a folder page, you will most likely lose the objects and their links located on them.

Nevertheless, ADM2 is stone age stuff, dating back to the end of the '90s of last century - almost 20 years old software.

Heavy Regards, RealHeavyDude.
 
Vlw Fabio muito obrigado
saiu melhor que a encomenda
era isso mesmo que eu queria fazer e não conseguia ...

Thank RealHeavyDude
Your tip will be also very useful for me as far as Fabio ..

thank.
 
Top