• Nertin Hoxha
  • NEWBIE
  • 40 Points
  • Member since 2016
  • Salesforce Developer Group Leader
  • X3Energy S.p.A


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
Hello Everybody, i need some assistance please.
When using Firefox , an One click javascript button doesn't work so i can see non pop up or new tab with the content.
It works pretty fine on chrome , instead. Is it an workaround available.
How can adapt this code , in case. Thanks
var a= document.createElement('a');

a.href = '/apex/3eShow?fatturaId={!Fattura__c.IdFattura__c}';

a.setAttribute('target', '_blank');

a.click();

/*
setTimeout(function(){

window.location.reload(true);

},5000);
*/

 
Hello everybody, 

I've got some redundancies on my business process want to estinguish. 

Depending on a specific record type of a custom object called 'Type of Service', when the users create a new Opportunity from the related list , i want them te be able to select only two of the Record Types of the Opportunity correlated to the above object.

I was thinking to use a process builder otherwise Visualforce but don't know which is the best practice to actuate this scenario.

I would appreciate suggestions. 
Regards
Using the NPSP.
When i submit a donation from a web form to salesforce using a click and pledge integrated platform; it creates a correct account and contact but gives me error on the opportunity record creation.
User-added image
Guess sasesforce concatenates to the click and pledge id his own generated id. 
How can i overcome this error ? is there a workaround?
trigger DuplicateService on Site__c (before insert) {
    for(Site__c  B : Trigger.New) {
        try {
            Integer i = [SELECT count() FROM Site WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId];

            if (i > 0) {
            String RT = [SELECT Name FROM RecordType WHERE Id = :B.RecordTypeId].Name;
            String TS = [SELECT Name FROM Site__c WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId].Name;
               B.addError('Already existing ' + RT + ': <<<' + TS + '>>>, !!');
            }
        }
        catch (DmlException e) {
            System.debug('Trigger DuplicateService: ' + e.getMessage());
        }
    }
}

 
trigger DuplicateService on Site__c (before insert) {
    for(Site B : Trigger.New) {
        try {
            Integer i = [SELECT count() FROM Site WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId];

            if (i > 0) {
            String RT = [SELECT Name FROM RecordType WHERE Id = :B.RecordTypeId].Name;
            String TS = [SELECT Name FROM Site__c WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId].Name;
               B.addError('Already existing ' + RT + ': <<<' + TS + '>>>, !!');
            }
        }
        catch (DmlException e) {
            System.debug('Trigger DuplicateService: ' + e.getMessage());
        }
    }
}

 

When trying the test class for the related picklist value in a Quote field i get the following message:
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: 3668: [Sales_Org__c]
But the value 3668 exists and it's free of errors in the org. Any idea? thanks
Hello Everyone,
i would like to know if there is a way to create a pdf template specifying the extension in PDF/A ?
Many Thanks!
Hello Everybody, i need some assistance please.
When using Firefox , an One click javascript button doesn't work so i can see non pop up or new tab with the content.
It works pretty fine on chrome , instead. Is it an workaround available.
How can adapt this code , in case. Thanks
var a= document.createElement('a');

a.href = '/apex/3eShow?fatturaId={!Fattura__c.IdFattura__c}';

a.setAttribute('target', '_blank');

a.click();

/*
setTimeout(function(){

window.location.reload(true);

},5000);
*/

 
Using the NPSP.
When i submit a donation from a web form to salesforce using a click and pledge integrated platform; it creates a correct account and contact but gives me error on the opportunity record creation.
User-added image
Guess sasesforce concatenates to the click and pledge id his own generated id. 
How can i overcome this error ? is there a workaround?
trigger DuplicateService on Site__c (before insert) {
    for(Site B : Trigger.New) {
        try {
            Integer i = [SELECT count() FROM Site WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId];

            if (i > 0) {
            String RT = [SELECT Name FROM RecordType WHERE Id = :B.RecordTypeId].Name;
            String TS = [SELECT Name FROM Site__c WHERE Account__c = :B.Account__c AND RecordTypeId = :B.RecordTypeId].Name;
               B.addError('Already existing ' + RT + ': <<<' + TS + '>>>, !!');
            }
        }
        catch (DmlException e) {
            System.debug('Trigger DuplicateService: ' + e.getMessage());
        }
    }
}