Need help with this Scenario

23 views
Skip to first unread message

prabhakar

unread,
Nov 3, 2010, 1:18:56 PM11/3/10
to salesforce professionals
hi friends,

I have a scenario where i have two objects

1. Territory (Standard Object)
2. Territory Shadow (Custom Object)

Territory Shadow is a replica of Territory object we created this
since there are some limitations of DML Operations on Territory by
Salesforce.

What the task now is when we are trying to delete any record on
Territory Shadow, THe operation should be like this

Based on the TerritoryId field on territoryshadow the logic should
find respective record on territory Object and perform delete
operation on the standard object and then update a field
"Deleted"(checkbox) on territory shadow to true.

This is the scenario so basically i need to change the functionality
of Delete Operation.

I appreciate your suggestions.
cheers,
prabhakar.

charles ravikiran

unread,
Nov 4, 2010, 1:08:01 AM11/4/10
to salesforce-p...@googlegroups.com
Hi Prabhakar,

you need to write a trigger on the shadow object and use a SOQL to retrieve the teritory obj record and perform delete op on the territory obj.

naga krishna prabhakar chimakurthy

unread,
Nov 4, 2010, 12:27:53 PM11/4/10
to salesforce-p...@googlegroups.com
hi charles,

  Thanks for the reply,i tried that before but whats happening is the the record on shadow object is deleting but not the territory record saying the DML operation on territory is not allowed. So its the issue with security settings for territory object by salesforce so now i catched up with different approach by disabling the standard delete button on the pagelayout and created a custom delete button which invokes javascript and calls a webservice method where i perform the deletion of territory . And on territory object i have written a after delete trigger which will update the field in shadow.

cheers,
prabhakar.

Prathap

unread,
Nov 4, 2010, 12:46:48 PM11/4/10
to salesforce-p...@googlegroups.com
Nice approch bro

But why dont you prrfer using a vf page i knoe it will get a lil clumsybin a user/UI perspective.

Still vf is supported than java script right?

Sent from my iPhone

naga krishna prabhakar chimakurthy

unread,
Nov 4, 2010, 12:47:55 PM11/4/10
to salesforce-p...@googlegroups.com
yes that one of the approaches but since the security issue from salesforce its better to use webservices API to overcome this issue.

rao 6308

unread,
Nov 4, 2010, 12:48:48 PM11/4/10
to salesforce-p...@googlegroups.com
Thanks for the advice :)
 
Will have it under consideration when I run across such scenarios

naga krishna prabhakar chimakurthy

unread,
Nov 4, 2010, 12:50:30 PM11/4/10
to salesforce-p...@googlegroups.com
you are welcome these limitations are only for Territory Management. Wne you try to customize the standard territory management you will run into lot of issues which salesforce dont want to expose.

KVm

unread,
Nov 4, 2010, 5:06:29 PM11/4/10
to salesforce professionals
Have you tried a future call to a method that does this? I have seen
problems with accessing User object from Account solve this. If this
is not a workable strategy, can you explain why because I have not
worked on territory management. If it is possible you can find
something about updating user from account (on the discussion boards
from sf). Either way, it would be nice to hear back on this.

On Nov 4, 11:27 am, naga krishna prabhakar chimakurthy
<naga.chimakur...@gmail.com> wrote:
> hi charles,
>
>   Thanks for the reply,i tried that before but whats happening is the the
> record on shadow object is deleting but not the territory record saying the
> DML operation on territory is not allowed. So its the issue with security
> settings for territory object by salesforce so now i catched up with
> different approach by disabling the standard delete button on the pagelayout
> and created a custom delete button which invokes javascript and calls a
> webservice method where i perform the deletion of territory . And on
> territory object i have written a after delete trigger which will update the
> field in shadow.
>
> cheers,
> prabhakar.
>
> On Wed, Nov 3, 2010 at 10:08 PM, charles ravikiran
> <dude.char...@gmail.com>wrote:
>
> > Hi Prabhakar,
>
> > you need to write a trigger on the shadow object and use a SOQL to retrieve
> > the teritory obj record and perform delete op on the territory obj.
>
Reply all
Reply to author
Forward
0 new messages