Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
business maps/validations/ notDuplicate validation on UI10 field
#1
Hello,
I am trying to implement the map to prevent saving the product witch already exist for the the vendor. So I want to check that there is no saved product with particular vendor_part_no AND particular Vendor name.
I tried the following map, but it does not allow to save product whit the same the vendor_part_no BUT different vendor.
Could you please guide me?

<map>
<originmodule>
<originname>Products</originname>
</originmodule>
<fields>
<field>
<fieldname>vendor_part_no</fieldname>
<validations>
<validation>
<rule>notDuplicate</rule>
</validation>
</validations>
</field>
<field>
<fieldname>vendor_id</fieldname>
<validations>
<validation>
<rule>notDuplicate</rule>
</validation>
</validations>
</field>
</fields>
</map>
Reply
#2
Hi


notDuplicate accepts a list of other fields that you want to combine together to validate them all at once instead of separately as your map above does. Try like this:


Code:
<map>
<originmodule>
<originname>Products</originname>
</originmodule>
<fields>
<field>
<fieldname>vendor_part_no</fieldname>
<validations>
<validation>
          <rule>notDuplicate</rule>
          <restrictions>
          <restriction>vendor_id</restriction>
          </restrictions>
 </validation>
</validations>
</field>
</fields>
</map>

and let us know how it goes.
Joe
TSolucio
Reply
#3
I added this to the documentation.
Joe
TSolucio
Reply
#4
Hi Joe,
No, tis does not work. Maybe because form contains not a vendor_id value but vendor name (ui10field)?
Marijus
Reply
#5
you are correct, it constructs the query incorrectly for uitype 10 fields, I will fix that asap

thanks!
Joe
TSolucio
Reply
#6
this should be fixed, please update, give it a try and let me know
Joe
TSolucio
Reply
#7
(08-27-2020, 10:16 PM)joebordes Wrote: this should be fixed, please update, give it a try and let me know

Hi, Yes, thanks now this works.

Regards
Marijus
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)