• Nicu Tanase
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 11
    Replies
Hello,

I have a trigger that clones an opportunity and tries to insert the cloned one.
Something like that : 
Opportunity renewalOpportunity = o.clone(); 
.... [apex logic]
insert  renewalOpportunity;

The problem is that I receive this error:  The opportunity SyncedQuote field is read only within a trigger .
Well, the most awkard thing is that SyncedQuote is null.
I've tried to extend my right in order to be able to modify SyncesQuote but i am not able to do this.
I've tried to delete the field from my trigger but i reach another err 
Error:Apex trigger createRenewalOpportunity caused an unexpected exception, contact your administrator: : System.NullPointerException: Attempt to de-reference a null object

How can i solve this problem?

Thanks in advance!!
Hi,

I am trying to duplicate Notes on Opportunity on Lead conversion.
For this i have created a trigger on Note Object : 
It looks like this: 

trigger Note_move_to_oppty on Note (before update) {
    List<Id> noteIds = new List<Id>();
    for (Note note: Trigger.new) {
        system.debug('---note.ParentId='+note.ParentId)  ;
        system.debug('---Trigger.oldMap.get(note.Id).ParentId='+Trigger.oldMap.get(note.Id).ParentId)  ;
        if(note.ParentId != Trigger.oldMap.get(note.Id).ParentId && note.ParentId.getSObjectType() == Contact.getSObjectType())        
            noteIds.add(note.Id);
    }
    if (noteIds.size() > 0) {
        Note_To_Opp_Future.insertNote(noteIds);
    }
}

But this trigger does not fire :(
Any ideas what am I doing wrong?

Thank you in advance

Hello,

I am trying to implement data.com and after I receive my token I am trying to do this request :

{ uri: 'https://emea.salesforce.com/services/data/v35.0/match/DatacloudMatchEngine/DatacloudContact/',
  method: 'POST',
  form:
   { entities: [ { attributes: { type: 'DatacloudContact' },
    Email: 'jdowney@cisco.com' },
  { attributes: { type: 'DatacloudContact' },
    Email: 'creegan@cisco.com' } ],
    fields: [ 'City'] },
  proxy: 'my_proxy',
  'Content-Type': 'application/json',
  Headers: { Authorization: 'Bearer my_token' } }

I formed my url from the reponse I made to get my token like this :

response.body.instance_url+"/services/data/v35.0/match/DatacloudMatchEngine/DatacloudContact/"
But I am receiving this error :
[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I generating my token at this link
And the response looks like this
{ access_token: 'my_token',
  instance_url: 'https://emea.salesforce.com',
  id: 'https://login.salesforce.com/id/some_ids/some_ids',
  token_type: 'Bearer',
  issued_at: '1445611866005',
  signature: 'lDuvcG9X74hMkdskmq/hQ8WGQ57qFy5I0K87Fk/9NFo=' }

I am using nodejs & the request module.

What I am doing wrong?

Thanks in advance

Hello,

I have a trigger that clones an opportunity and tries to insert the cloned one.
Something like that : 
Opportunity renewalOpportunity = o.clone(); 
.... [apex logic]
insert  renewalOpportunity;

The problem is that I receive this error:  The opportunity SyncedQuote field is read only within a trigger .
Well, the most awkard thing is that SyncedQuote is null.
I've tried to extend my right in order to be able to modify SyncesQuote but i am not able to do this.
I've tried to delete the field from my trigger but i reach another err 
Error:Apex trigger createRenewalOpportunity caused an unexpected exception, contact your administrator: : System.NullPointerException: Attempt to de-reference a null object

How can i solve this problem?

Thanks in advance!!

Hello,

I am trying to implement data.com and after I receive my token I am trying to do this request :

{ uri: 'https://emea.salesforce.com/services/data/v35.0/match/DatacloudMatchEngine/DatacloudContact/',
  method: 'POST',
  form:
   { entities: [ { attributes: { type: 'DatacloudContact' },
    Email: 'jdowney@cisco.com' },
  { attributes: { type: 'DatacloudContact' },
    Email: 'creegan@cisco.com' } ],
    fields: [ 'City'] },
  proxy: 'my_proxy',
  'Content-Type': 'application/json',
  Headers: { Authorization: 'Bearer my_token' } }

I formed my url from the reponse I made to get my token like this :

response.body.instance_url+"/services/data/v35.0/match/DatacloudMatchEngine/DatacloudContact/"
But I am receiving this error :
[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I generating my token at this link
And the response looks like this
{ access_token: 'my_token',
  instance_url: 'https://emea.salesforce.com',
  id: 'https://login.salesforce.com/id/some_ids/some_ids',
  token_type: 'Bearer',
  issued_at: '1445611866005',
  signature: 'lDuvcG9X74hMkdskmq/hQ8WGQ57qFy5I0K87Fk/9NFo=' }

I am using nodejs & the request module.

What I am doing wrong?

Thanks in advance