Inventory Purchase Request System

Hi there Community,

I am trying to build a Purchase Requisition System on Coda modifying the Purchasing system made by @Justin_Hales. The difference is i don’t have any suppliers here.

The question that i am asking here may have an obvious answer but i simply have not been able to figure out the solution even after reading so many helpful articles on this community.

The workflow that i’m trying to build are as follows :

  1. To create a new Purchase Requisition (PR) i will need to add a new PR by clicking the button + Add New PR. This will auto generate the PR number into the Purchase Requisition Table.

  2. I will then add the items that i wish to purchase under the Add Items Purchase Requisition Page

  • First I have to select the Purchase Requisition that i want to the items into
  • The items will be added to the All Orders Table
  • Current Orders Table is showing the items added to the Purchase Requisition selected above.

Basically that’s the workflow that i’m trying to achieve.

The error that i am getting is as follows :

Items move from PR 1 to PR 2

  1. At first i already have Pen added to my Purchase Requisition PR 1

  2. When i try to add Pen to PR 2

  • The Pen will disappear from PR 1 and it will listed under PR 2
    captured (1)

Another GIF to show the problem i’m facing :

Appreaciate any help out here from the community

Here is an embed of my doc :

Thank You Very Much

Hey! The answer is simple: your AddOrModifyRows checks for existing row to modify only on the Item match but not PR match.

Should add AND Order = [choose purchase order] there.

But overall I advise to not use AddOrModifyRows but code the conditional logic explicitly with IF.

  1. First, pull in the “Current order and item” into the Items table as a separate column:
[All Orders].Filter(Order = [choose purchase order] AND Item = thisRow)
  1. Then in your plus/minus buttons code:
  [Current order and item].IsNotBlank(),
  [Current order and item].ModifyRows([Qty Ordered], [Current order and item].[Qty Ordered] + 1),
  [All Orders].AddRow(
    Item, thisRow,
    Order, [choose purchase order],
    [Qty ordered], 1

The reason for that is that you’re more flexible with what you can write in an explicit conditional than you can in an AddOrModifyRows clause; e.g. in the example above you can make use of first pulling in the row to edit (if exists) first and then reusing it, rather than doing the full filter over the ever-growing dataset of All Orders each time you press a button.