![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FM10adv - WinXP I have a vendors table with a field indicating which line(s) of business they support (A and/or P). Acct# - LOB vendor1 - A vendor2 - AP vendor3 - P I want to present a page to the managers of those vendors and limit what the manage sees depending on which LOB he manages. Acct# - LOB mngr1 - A (should see vendors 1 & 2 only) mngr2 - P (should see 2 & 3 only) mngr3 - AP (should see all vendors) When the mngr logs in I set a global _LOB to the exploded key for all possible combinations for those he manages seperated by pilcrows (ex- mngr1 sets to A AP PA : mngr3 to A AP P PA). I use this global as the relationship into vendors (named VenorsICanSee). This works great to filter records I can see in the portal and I thought I was done. However I have a related records only value list based on the same relationship which would allow let the mngr to select a different vendor to review but it lists all vendors for all managers. So close... what am I missing? |
#3
| |||
| |||
|
|
FM10adv - WinXP I have a vendors table with a field indicating which line(s) of business they support (A and/or P). Acct# - LOB vendor1 - A vendor2 - AP vendor3 - P I want to present a page to the managers of those vendors and limit what the manage sees depending on which LOB he manages. Acct# - LOB mngr1 - A (should see vendors 1 & 2 only) mngr2 - P (should see 2 & 3 only) mngr3 - AP (should see all vendors) When the mngr logs in I set a global _LOB to the exploded key for all possible combinations for those he manages seperated by pilcrows (ex- mngr1 sets to A AP PA : mngr3 to A AP P PA). I use this global as the relationship into vendors (named VenorsICanSee). |
|
This works great to filter records I can see in the portal and I thought I was done. However I have a related records only value list based on the same relationship which would allow let the mngr to select a different vendor to review but it lists all vendors for all managers. So close... what am I missing? |
#4
| |||
| |||
|
|
Oops - forgot to describe the setup of the value list (VL is named ChooseVendor). The idea is to display the vendor's name which is in the "Contacts" table but record the vendor's acct#. Contacts is tied to VendorsICanSee via the VendorAcct#. This relationship is called ContactsViaVendorsICanSee. In setting up the VL I select "Use values from field" then specify "Use values from first field" = "VendorsICanSee:VendorAcct#". Then I select "Also display values from second field" which is set to "ContactsViaVendorsICanSee:ContactFullName". Then I enable "Show only values from second field" and "Include only related records starting from:ContactsViaVendorsICanSee". |
#5
| |||
| |||
|
|
I would go about it this way: create a key using List( VendorsICanSee:VendorAcct#) The vendor id should be the target field (vendor_id) So left multiline key c_manager_vendors = List(VendorsICanSee::vendor_id) rel fom that to vendors::vendor_id value list based on that rel, starting from ContactsViaVendorsICanSee Attach the VL to the vendor_id field as a VL and the value you SEE will be the vendor name but the value ENTERED will be the vendor id If you want the (redundant) vendor name hard ci=oded i( in similar situations) a second vendor name field can be added in the parent table as a lookup, or script triggered entry... |
#6
| |||
| |||
|
|
GSP@DavClaServ wrote: FM10adv - WinXP I have a vendors table with a field indicating which line(s) of business they support (A and/or P). Acct# - LOB vendor1 - A vendor2 - AP vendor3 - P I want to present a page to the managers of those vendors and limit what the manage sees depending on which LOB he manages. Acct# - LOB mngr1 - A (should see vendors 1 & 2 only) mngr2 - P (should see 2 & 3 only) mngr3 - AP (should see all vendors) When the mngr logs in I set a global _LOB to the exploded key for all possible combinations for those he manages seperated by pilcrows (ex- mngr1 sets to A AP PA : mngr3 to A AP P PA). I use this global as the relationship into vendors (named VenorsICanSee). minor point in a way, but I would suggest the LOB should be a pilcrow separated list (i.e a multiline key) or at leasts have an aecalc or calc that processes it as such. that way, 'combinations' don't matter; actually as you have it it is permutations , the order matters. If the order doesn't matter, it is a Combination. If the order does matter it is a Permutation. So then the global left key would have three possible non null values 1: A 2: A P 3: P This works great to filter records I can see in the portal and I thought I was done. However I have a related records only value list based on the same relationship which would allow let the mngr to select a different vendor to review but it lists all vendors for all managers. So close... what am I missing? |
#7
| ||||
| ||||
|
|
Thank you for your response but I'm not sure I understand your suggestion. (btw - the # in my post was for brevity. I do not use it in the database design). |
|
You say to create a (multiline) key using the list function. (Thanks for pointing me to that function. I never used it before.) I can see where this would return just the desired vendor account numbers which I would then place into a field called c_manager_vendors. Which table would this field be in? Would this be a global field? Should I do this with a script step or use a calculated field? |
|
Then I would set a new relationship from ??? table to the vendors table where ???::c_manager_vendors = vendors::vendor_id. |
|
I think the rest woud make sense after I get this much done. thanks again |
#8
| ||||
| ||||
|
|
Thank you for your response but I'm not sure I understand your suggestion. (btw - the # in my post was for brevity. I do not use it in the database design). |
|
You say to create a (multiline) key using the list function. (Thanks for pointing me to that function. I never used it before.) I can see where this would return just the desired vendor account numbers which I would then place into a field called c_manager_vendors. Which table would this field be in? Would this be a global field? Should I do this with a script step or use a calculated field? |
|
Then I would set a new relationship from ??? table to the vendors table where ???::c_manager_vendors = vendors::vendor_id. |
|
I think the rest woud make sense after I get this much done. thanks again |
#9
| |||
| |||
|
|
As noted in my original post below the LOB is separated by pilcows. "...set a global _LOB to the exploded key for all possible combinations for those he manages seperated by pilcrows..." I'm not sure what an 'aecalc' is, automatic entry? |
|
I already figured out that I could reduce the number of entries in the multiline key if I could assure that the vendorLOB was always alphabetized. For instance in my example below, vendor2 could wind up being either AP or PA depending on the order in which the operator clicked the checkboxes on the setup screen. (also keep in mind that my example shows only two LOBs when in actually this could be any numer depending on the business rules) I tried finding an "Alphabetize" function that I could call during the save script that would insure the LOB field in the vendor table was set alphabetically to AP but was unsuccessful. If I could accomplish this then I would only need to have the A AP and P (combinations - pilcrow separated of course) in my multiline key and would not need to have the PA (permutation) in it. Without a way to do the alphabetizing then I don't see how to avoid the permutations. |
![]() |
| Thread Tools | |
| Display Modes | |
| |