Alex Coppock

Field enforcement based on member of child record

Discussion created by Alex Coppock on Dec 19, 2016
Latest reply on Jan 3, 2017 by Francesca Shiekh

Developers,

 

I have a custom 'Products' module that has a many to many relationship with 'Accounts'. 'Products' has a relation field called "Preferred Vendor". Upon saving (in record view),

if (!_.isEmpty(perferredVendor) && !this.isVendor(perferredVendor)){
// add perferredVendor to the vendor list.
}

isVendor: function(){
   var vendorArr = the array of child vendors

   if(preferredvendor is in vendorArr){

      return true;

   }

      return false;
},

 

Q1: is this the best course of action or is there a better one?

Q2: how do i get the vendorArray and how do I add the perferredvendor relationship

 

the bean .php documentation on how to do this is pretty well defined, but the .js documentation on how to do this seems nonexistant. Is there a better source for .js documentation?

Outcomes