• davidesi
  • NEWBIE
  • 55 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 20
    Replies
Hi,
I need to know which users has access to an opportunity or an account.

I know that using  the table UserRecordAccess I can know if a specified user has access to a specified record, but I would need to konw all the users who has access to a record.
Is that possible?

Thank you very much
I'm facing a very weird problem.
I have a class called from AfterInsert that take a list of inserted events , process them and after saves them.

If I insert a single record with workbench, it works fine, but if I insert for instance 11 records, I can see in the debug log that 11 records are inserted but If I try to click on one of the Ids that have been inserted, I get an error saying that that record doesn't exist.

Anybody can help with this?
 

We have a class that yesterday was working ok, but today when we try to add a user to a campaign,
we get this error:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CampaignUsersAfterInsert caused an unexpected exception, contact your administrator: CampaignUsersAfterInsert: execution of AfterInsert caused by: line 2, column 44: trigger body is invalid and failed recompilation: Dependent class is invalid and needs recompilation: Ap02Campaign: line 18, column 14: Field is not writeable: CampaignShare.CampaignAccessLevel

When you access to this class (Ap02Campaign) , now it is uncompiled, and if you try to save it you get the following error:
Field is not writeable: CampaignShare.CampaignAccessLevel
The fact is that the same class is saved and working in thifferent environments (Cert, Pre, production ...)
Anybody knows why of the error?
I spent a lot hours during the day rebooting eclipse.

It usually starts working fine, but a couple of times after polling changes to server, it gets blocked. Sometimes I have waited to see how long does it takes, and after 20 minutes I have desisted. Then I reboot eclipse, and it works fine again ... only 2 or 3 times.

Any suggestion?

I use to leave aside the eclipse and work directly on salesforce, but I'd preffer working on eclipse.
Hi All,
I have a trigger onUpdate & onBefore for Opportunities.
When it's triggered, it reads a opportunity field and updates the owner of the opportunity.

It works fine with any change I do on the opportunity, except if I change the owner.

In the debug log I can see that the trigger is fired, and it change the owner, but the opportunity finally doesn't have the owner assigned in the trigger but the owner that I have selected with the lookup.

Any help?

Thanks in advance
Hi!
I'm trying to reassign the actor of an approval process and I'm getting that error : INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY


This is the main code:
try{

  Approval.ProcessResult result=AprobacionHelper.aprobarOportunidad(op, obs); 
 
  System.debug('resultado de la aprobación ========>' +result);
 
  Reasignacion__c r = AprobacionHelper.recuperaAprobadorReasignadas(op.Id);
  if (r!=null){
  
   List<Id> newWorkItemIds= result.getNewWorkitemIds();
    ///
    // First, get the ID of the newly created item

   List<Id> nwii = result.getNewWorkitemIds();
    ///
         AprobacionHelper.reasignar(nwii, r);
  }
           }catch(Exception e)

And the methods:

public static Approval.ProcessResult aprobarOportunidad(Opportunity op,Observaciones__c obs){


  Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();

        req1.setComments(obs.Observacion__c);
        req1.setObjectId(op.Id);       
        // Submit the approval request for the account
        Approval.ProcessResult result = Approval.process(req1);
        return result;
 }

public static void reasignar(List<Id>newWorkItemIds,Reasignacion__c r){
   Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();
  req2.setComments(r.Comentarios__c);
  req2.setAction('Approve');
  req2.setNextApproverIds(new Id[] {r.aprobador__c});
  req2.setWorkitemId(newWorkItemIds.get(0));
  Approval.ProcessResult result2 = Approval.process(req2);

  }
And there I got following error message:
10:35:11.596 (596521000)|EXCEPTION_THROWN|[57]|System.DmlException: Process failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
10:35:11.597 (597507000)|SYSTEM_METHOD_EXIT|[57]|Approval.process(Approval.ProcessRequest)
Hi.
I have a trigger that makes an evaluation, and if it is wrong I add an error message .

It is supposed to show only an Error alert, but it shows an Error and a Warning message.

Do you know why?

Error and Warning

