function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
scriptagentscriptagent 

database request - possible ?

Hi !
 
I try to connect two tables, which are based on Salesforces.com .
Now I need relationships between some fields. Normally a simply Lookup would be enough and I know a Lookup(where you choose a data set from a popuplist) is possible in Salesforce, but I want an automatic Lookup, for example if UserX == profile_HighManager then 80%...elseif UserX == profile_NormalManager == 60% ........ or if UserX choice productA  then discount 20%
It is only a simple example I have to connect a big pricelist with a decide matrix......is there a way to develop such a thing without programming or will be Apex necessary ?
 
Thank you very much! 
werewolfwerewolf
If it's a fairly basic lookup you can encode it all into a formula field, otherwise you would be advised to use Apex.
ReidCarlbergReidCarlberg
FWIW, you might also consider a workflow field update -- when a record is saved, you can inspect the value of the user role/profile and then update the percentage field.  The advantage would be no Apex && you can more control, in a more detailed way, the conditions that would cause the value in percentage to change.  For example, if you want to track historical percentages even when a user's role changes, you probably want to stay away from a formula field that will change when any of the source data changes.

Cheers!
scriptagentscriptagent

Guys, thank you very much for the ideas.
I used the vLookup and it works!