+ Start a Discussion
apex code shareapex code share 

Please help me writing a trigger for cross checking of UIN's in different objects.



I have an custom object SALES RETURN:- in this i have a field EXTERNAL UIN.

Now when any input is given in this field.Firstly it should check whether this UIN already exist in the custom object UIN MASTER.

NOW, if it exists then it should check whether external UIN which is associated with 3 internal uin (i.e for mechanic,reborer and retailer) in another object say Coupon submission and therefore if the status field for any of the internal UIN is "submitted" then it should show an ERROR message 'INVALID UIN' .


 just for understanding:

We have erternal UIN which are associated with  internal UIN's (1 or 2 or can be 3)

Now we are just checking whether any external UIN or any of its associated internal uin is already submitted in the system.