Hi.
I have one email alert that works fine for me (administrator), but it doesn't works for other users.
I have created an email alert that triggers when one opportunity field is modified (opportunity status). I have tested with my user and it works fine for me, but it doesn't works for others profiles.

I have looked for any activation field in user settings page, with any result.

 

Any help?

Is possible to show mini console view when a user hover the mouse in a list of opportunities?

 

 

 

Hi to all.

I have been searching that problem in internet but I haven't got it.

 

I have a VF page with a commandButton, and when it is clicked I need to disable that button and send the form. It works fine with IE and Chrome , but it's not working with Firefox.

 

Here is my code:

 

<apex:form >
<apex:actionFunction name="enviarFormulario" action="{!OK}"/>

 

 

<apex:commandButton value="Confirmar"   id="confirmar" onclick="buttonsEnabled(false); enviarFormulario();" disabled="{!if(errorTimeout,true,false)}"/>

 

 

and here are the javascripts

function buttonsEnabled(enable) {
var $buttons = jQuery('.btn[id$="confirmar"]'); // find all buttons in the page
if (enable === false) {
$buttons.toggleClass('btnDisabled', true).attr('disabled', 'disabled');
} else {
$buttons.toggleClass('btnDisabled', false).attr('disabled', null);
}

}

 

 

Any advice with it?

 

Thanks in advance

Hi to all.

I am trying to test the email sending when an opportunity field is changed.

I have followed below steps:

1)Create a work flow rule.

AND( ISCHANGED(Approval_Status__c ) , NOT ISPICKVAL( Approval_Status__c , 'Abierto') )

2) With following "Immediate Workflow Actions"

Email Alert envio al propietario

 

Description envio al propietario Email Template Oportunidad enviada a ANEG automaticamenteUnique Name envio_al_propietario Object Opportunity From Email Address Current User's email address     Recipients Opportunity Owner Additional Emails  

 

The rule is active, and I am opportunity owner. I receive other emails from Salesforce (so it is not problem of spam).

 

Why I don' receive any email?

I should receive an email when the field "Approval_Status__c " would change, but I don't.

 

Thanks in advance for your help

 

Hi!

When a user updates one opportunity with approved status, I need to change the opportunity status and modify its approval process process.

 

For updating the opportunity I have made a workflow rule that works fine, but I am not able of update its approval process status.

 

My code is below, and it is fired correctly within a trigger:

 

public static void cambiarEstadoAprobacionOportunidad(Opportunity opp){
        List<ProcessInstanceWorkitem> workItemList;
            
        try
        {
    /*        opp.Approval_Status__c='Abierta';
            opp.Production_Approval__c=False;
            update Opp;*/
            }
            Catch(DMLException e)
            {
            opp.addError(e);
            }
        for (SObject s:[SELECT STATUS from processInstance where TargetObjectId=:opp.Id]){
        
        System.debug('Estado ' + s);
        }
        List<ProcessInstance>  processList =  new List<ProcessInstance>();
        processList =[SELECT Id, Status FROM ProcessInstance where TargetObjectId=:opp.Id and (Status =: 'Pending' OR Status=:'Aprobado')];
        Set<ID> idSet = new Set<ID>();
        for(ProcessInstance p :  processList)
            {
            idSet.add(p.Id);   
            }
        workItemList = new List<ProcessInstanceWorkitem>();
        workItemList = [Select id from ProcessInstanceWorkitem where ProcessInstanceId in: idSet];
        for(ProcessInstanceWorkitem w:workItemList)
            {
            Approval.ProcessWorkItemRequest pwr = new Approval.ProcessWorkItemRequest();
            pwr.setWorkitemId(w.id);
            pwr.setAction('Removed');
            Approval.ProcessResult pr = Approval.process(pwr);
            }
}

I want to get all the fields of an object.

