Purchase Order - adding fields to the grid  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Purchase Order - adding fields to the grid

Postby Atronics » Thu Feb 18, 2016 10:32 am

In the purchase order form, I want to populate UserdefinedFloat1 with IN_Main.Weight. How is this done?
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Purchase Order - adding fields to the grid  Topic is solved

Postby Mike.Sheen » Fri Feb 19, 2016 9:06 pm

Atronics wrote:In the purchase order form, I want to populate UserdefinedFloat1 with IN_Main.Weight. How is this done?


Pretty simple - add a handler for the lines added event of the purchase order, read the inventory item as an entity and set the UserDefinedFloat1 property of the purchase order line:

Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
      var purchaseOrder = (JiwaFinancials.Jiwa.JiwaPurchaseOrders.PurchaseOrder)JiwaBusinessLogic;
      purchaseOrder.Lines.Added += PurchaseOrder_Lines_Added;
    }
   
   private void PurchaseOrder_Lines_Added(JiwaFinancials.Jiwa.JiwaPurchaseOrders.Line item)      
   {
      if (item.LineType == JiwaFinancials.Jiwa.JiwaPurchaseOrders.Line.OrderLineType.Inventory)
      {
         var inventory = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory();
         inventory.ReadRecord(item.InventoryID);
         item.UserDefinedFloat1 = inventory.Weight;
      }
   }


The attached plugin does this (in C# as you did not specify the preferred language).

I'd also like to direct you to the plugins and licencing post on this forum.
Attachments
Plugin Set PO Line UserdefinedFloat1 to inventory weight.xml
Sample plugin
(30.34 KiB) Downloaded 684 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Purchase Order - adding fields to the grid

Postby Atronics » Mon Feb 22, 2016 3:23 pm

Thanks, Mike.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 6 guests