Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8451

Federal Tax ID

$
0
0

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 CodeLicTradNum
V00011234
V00022345
BV0011234
BV0022345
C00015678
C00026789
BC0015678
BC0026789
V00031234

 

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.


Viewing all articles
Browse latest Browse all 8451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>