Hi,
I am trying to create a trigger in Transaction_Notification that upon Adding a new Business Partner it would determine whether the Federal Tax ID (OCRD.LicTradNum) already exists. If it does exists it should prompt an error.
However the database setup is that there are 2 companies in the database. So CompA and CompB.
Both companies could have the same Customers and Vendors. It is only distinguised by their CardCode.
For CompA, Vendors has a prefix V, so V0001, V0002 ...
For CompB, Vendors has a prefix BV, so BV001, BV002 ...
For CompA, Customers has a prefix: C. So they have the cardcode: C0001, C0002, C0003, ....
For CompB, Customers has a prefix: BC: BC0001, BC0002, BC0003
Card Code | LicTradNum |
---|---|
V0001 | 1234 |
V0002 | 2345 |
BV001 | 1234 |
BV002 | 2345 |
C0001 | 5678 |
C0002 | 6789 |
BC001 | 5678 |
BC002 | 6789 |
V0003 | 1234 |
So upon adding BC002 it would accept the entry since from the list of CompB Customers, this LicTradNum is not listed.
However, if we are to add V0003, an error should prompt saying the LicTradNum already exists.
Hope the explanation is clear enough.
Thanks.