Update fields when field.change

My have few pricing fields in the product master file.

  1. My Cost
  2. Dealer Price
  3. Bulk Purchase
  4. Consumer - List Price (SRP)

When I create an Invoice (header), I do select the customer role (Dealer | Bulk Purchaser or Consumer).
In invoice items, I select product(s) from the product master file.
my field to show in the entry form for product details are:-
Item (Seq no.) | Prod Code | UOM | Qty | Price | TotalWhen I select customer role as Consumer, I need to retrieve the correct pricing from the product master file.
But the product do have the Unit of Measurement (UOM) [eg. Box, Pc, Ctn & etc] for each product.When I selected an item from the dropdown menu, I want the field UOM and Price to be automatic fill up.
I try to put this code in client site add/edit page to test
$(“#x_productid”).change(function() {
alert($(“#x_prodcutid”).val());
});
An Alert box popup and show the correct proudct ID.But my idea to achieve this
$(“#x_productid”).change(function() {
// below 2 fields are not editable, set in add/edit Page_Load()
// $this->uom->ReadOnly = TRUE;
// $this->price->ReadOnly = TRUE;
$(“#x_uom”).val({value retrieve from product master record});
$(“#x_price”).val({value retrieve from product master record by customer type});
});*** how I gonna get {value retrieve from product master record} & {value retrieve from product master record by customer type}.Thank you.

You may refer to “Example 4 - Auto-Fill asynchronously by custom API action and client script” under “Lookup Table” topic of PHPMaker Help menu.

mobhar wrote:
You may refer to “Example 4 - Auto-Fill asynchronously by custom API
action and client script” under “Lookup Table” topic of
PHPMaker Help menu.I used ‘REST API’ → ‘Create Your Own API Action’ ($API_ACTIONS) to get the results.