As was done for field events, the methods are called in the form events. In the application menu, select the Events folder (see image below). In the event editor call the total_calculated method.Ĭalling the methods from the form created events.ġ. Create a new OnChange Ajax event for the UnitPrice field.ĩ. Sc_lookup (dataset, "select unitprice from productsĨ. Enter the following source code for the onChange event: Create a new Ajax event for the Quantity field.ħ. Enter the following source code for the onChange event: sc_lookup (dataset, "select unitprice from productsĦ. Create a new Ajax event for the ProductID field.ĥ. In the event editor, call the method calculate_total.Ĥ. Click on the Create event button to finish.ģ. Select the Discount field and select the onChange event. In the application menu, select the Ajax Events folder and click New Ajax Event.Ģ. Creating Ajax events for the detail form.ġ. Enter the following source code for the calculation method: Create a new method called total_calculationģ. In the application menu, select the Programming-> PHP Methods folder.Ģ. The first method is used to calculate the total value of the sum of all items for each order.ġ. Select Currency for the Property Type and enter Total for Name and Label. Enter 1 for field quantity and click Next.ġ0. Select the New field option from the Field menu.ĩ. Change the Allow negative value attribute to Yes.Ĩ. Enter the following instructions for the SQL Select Statement: SELECT ProductID, ProductNameħ. Access the edit search tab for the ProductID field.Ħ. In the application menu, click Fields > ProductID.ĥ. Remove the OrderDetailsID and OrderID fields.ģ. Still in the detail form, open the Positioning fields menu.Ģ. Ready, the Master / Detail form is already created, but now we will customize the fields and create validation rules for the application. Following the wizard, assign the OrderID fields of the two forms and save it. On the application menu, click New detail in the Master form / detail folder.ģ. Return to the master form by clicking on the applications tabĢ. Creating the link between the Master and Detail forms.ġ. Generate the source code of the details form by clicking Generate source in the ScriptCase toolbar. Create a new grid application of type Editable grid view based on the order_details tableĢ. On the application menu, click Select fields to organize the field according to the following table: Blockġ. Edit the properties of the blocks created according to the following image:ġ1. Enter the values for the Name, Label and Order Details attributes.ġ0. Enter the values for the Name, Label and Shipping Information attributes.ĩ. Change the name and label of the block to General Informationħ. On the application menu, click Blocks in the Design folder.ĥ. Delete the fields: ShipVia, ShipRegion and ShipPostalCodeĤ. In the application menu, click Field Positioning.ģ. Create a new simple form application based on the table orders.Ģ. The first (Maestro) is based on the order table and the second (Detail) is based on orders_details. To build this application two forms are created. PHP Master – DetailĮxample This example develops a master application / complete detail.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |