I'm new to developing in Microsoft Dynamics 365FO and I'm having some trouble with opening a new form and sending my selected field to it.
I'm currently making a Complaints form where it is possible to enter complaints about orders.
I want to add a button to the SalesTable which redirects you to the complaints form and enters the information of the selected field in the complaints form.
Right now I made a form extension of the SalesTable and added a MenuItemButton. I also made a Class called SalesTableEventHandler that should trigger when the button is clicked that contains the code below.
In this class I have some code that keeps giving me errors that is not able to find my class, table or an extended data type.
The form is called ComplaintRegistrationMaster and the table ComplaintRegistration.
I would like some help with either fixing the error so I can continue or with someone suggesting a better way to do this.
public static void OnMenuItemButtonClick(FormRun _formRun, Object sender, FormDataSourceEventArgs e)
{
SalesTable salesTable;
ComplaintRegistrationMaster registrationForm;
salesTable = _formRun.dataSource().cursor();
registrationForm = new ComplaintRegistrationMaster();
registrationForm.init();
registrationForm.queryBuildDataSource().addRange(fieldNum(SalesTable, SalesId)).value(salesTable.SalesId);
registrationForm.queryBuildDataSource().addRange(fieldNum(SalesTable, CustAccount)).value(salesTable.CustAccount);
registrationForm.run();
}
error one:
Severity Code Description Project File Line Suppression State
Error The name 'ComplaintRegistrationMaster' does not denote a class, a table, or an extended data type. ComplaintRegistration (USR) [ComplaintRegistration] C:\AOSService\PackagesLocalDirectory\Bin\XppSource\ComplaintRegistration\AxClass_SalesTableEventHandler.xpp 6
error two:
Severity Code Description Project File Line Suppression State
Error Class 'ComplaintRegistrationMaster' was not found. Are you missing a module reference? ComplaintRegistration (USR) [ComplaintRegistration] C:\AOSService\PackagesLocalDirectory\Bin\XppSource\ComplaintRegistration\AxClass_SalesTableEventHandler.xpp 10