• vikrant Chauhan 5
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies

Hey all!

I have a flow that functions completely as expected in Debug mode. However, when it runs in production, it fails at the first update. 

The error is as follows: 
Error Occurred: The flow tried to update these records: null. This error occurred: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Run COGS Flow” process failed. Give your Salesforce admin these details. An error occurred when executing a flow interview. Error ID: 1028008348-267851 (387845667). You can look up ExceptionCode values in the SOAP API Developer Guide.

What doesn't make sense to me is that while the error looks like it is trying to update a null record, here's the log of the update action: 

FAST UPDATE: Commit_NS_COGS
Update OrderItem records whose IDs are stored in {!NS_Loop}.
Variable Values
[Id=8022M00000CUp3SQAT,Unit_COGS__c=11.48,Product2Id=01t2M000005oOVYQA2]
Result
Failed to update records whose IDs are in {!NS_Loop}.


So the ID is there, the only thing that is a new piece of information is Unit_COGS__c . 
I've checked - both Unit_COGS__c and the source of the changed info are the same data type, with the same amount of digits and decimal places.  
 

Hi guys, I am begineer in Salesforce developer, my question is I want to count the number of page refresh in visualforce page, so what will be  the vf code for this ??                                                                                                                
Hi,

I receiving "Field is not writeable: OpportunityShare.OpportunityId" error for the below code.Can someone please help me to sort out the error?


trigger shareRecord on Opportunity (after insert,after update) {
    List<OpportunityShare> share=new List<OpportunityShare>();
    User u=[select id from User where alias='kshar'];
    for(Opportunity op:Trigger.New){
        if(op.amount>50000){
            OpportunityShare p=new OpportunityShare();
            p.OpportunityId=op.id;
            p.UserOrGroupId=u.id;
            p.OpportunityAccessLevel='Read';
            p.RowCause='Manual';
            share.add(p);
        }
    }
    insert share;
}



Hello,

I have a cross object that looks up to a user and a parent. I have put a trigger on the parent, trying to give sharing access to all users that are on the child object user lookup.

I am getting the below error message:

Apex trigger ADRSharringTrigger caused an unexpected exception, contact your administrator: ADRSharringTrigger: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_ACCESS_LEVEL, : []: Trigger.ADRSharringTrigger: line 29, column 1

trigger ADRSharringTrigger on ADR__c (after update) {

      List<ADR__Share> ADR_Shares = new List<ADR__Share>();

   
    list<id> ADRSubmittedList = new list<id>();
    list<ADRUser__c> ADRUserList = new list<ADRUser__c>();
   
    for(ADR__c lstADRTrigger : trigger.new){
        if(lstADRTrigger.Next_Step__c == 'Submit'){
            ADRSubmittedList.add(lstADRTrigger.id);
        }

    for(ADRUser__c lstADRUser : [Select ID, Status__c, ADR__c, User__c from ADRUser__c where ADR__c in :ADRSubmittedList] ){
    
     ADR__Share  ADR_share = new ADR__Share();
    ADR_share.ParentId = lstADRUser.ADR__c;
    ADR_share.AccessLevel = 'All';
     ADR_share.UserOrGroupId = lstADRUser.User__c;

    
      SCD_Shares.add(scd_share);
    
    
     insert SCD_Shares;
    
    
   
    }
}

hi,

 I want to add a custom button in Related List.

 for example  I have a custom button named add in contact and i want that button in account  Related List.

  • March 26, 2011
  • Like
  • 0