Is there any way to get the whole object? Or I need to write the full query? My object has more than 200 fields (I can write them copying and pasting, but if exists another way ...

 

 

Thanks

 

 

I have a visual force page which shows a list of Accounts. Then the user select one account, and when he clicks the button it should assign that selected account as the Parent account in another Account.

 

 

Account a=[Select Id,Name from Account WHERE id=:ApexPages.currentPage().getParameters().get('id')];

Account parentAccount = [Select Id,TIN_Company__c, Name from Account WHERE id=:selectedValue];

 

a.Parent=parentAccount ;

 

try{

Update a;

}catch (Exception e){

}

 

When I execute that code I get no error, In the log I can see the name and Id of both accounts, but no update is performed.

What am I doing bad?

 

Thanks!

I want to add a magnifying glass image close to a input field, so when the user click on the image it opens a new window.

 

if I write below code

<apex:inputField value="{!account.Parent.Name}" label="{!$Label.Padre}"/>
<apex:commandButton action="{!cancel}" value="Save" id="theButton" title="" image="{!URLFOR($Resource.lupa)}" />

 

I get the image very far from the input field.

 

Anyone can help me on this?

 

Thanks

Hi to all.
I'm having an extrange behaviour with Opportunity object, and I'd like to ask for help.

The Opportunity object has an picklist field, name "A".

I have two different recordtypes "Y" and "Z" ,and each recordtype shows a unique value.
recordtype "Y" -> value "1"
recordtype "Z" -> value "2"
Also picklist field "A" is hidden for all profiles.

The point is that sometimes an recordtype "Y" opportunity is sending value "2" , and recordtype "Z" opportunity sends value "1". (It occurs less than 1% of the times).

Anyone knows what is happening?

Thanks

Hi

I'm not being able to sync my Lotus Notes with Salesforce using the connector.

 

When I configure it and test the conection, it is ok.

 But when I click on "sync" , I get an error:

 

"There have been some errors" Check them"  (or something like that, I get the errors in spanish).

But there are no errors in the window.

I have checked log files and they are empty.

 

Any suggestion?

 

I attach a word with screen captures of the configuration and errors.

 

https://www.dropbox.com/s/e522ldyfrkluawa/plugin_customization.zip

 

 

¿Can anybody explain me what is the operation of the Trigger.new ?

 

When I create an opportunity, for example, and a trigger is executed , Trigger.new shouldn't store ONLY that opportunity that I have created?

 

Why I get a lot of opportunitys in the Trigger.new collection?

 

 

Thanks

Hi to all.

I need to add an error message to a opener window. I explain it:

 

In opportunity page I have a buton wich open one window.  That window has a search functionality.

I need that if code throws an exception, it be shown in the opportunity window, not in the search one.

 

Could you help me in how doing it?

 

Thanks in advance

Hi to all.

I'm getting a SOQL error saying that there are too many SOQL Queries . I have been searching that error in forums, and the solution that everybody provides is that that query must be outside a loop.

But in my code the query is not IN any loop.

 

Anybody can help me?

 

 

Here is the code.

 

trigger ownerUpdateChooseRate on Choose_Rate__c (before Insert , before Update) {
set<id> opids =new set<id>();
set<id> ids=new set<id>();
for(Choose_Rate__c o:Trigger.new)
{
system.debug('ANEG=============='+o.ANEG__c);
system.debug('ids=============='+o.Opportunity_c__c);
opids.add(o.Opportunity_c__c);
if(o.ANEG__c==true && o.Opportunity_c__c!=null )
ids.add(o.Opportunity_c__c);
}
if(ids.size()>0)
{
Map<Id,Opportunity> op=new Map<Id,Opportunity>([select id,ownerid from opportunity where id in:ids]);

for(Opportunity o:op.values())
{
system.debug('mapids========================='+o.id);

}
for(Choose_Rate__c o:Trigger.new)
{
if(o.ANEG__c==true)
{
system.debug('id======='+o.Opportunity_c__c);
system.debug('ID==============='+op.get(o.Opportunity_c__c).ownerid);
o.ownerid=op.get(o.Opportunity_c__c).ownerid;
o.ANEG__c=false;
}

}
}
if(trigger.isInsert )
{
system.debug('Inside the Process for removing old rates');
List<Choose_Rate__c> oldList=new List<Choose_Rate__c>([Select id,Opportunity_c__c from Choose_Rate__c where Opportunity_c__c in:opids]);
if(oldList.size()>0)
{
for(Choose_Rate__c r:oldList)
{
system.debug('oldlist==========================='+r.id);
r.Opportunity_c__c=null;
r.ANEG__c=false;
}
try{update oldList;}catch(Exception e){}
}
}

}

Hi!
I'm trying to reassign the actor of an approval process and I'm getting that error : INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY


This is the main code:
try{

  Approval.ProcessResult result=AprobacionHelper.aprobarOportunidad(op, obs); 
 
  System.debug('resultado de la aprobación ========>' +result);
 
  Reasignacion__c r = AprobacionHelper.recuperaAprobadorReasignadas(op.Id);
  if (r!=null){
  
   List<Id> newWorkItemIds= result.getNewWorkitemIds();
    ///
    // First, get the ID of the newly created item

   List<Id> nwii = result.getNewWorkitemIds();
    ///
         AprobacionHelper.reasignar(nwii, r);
  }
           }catch(Exception e)

And the methods:

public static Approval.ProcessResult aprobarOportunidad(Opportunity op,Observaciones__c obs){


  Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();

        req1.setComments(obs.Observacion__c);
        req1.setObjectId(op.Id);       
        // Submit the approval request for the account
        Approval.ProcessResult result = Approval.process(req1);
        return result;
 }

public static void reasignar(List<Id>newWorkItemIds,Reasignacion__c r){
   Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();
  req2.setComments(r.Comentarios__c);
  req2.setAction('Approve');
  req2.setNextApproverIds(new Id[] {r.aprobador__c});
  req2.setWorkitemId(newWorkItemIds.get(0));
  Approval.ProcessResult result2 = Approval.process(req2);

  }
And there I got following error message:
10:35:11.596 (596521000)|EXCEPTION_THROWN|[57]|System.DmlException: Process failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
10:35:11.597 (597507000)|SYSTEM_METHOD_EXIT|[57]|Approval.process(Approval.ProcessRequest)
Hi,
I need to know which users has access to an opportunity or an account.

I know that using  the table UserRecordAccess I can know if a specified user has access to a specified record, but I would need to konw all the users who has access to a record.
Is that possible?

Thank you very much
I'm facing a very weird problem.
I have a class called from AfterInsert that take a list of inserted events , process them and after saves them.

If I insert a single record with workbench, it works fine, but if I insert for instance 11 records, I can see in the debug log that 11 records are inserted but If I try to click on one of the Ids that have been inserted, I get an error saying that that record doesn't exist.

Anybody can help with this?
 

We have a class that yesterday was working ok, but today when we try to add a user to a campaign,
we get this error:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CampaignUsersAfterInsert caused an unexpected exception, contact your administrator: CampaignUsersAfterInsert: execution of AfterInsert caused by: line 2, column 44: trigger body is invalid and failed recompilation: Dependent class is invalid and needs recompilation: Ap02Campaign: line 18, column 14: Field is not writeable: CampaignShare.CampaignAccessLevel

When you access to this class (Ap02Campaign) , now it is uncompiled, and if you try to save it you get the following error:
Field is not writeable: CampaignShare.CampaignAccessLevel
The fact is that the same class is saved and working in thifferent environments (Cert, Pre, production ...)
Anybody knows why of the error?
Hi All,
I have a trigger onUpdate & onBefore for Opportunities.
When it's triggered, it reads a opportunity field and updates the owner of the opportunity.

It works fine with any change I do on the opportunity, except if I change the owner.

In the debug log I can see that the trigger is fired, and it change the owner, but the opportunity finally doesn't have the owner assigned in the trigger but the owner that I have selected with the lookup.

Any help?

Thanks in advance
Hi!
I'm trying to reassign the actor of an approval process and I'm getting that error : INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY


This is the main code:
try{

  Approval.ProcessResult result=AprobacionHelper.aprobarOportunidad(op, obs); 
 
  System.debug('resultado de la aprobación ========>' +result);
 
  Reasignacion__c r = AprobacionHelper.recuperaAprobadorReasignadas(op.Id);
  if (r!=null){
  
   List<Id> newWorkItemIds= result.getNewWorkitemIds();
    ///
    // First, get the ID of the newly created item

   List<Id> nwii = result.getNewWorkitemIds();
    ///
         AprobacionHelper.reasignar(nwii, r);
  }
           }catch(Exception e)

And the methods:

public static Approval.ProcessResult aprobarOportunidad(Opportunity op,Observaciones__c obs){


  Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();

        req1.setComments(obs.Observacion__c);
        req1.setObjectId(op.Id);       
        // Submit the approval request for the account
        Approval.ProcessResult result = Approval.process(req1);
        return result;
 }

public static void reasignar(List<Id>newWorkItemIds,Reasignacion__c r){
   Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();
  req2.setComments(r.Comentarios__c);
  req2.setAction('Approve');
  req2.setNextApproverIds(new Id[] {r.aprobador__c});
  req2.setWorkitemId(newWorkItemIds.get(0));
  Approval.ProcessResult result2 = Approval.process(req2);

  }
And there I got following error message:
10:35:11.596 (596521000)|EXCEPTION_THROWN|[57]|System.DmlException: Process failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
10:35:11.597 (597507000)|SYSTEM_METHOD_EXIT|[57]|Approval.process(Approval.ProcessRequest)
Hi,

I have a Requirement. That is when ever Add User to AccountTeam(AccountTeamMember Object) we will retrieve Territory# from User and Compare To Account Field Territory# if it is not their we will populate. AND when ever delete User from AccountTeam The Territory# should be remove. we are look for another user with Same Role and populate that user Territory# on Account Field Territory#. But My Understandig is We Cannot write Triggers,Workflows and We cannot create Custom Button On accountTeam Section and we cannot Override Add Button. Could you Please give me the Suggestion how do build this Requirement.

Regards,
Santosh 

Hi.
I have one email alert that works fine for me (administrator), but it doesn't works for other users.
I have created an email alert that triggers when one opportunity field is modified (opportunity status). I have tested with my user and it works fine for me, but it doesn't works for others profiles.

I have looked for any activation field in user settings page, with any result.

 

Any help?

Hi to all.

I am trying to test the email sending when an opportunity field is changed.

I have followed below steps:

1)Create a work flow rule.

