Things you need to know about “Customer” Field Type Part : 2

I hope you have read my previous post about Things you need to know about “Customer” Field Type Part :1. There was a limitation I talked about the customer field, you can’t set default customer type in field using setting or anything functionally .

Today I’ll share and explain a handy Java Script, which allow us to set one entity type as default filter criteria. well it isn’t always you need account and contact as a customer many industries like B2C only deal with individual customer hence contact should be the default for the customer. Yes we can filter customer records on lookup windows , but we are lazy aren’t we.

For a quick reference, here are sample solution to try out.

Set Contact as default customer

Set Account as default customer

 

Behind the scene

What we’ve done is we created a java script , and added a pre-search filter using addPreSearch() method on customer field.Then we provided conditional attribute  in pre-search filter providing contact id and account id to filter the result.

That’s it. you can also filter the data based on another filter attribute by using the same method.

Share your comments and thoughts , if the solution isn’t working for you share the problem in comments.

 

Here is the refrence blog post of PowerObjects.

Restrict Customer Lookup To Account or Contact

 

Leave a comment