The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Inserting into SUBSCRIPTIONRULES
Posted: 07 Feb 08 11:44 PM
|
re: v 7.2 We need to apply fairly complex logic in designating the accounts to sync to each remote user. I am interested in programmatically creating subscription rules to achieve this but am getting stopped in populating SUBSCRIPTIONRULES.DATA - by what method can I transform the query into binary data for this column?
If there is some other method of programmatically designating the accounts to which a user is subscribed, I would appreciate any pointers to that too.
thanks > Brian |
|
|
|
Re: Inserting into SUBSCRIPTIONRULES
Posted: 07 Feb 08 11:48 PM
|
Brian if you can list your criteria for determining the subscription rules, most of us here may be able to help come up with a better mouse trap for simplifying your logic before going down the road of trying to save your binary data in to the data field.
|
|
|
|
Re: Inserting into SUBSCRIPTIONRULES
Posted: 08 Feb 08 8:01 AM
|
Brian, Not a good area to go into.... there's a lot of things happening under the covers w/subscription and you will only succeed in completely trashing the system. Forget trying to do subscription by code.
You need to use the tools as provided by SalesLogix in the ADMIN. This is the only way you can build subscription correctly.
Also, the internals of SalesLogix constantly change and there is no guarentee that what you do (via code) w/subscription will continue to work.
-- RJLededger - rjlSystems |
|
|
|
Re: Inserting into SUBSCRIPTIONRULES
Posted: 08 Feb 08 11:01 AM
|
RJ: You are confirming the suspicion I had that this approach would be a bit risky…
To Matt’s question: > we sell to physicians in the US > we have two distinct sales teams, each having territories defined by zip codes > a territory in sales team A will have zip codes in common with 1..n territories in sales team B > all members of sales teams are remote users > we need to have one contact record for each physician, but reps within both team territories corresponding to a contact record need access to this record since both sell separate product to the same physician
I have considered two approaches: 1 -- use teams > construct a SLX team for each set of distinct shared zip codes (there will be hundreds of such teams due to asymmetry of territories between sales teams) > assign sales reps to all SLX teams necessary to give them all their zip codes > I am fairly sure this will work but will be messy – I envision programmatically populating SECCODE and SECCODEJOIN to do this since the definition of territories and zip relationships exist in a separate database
2 – subscription > have all accounts owned by EVERYONE > create and populate a SLX table defining the relationship between user and zip codes > create a subscription template selecting all account with the user_zip table > create/assign a subscription rule for each user (from the template) in which the userid is specified >> this is the step I was hoping to be able to do programmatically – inserting into SUBSCRIPTIONRULES, however, since this would be a one-time step, it is practical to do manually
If anyone has other thoughts on how to tackle this, I would appreciate hearing them.
thanks
|
|
|
|
Re: Inserting into SUBSCRIPTIONRULES
Posted: 08 Feb 08 11:37 AM
|
I would go with approach number 2:
once you setup a small table with a userid and zipcode field to manage zip relationships, you can just add the criteria to the subscription rules as follows:
field: account.address.postalcode operator: IN value: (select postalcode from mytable where userid = ) and check 'use value as a literal'
It may be that you can use some form of (select postalcode from mytable where userid = :userid) to make it more dynamic, but I think it will balk if you try and use 'use value as a literal'
to make your life easier, you may want to do zipcodes by salesgroup then you can just have two rules (select postalcode from mytable where salesgroup = 'A') and (select postalcode from mytable where salesgroup = 'B') |
|
|
|