AND( ISCHANGED(Approval_Status__c ) , NOT ISPICKVAL( Approval_Status__c , 'Abierto') )

2) With following "Immediate Workflow Actions"

Email Alert envio al propietario

 

Description envio al propietario Email Template Oportunidad enviada a ANEG automaticamenteUnique Name envio_al_propietario Object Opportunity From Email Address Current User's email address     Recipients Opportunity Owner Additional Emails  

 

The rule is active, and I am opportunity owner. I receive other emails from Salesforce (so it is not problem of spam).

 

Why I don' receive any email?

I should receive an email when the field "Approval_Status__c " would change, but I don't.

 

Thanks in advance for your help

 

Hi!

When a user updates one opportunity with approved status, I need to change the opportunity status and modify its approval process process.

 

For updating the opportunity I have made a workflow rule that works fine, but I am not able of update its approval process status.

 

My code is below, and it is fired correctly within a trigger:

 

public static void cambiarEstadoAprobacionOportunidad(Opportunity opp){
        List<ProcessInstanceWorkitem> workItemList;
            
        try
        {
    /*        opp.Approval_Status__c='Abierta';
            opp.Production_Approval__c=False;
            update Opp;*/
            }
            Catch(DMLException e)
            {
            opp.addError(e);
            }
        for (SObject s:[SELECT STATUS from processInstance where TargetObjectId=:opp.Id]){
        
        System.debug('Estado ' + s);
        }
        List<ProcessInstance>  processList =  new List<ProcessInstance>();
        processList =[SELECT Id, Status FROM ProcessInstance where TargetObjectId=:opp.Id and (Status =: 'Pending' OR Status=:'Aprobado')];
        Set<ID> idSet = new Set<ID>();
        for(ProcessInstance p :  processList)
            {
            idSet.add(p.Id);   
            }
        workItemList = new List<ProcessInstanceWorkitem>();
        workItemList = [Select id from ProcessInstanceWorkitem where ProcessInstanceId in: idSet];
        for(ProcessInstanceWorkitem w:workItemList)
            {
            Approval.ProcessWorkItemRequest pwr = new Approval.ProcessWorkItemRequest();
            pwr.setWorkitemId(w.id);
            pwr.setAction('Removed');
            Approval.ProcessResult pr = Approval.process(pwr);
            }
}

