In the training material I am going over it is setting 3 DialogFields as such(I also am showing the table declaration:
CustTable custTable;
dlgCust = dlg.addField(extendedTypeStr(CustVendAc),"Customer account");
dlgGrp = dlg.addField(extendedTypeStr(CustGroupId));
dlgCur = dlg.addField(extendedTypeStr(CurrencyCode));
Then it tries to save the values from the dialog box into the custTable
custTable.AccountNum = dlgCust.value();
custTable.CustGroup = dlgGrp.value();
custTable.Currency = dlgCur.value();
Why is it setting the DialogFields to one extended type just to move it to another? CustVendAc, CustGroupId, and CurrencyCode all do not exist in CustTable. What is the point of doing this?
A side question that is:
The lab I'm working on for this asks me:
Create a new class that will prompt the user for a new customer account number, the name and all fields that are mandatory for the customer records. Use existing methods to validate the record before inserting the record into the database. In the case that not all data was entered, throw an error exception that has the error message: "Please enter all required fields." The code to create the record must be inside a try/catch statement. This must include a catch for the error exception type and display the message: "An error occurred. Please try again.".
It says to get the account number, the name, and all the fields that are mandatory for the customer record. How am I suppose to determine this on my own? I looked at the table and at the new Customer form and it asks for more information than what their solution gives... how do you determine what fields to ask for then?