Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Access methods with type ANY and DATA

Former Member
0 Likes
785

Hi Experts,

In some of the methods of the class, the parameters have input type as DATA or ANY. What does this mean? and how do I access these methods?

More over if I am in a method of class Z1 and I want to access the instance methods of class Z2. How can I do so?

Warm Regards,

Abdullah.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
746

Hi Abdullah,

any - Any data type (suitable for any type)

any table - Internal table of any table type

You can access the methods of another class thru Inheritance.

Regards,

Sai

Hi Abdullah,

any - Any data type (suitable for any type)

any table - Internal table of any table type

You can access the methods of another class thru Inheritance.

Regards,

Sai

4 REPLIES 4
Read only

Former Member
0 Likes
747

Hi Abdullah,

any - Any data type (suitable for any type)

any table - Internal table of any table type

You can access the methods of another class thru Inheritance.

Regards,

Sai

Read only

matt
Active Contributor
0 Likes
746

>

> Hi Experts,

>

> In some of the methods of the class, the parameters have input type as DATA or ANY. What does this mean? and how do I access these methods?

>

> More over if I am in a method of class Z1 and I want to access the instance methods of class Z2. How can I do so?

>

> Warm Regards,

> Abdullah.

ANY means you can call the method with any data type. Whatever you choose.

For your second question, it depends on how Z1 and Z2 are related. If Z2 is not a subclass/superclass of Z1, then you simply instantiate a Z2 object, and call its methods as normal z2_ref->some_z2_method( ).

Read only

Former Member
0 Likes
746

Hi Matthew,

I don't want to initialize this class. There is one instance already there. I am working in CRM Web UI View. I am in a method of a view context node. I want to access the attribute of the other context node of the same view. Depending on the values of that node I have to do process some data.

Warm Regards,

Abdullah

Read only

matt
Active Contributor
0 Likes
746

>

> Hi Matthew,

>

> I don't want to initialize this class. There is one instance already there. I am working in CRM Web UI View. I am in a method of a view context node. I want to access the attribute of the other context node of the same view. Depending on the values of that node I have to do process some data.

>

> Warm Regards,

> Abdullah

Hi Abdullah

I don't follow all the detail, but in terms of general OOP practice, I'll give it a shot:

You're in method of Z1, and you've an instance already of Z2. You want to access some attributes of Z2 from Z1. Are the attributes public or not. If they are, the answer is trivial. If not, then you have some options.

1. Add a public getter method to Z2 which returns the attribute. Then in Z1, do my_attr = z2->get_attr( ).

2. Define Z1 as a friend of Z2 in the class definition of Z2. This will allow Z1 to access the private attributes of Z2 directly.

Regards

matt