I want to get all the fields of an object.

Is there any way to get the whole object? Or I need to write the full query? My object has more than 200 fields (I can write them copying and pasting, but if exists another way ...

 

 

Thanks

 

 

I want to add a magnifying glass image close to a input field, so when the user click on the image it opens a new window.

 

if I write below code

<apex:inputField value="{!account.Parent.Name}" label="{!$Label.Padre}"/>
<apex:commandButton action="{!cancel}" value="Save" id="theButton" title="" image="{!URLFOR($Resource.lupa)}" />

 

I get the image very far from the input field.

 

Anyone can help me on this?

 

Thanks

Hi to all.
I'm having an extrange behaviour with Opportunity object, and I'd like to ask for help.

The Opportunity object has an picklist field, name "A".

I have two different recordtypes "Y" and "Z" ,and each recordtype shows a unique value.
recordtype "Y" -> value "1"
recordtype "Z" -> value "2"
Also picklist field "A" is hidden for all profiles.

The point is that sometimes an recordtype "Y" opportunity is sending value "2" , and recordtype "Z" opportunity sends value "1". (It occurs less than 1% of the times).

Anyone knows what is happening?

Thanks

¿Can anybody explain me what is the operation of the Trigger.new ?

 

When I create an opportunity, for example, and a trigger is executed , Trigger.new shouldn't store ONLY that opportunity that I have created?

 

Why I get a lot of opportunitys in the Trigger.new collection?

 

 

Thanks

Hi to all.

I need to add an error message to a opener window. I explain it:

 

In opportunity page I have a buton wich open one window.  That window has a search functionality.

I need that if code throws an exception, it be shown in the opportunity window, not in the search one.

 

Could you help me in how doing it?

 

Thanks in advance

Hi to all.

I'm getting a SOQL error saying that there are too many SOQL Queries . I have been searching that error in forums, and the solution that everybody provides is that that query must be outside a loop.

But in my code the query is not IN any loop.

 

Anybody can help me?

 

 

Here is the code.

 

trigger ownerUpdateChooseRate on Choose_Rate__c (before Insert , before Update) {
set<id> opids =new set<id>();
set<id> ids=new set<id>();
for(Choose_Rate__c o:Trigger.new)
{
system.debug('ANEG=============='+o.ANEG__c);
system.debug('ids=============='+o.Opportunity_c__c);
opids.add(o.Opportunity_c__c);
if(o.ANEG__c==true && o.Opportunity_c__c!=null )
ids.add(o.Opportunity_c__c);
}
if(ids.size()>0)
{
Map<Id,Opportunity> op=new Map<Id,Opportunity>([select id,ownerid from opportunity where id in:ids]);

for(Opportunity o:op.values())
{
system.debug('mapids========================='+o.id);

}
for(Choose_Rate__c o:Trigger.new)
{
if(o.ANEG__c==true)
{
system.debug('id======='+o.Opportunity_c__c);
system.debug('ID==============='+op.get(o.Opportunity_c__c).ownerid);
o.ownerid=op.get(o.Opportunity_c__c).ownerid;
o.ANEG__c=false;
}

}
}
if(trigger.isInsert )
{
system.debug('Inside the Process for removing old rates');
List<Choose_Rate__c> oldList=new List<Choose_Rate__c>([Select id,Opportunity_c__c from Choose_Rate__c where Opportunity_c__c in:opids]);
if(oldList.size()>0)
{
for(Choose_Rate__c r:oldList)
{
system.debug('oldlist==========================='+r.id);
r.Opportunity_c__c=null;
r.ANEG__c=false;
}
try{update oldList;}catch(Exception e){}
}
}

}