• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

How to pass a field into a X/C++ method(function)

Trying to pass a STRING field into a function to remove carriage returns and return the result.  Not sure how to pass a field in X++/C++, and properly declare everything.

Thanks
0
Damian_Gardner
Asked:
Damian_Gardner
1 Solution
 
quale-kaizenCommented:
Damian,

I bilieve this is related to a previous thread:
http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_24343061.html

Now to answer your question, each table/view in AX has a 'Methods' node.
By right-clicking on the methods node of the view or table you can override the system methods,
or you can create new methods of your own.
Given that the method in question is not static, you can access the fields of the current record
by using the 'this' object (take a look at the code snippet).

Regards,
QK
/// this code prints the name and address of the currently selected record
 
void method1()
{
    ;
    info(this.Name);
    info(this.Address);
}

Open in new window

0
 
Damian_GardnerAuthor Commented:
Ok - this makes sense.  Let me try it and see if I can get it to work.  Thanks very much and standby.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now