I think the best approach to your goal is create a DTL and clone the message directly, then check the value of DG1:4.1 and set the value in target that you want. See below

You can call to the DTL and you'll have your new message.

Regards,
Kurro Lopez

Hi,

if you read your requirements, that is that you have to write in your DTL

The first line copy all your PID in the new destination (green box)

the condition, check if the 11(1).8 has value, in this case, concatenate PID:11(1).1_PID:11(1).2 to new PID:11(1).1

I understand, when you say "move 11(1).8 to 11(1).2 means that the value in 11(1).8 will be empty (red box), if it is not the case, don't use this line.

For other case (step 7). remove the value of the PID:11(1).8

The DTL conditions are executed in order, It means, that the value in PID:11(1).2 in step 3 is the original then it is replaced by PID:11(1).8 in the following step.

This is the test result:

I hope it helps you,

Regards,

Kurro Lopez

In deed,

The problem is in the backspace ($ c (8, ......)) because that character is not recognized in an HTML simulation.

Please, try to change this line:

 f  v#1 q:(v?.1n) " !no number", $c(27,91)_12_"D"

This is the ESC [12D statement which is the same than $c(8) but the WebTerminal is able to interpret it

I hope it helps you

Best regards,

Kurro López

Well, next time I need to read the documentation in depth.

There is a base method to check if a class extends of other one

set obj = ##class(MyLibrary.ChildClass01).%New()

## this retrieves 1
w obj.%Extends("MyLibrary.ParentClass")

## this retrieves 0
w obj.%Extends("MyLibrary.ParentClassFake")

This has been a "Rubber duck", this is a sample of guide-book of rubber duck. wink

More info Clase %Library.SystemBase

Best regards,

Francisco López

Hi,

Try the following code. It only works if the class parent is Ens.DataTransformDTL

// Create a query to get only my class (in MyClass and sub folders)

set query="SELECT ID FROM %Dictionary.ClassDefinition WHERE ID LIKE 'MyClass.%' AND super='Ens.DataTransformDTL'"

set tStatement = ##class(%SQL.Statement).%New() 

set qStatus=tStatement.%Prepare(query)

set tResult = tStatement.%Execute()

while tResult.%Next() {

   set dtlName = tResult.%Get("ID")

   set classObject = $CLASSMETHOD(dtlName ,"%New")
   
   write !,"DTL: "_dtlName
   write !,"Source type: "_classObject.GetSourceType()
   write !,"Target type: "_classObject.GetTargetType()
   write !

}

Remember: It works only if the class inherits from Ens.DataTransformDTL , if you know which class is the one that inherits the DTL you want to examine, change the name of the value of 'Super' in the previous query

Best regards,

Francisco Lopez

Please, use the DTL class properties

set obj=##class(EXC.DTL.Lamont).%New()

write 'Source type: '_obj.GetSourceType()

write 'Target type: '_obj.GetTargetType()

Have a look the following documentation

Ens.DataTransformDTL

Best regards,

Francisco López

Hi,

You need to map the other Global database into your namespace. This is the only way to have visibility of other database