• Giancarlo Amati
  • NEWBIE
  • 80 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 34
    Questions
  • 53
    Replies
Hi Team,

I have a button on my layout that executes a Javascript, but when clicking on it I receive "Unexpected ===" where SBQQ__Quote__c.SBQQ__BillingFrequency__c is a picklist but I cannot understand why.

Any help?
Thank you
GC
this.disabled = true;
this.className = 'btnDisabled';
​​​​​​​if ( {!SBQQ__Quote__c.SBQQ__BillingFrequency__c} === null) {

window.alert(' The \'Billing Frequency\' field is blank and needs to be populated before submitting this quote for approval. Please update the \'Pay Upfront\' field on the associated opportunity to enter a value into \'Billing Frequency\' ' );

}
else
window.location='./apex/SubmitQuote?Id={!SBQQ__Quote__c.Id}';

 
Dear All,
I am reviewing an set of Apex Classes. Specifically I have a classe that uses a "Stage_Info__c" object. I checked in our production and there is no object called that way.

I checked the dependencies of the Apex class and I saw the screenshot below:

User-added image
I cannot find that object anywhere in our environment. I cannot find the declaration of the object in any of the source codes of the classes. 
Am I missing something ?

Thank you.
GC
0
I created a multi picklist field in my opportunity object. In the trigger I created I call the following:
 
BCAccountID_test__c= 'FIRST VALUE' + ';' + 'SECOND VALUE';

but those two values are then available to the "Selected" part of the multi-picklist, instead of the 'Available' value. (see attached screenshot).

User-added image
Thank you.
GC
Hi Everyone,
every Opportunity has an Account linked to it. Every Account has a child (custom object) BCAccount record list. 1 Account can have multiple BCAccount records.

The opportunity has now a field BCAccountOpty which is a multi picklist field. 
I have created the following method in a Class:
 
public static Map<String, BCAccount__c> getBCAccountsForAccount(Set<Id> accountIds) {
      Map<String, BCAccount__c> bcaccountMap = new Map<String, BCAccount__c>();
    if(accountIds.size() > 0 ){
      for(BCAccount__c bcAccount : [Select Id, name, Account__c, recordTypeId, BCAccountId__c, Account__r.ownerId from BCAccount__c where Account__c in :accountIds ]){
        bcaccountMap.put(bcAccount.BCAccountId__c, bcAccount);
      }
      }
    return bcaccountMap;
    }

 
/*Builds the list of Available BCAcount from the Account.Id*/
public static void getBCAccounts(Opportunity optyObj) {
      Map<String, String> availableBCAccountsMap;
      Set<Id> accountIds = new Set<Id>();
      accountIds.add(optyObj.accountId);
      
        Map<String, BCAccount__c> bcAccountMap = getBCAccountsForAccount(accountIds);
        if(!bcAccountMap.isEmpty()){
          for(BCAccount__c bcAccount : bcAccountMap.values()){
            availableBCAccountsMap.put(bcAccount.BCAccountId__c, bcAccount.Name);
          }          
        }
    
    }
and one opportunity trigger which now looks like below. Now I need to populate the field "BCAccountOpty" when the opportunity is edited. 
I cannot figure out what I feel I need to build a 'for' loop over a List<SelectedOption> objects on the 'avlBCAccounts' variable. But what is the method to populate the actual BCAccountOpty field?


 
trigger OpportunityAvlbBCAccounts on Opportunity (after delete, after insert, after undelete, after update, before delete, before insert, before update) {

List<SelectOption> avlBCAccounts = new List<SelectOption>();

if(Trigger.isBefore){

        if(Trigger.isInsert || Trigger.isUpdate){
            Opportunity_GET_BCAccountUtils.getBCAccounts(trigger.new[0]);
            avlBCAccounts = Opportunity_GET_BCAccountUtils.getAvailableBCAccounts();
            for (List<SelectOption> c : avlBCAccounts) {
                 
            }
        }
    }
}

Thank you.

GC
 

Dear All,

I don't understand process builder which I thought it was a nicer way to build workflows.
I have a very simple process builder which checks a few fields value and if the condition it's true than it does an action. This happens when an oppty is closed won.
However, the process builder is failed with the following error:

We can't save this record because the “Account Activation Case From Opp v2.2” process failed. Give your Salesforce admin these details. An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Error ID: 1516978112-91599 (-1701038169)

I don't understand what I need to fix here. The condition is super simple.
User-added image
Dear All,

I need to delete like 2M records from our environment and I wonder if there's any way I could do by scheduling a job so not to impact on the performace of our instance. 

How can I do it? 
Thank you.
GC
Dear Team,
I have a process builder flow which simply checks the value of a field and it updates another field in the Account record. 
Oddly, another update process somehow made the FLOW failing so many times that I received the following error message. I don't understand then the connection between the two flows. 

Any suggestions on how to fix it? Oddly this happens quite often when I create processes with Process Builders, but it doesn't happen when I create actual Workflows. 

Thank you.
GC

The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: DSCORGPKG.DiscoverOrgCustomMapping_Account: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: DSCORGPKG.DiscoverOrgCustomMapping_Account: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide.​​​​​​​

User-added image
 
Dear All,

I've build a process in process builder that based on the value of a field 'A' it then update the value of field 'B'. However, 'B' is still editable by our Rep. Is there a way to understand that if 'B' is edited manually, then the action from the Process should not happen? 
 
Dear All,

we have just released a new naming convention for our contract names. We have a "Contract ID" field in the opportunity which is a text. 
How can I make sure that the text matches a certain pattern? For example, the convention we have set is:

6LettersAccount-date - Customer FULL NAME - Product name

So the three parts are separated by a dash. Is there something in salesforce that can help me to do some Patter Matching with Validation Rules? 

Thank you.
Hi Everyone,

I am currently reviewing the validation rules on opportunities. I've found the following lines, which I'd like to understand. Within the context of a validation rule which triggers the error only when the rule is True, what does these formulas do? Do they related to "Related Lists" child objects of the opportunity? 

Thank you.

NOT(ISBLANK($ObjectType.Live_Event_Coverage__c.Fields.Live_Event_Allotment_Opportunity__c)), /*allows Live Events to process*/
NOT(ISBLANK($ObjectType.SE_Customer_Solution__c.Fields.Opportunity__c )), /*allows SE Customer Solutions to process*/
NOT(ISBLANK( $ObjectType.Live_Event_Coverage_Timing__c.Fields.CoverageLink__c)), /*allows Live Event Timings to process*/
Dear All, 
can someone help me out to understand what is this about? I am sure I haven't deployed any flow in production, is it possible that it's using TLS 1.1 version which has been deprecated?

Thank you .G


Apex script unhandled exception by user/organization: 0051400000B2jVZ/00D300000000ab7

Failed to process batch for class 'DB4SF.PageViewSchedulable' for job id '7071O00006jAlEm'

caused by: System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable"

Class.DB4SF.DBAPI.execute: line 63, column 1
Class.DB4SF.PageViewSchedulable.execute: line 85, column 1
Hi Team,

I'm reviewing an Apex Batch job that failed overnight. I would like to update the email address that it sends in case of failure. I cannot figure out where this is built, but I've found this code in the Apex Class. There is a function called 'Label.BatchJobMonitors.split(';')' but I cannot find the definition. The 'toAddresses' is build based on that.
Any help?
Thank you
String status = (String.isEmpty(job.Status)) ? '' : job.Status;
          status = status.toLowerCase();
          ApexClass ac = [SELECT Id, Name FROM ApexClass WHERE Id =: job.ApexClassID];
      String className = ac.Name;
          Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
          String[] toAddresses = Label.BatchJobMonitors.split(';');
          mail.setToAddresses(toAddresses);
          mail.setSubject(subject);

 

Dear Team,
is there a way to create a button similar to the "Manage External user" on the contact object that will assign that contact to a default Campaign automatically ?

Thank you.

GC
User-added image

Dear All,
I have the following Javascript code for a button "Submit for Approval". When I try to send an alert passing the value of {!SBQQ__Quote__c.Deal_Type__c} that is a TEXT value, I receive the following message below.

Any help?
Thank you

User-added image
 
this.disabled = true;
this.className = 'btnDisabled';

if (  ({!SBQQ__Quote__c.Show_Lines_Summary__c} == '')||({!SBQQ__Quote__c.SBQQ__Primary__c}== '' )) {
 
 
window.alert('deal type: ' + {!SBQQ__Quote__c.Deal_Type__c} ); 

} else window.alert('dummy');

 

Dear Team,
when creating a new Opportunity record for a specific account, I would need to access the value of a custom field from the most recent closed-won opportunity of a certain deal type. 

What would be the best approach here? Building an Opportunity Trigger and use SOQL to access the most recent opportunity? 
 

Thank you. 

GC

Dear Team
this is a question about CPQ and contract templates. Specifically, our contract template has the following item in the "Sections" section. 

https://c.na79.visual.force.com/apex/ContractHeader1

which looks like a visual force page. But I cannot find it in our production environment. 

When I click on it, I get the following error:
List has no rows for assignment to SObject 
An unexpected error has occurred. Your development organization has been notified.

Where should I be looking at? Is there an Apex Class that will generate a visual force page called that way? 

Thank you.
User-added image

Dear All,
we have a system (bespoke) called Origin, which syncs with Salesforce every 5 minutes. 
What it does is: creating Accounts and or updating account records. 

I have one question: this origin is hosted somewhere in our company. Is there a way in Salesforce to understand what API calls are, to run some kind of report. Anything that can let us know what that Origin system is touching? We don't have a touch with the original developers. 

Thank you.

GC

Dear All, 
in the contract object I have two fields. One is a text formula, which fetches the name from the related opportunity. The second one, is a contract text field. 
The problem I have is to detect when the value of the first field changes so that I can update the second one. I thought to a contract trigger:
where I want Customer_Contract_ID__c to get updated every time the value of Contract_Name_ref__c changes. Both are fields from the same contract object. 
For whatever reason I don't see any change.

Thank you for your help.
trigger CustomerContractIDHasChanged on Contract (before update) {

/* Fetch the records that have been udpated */
Map<Id, Contract> m_contract = new Map<Id, Contract> ([SELECT Id FROM Contract WHERE Id IN :Trigger.New]);

If (trigger.isUpdate) {

For (Contract c: Trigger.new) {
    //System.debug('Contract with ID: ', m_contract.size() );
    Contract old_c = Trigger.oldMap.get(c.Id);
    
    System.debug('GIANCAR Contract with Customer Contract ID: ' + m_contract.get(c.Id).Customer_Contract_ID__c );
    System.debug('GIANCAR Contract with Customer Contract Name: ' + m_contract.get(c.Id).Contract_Name_ref__c );

    /*Check if the value has changed, based on the OLD mapping*/
    If (old_c.Contract_Name_ref__c != c.Contract_Name_ref__c) { /*If the value has changed, we update the Customer Contract ID*/
    
        c.Customer_Contract_ID__c = c.Contract_Name_ref__c;
        System.debug('GIANCAR Contract with Customer Contract Name: ' + c.Customer_Contract_ID__c );
    }
}

}

}








 

Dear Team,
we've found the following code of a Case Trigger which emits an error message related to the case owner time zone. I checked the users' time zone both in the SFDC Admin --> Users and also in every single profile in the "My Settings" section. They all have a timezone assigned but for some reason, I believe the bcHelper variable is always NULL and so it triggers the error message.
Where else should I be looking at?

Thank you. 

GC
 

Cannot match case owner's time-zone to
a business hour/holiday record; please update case owner's time-zone in the user profile
 
BusinessHoursUtilities.BusinessHoursHelper bhHelper =
mapBusinessHoursHelpersByUserId.get(c.OwnerId);
if (bhHelper == null) {
c.addError('Cannot match case owner\'s time-zone to
a business hour/holiday record; please update case owner\'s time-zone in
the user profile.');
}

 
Dear Team,
I am creating a email template in VF and I would like to include a link at the bottom. 
The link will ask the customer if the case is resolved or not. Something similar to the bottom of the shot. However, we'd like to ask the customer if the chase is "Resolved" or "not resolved". If the case is "Resolved" is there a way to automatically change the case status to "Need to close" or "Closed" or something which updates a case field.

Thank you.User-added image
Hi Team,

I have a button on my layout that executes a Javascript, but when clicking on it I receive "Unexpected ===" where SBQQ__Quote__c.SBQQ__BillingFrequency__c is a picklist but I cannot understand why.

Any help?
Thank you
GC
this.disabled = true;
this.className = 'btnDisabled';
​​​​​​​if ( {!SBQQ__Quote__c.SBQQ__BillingFrequency__c} === null) {

window.alert(' The \'Billing Frequency\' field is blank and needs to be populated before submitting this quote for approval. Please update the \'Pay Upfront\' field on the associated opportunity to enter a value into \'Billing Frequency\' ' );

}
else
window.location='./apex/SubmitQuote?Id={!SBQQ__Quote__c.Id}';

 
Dear All,
I am reviewing an set of Apex Classes. Specifically I have a classe that uses a "Stage_Info__c" object. I checked in our production and there is no object called that way.

I checked the dependencies of the Apex class and I saw the screenshot below:

User-added image
I cannot find that object anywhere in our environment. I cannot find the declaration of the object in any of the source codes of the classes. 
Am I missing something ?

Thank you.
GC
Dear All,

I don't understand process builder which I thought it was a nicer way to build workflows.
I have a very simple process builder which checks a few fields value and if the condition it's true than it does an action. This happens when an oppty is closed won.
However, the process builder is failed with the following error:

We can't save this record because the “Account Activation Case From Opp v2.2” process failed. Give your Salesforce admin these details. An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Error ID: 1516978112-91599 (-1701038169)

I don't understand what I need to fix here. The condition is super simple.
User-added image
Dear Team,
I have a process builder flow which simply checks the value of a field and it updates another field in the Account record. 
Oddly, another update process somehow made the FLOW failing so many times that I received the following error message. I don't understand then the connection between the two flows. 

Any suggestions on how to fix it? Oddly this happens quite often when I create processes with Process Builders, but it doesn't happen when I create actual Workflows. 

Thank you.
GC

The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: DSCORGPKG.DiscoverOrgCustomMapping_Account: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: DSCORGPKG.DiscoverOrgCustomMapping_Account: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide.​​​​​​​

User-added image
 
Hi Everyone,

I am currently reviewing the validation rules on opportunities. I've found the following lines, which I'd like to understand. Within the context of a validation rule which triggers the error only when the rule is True, what does these formulas do? Do they related to "Related Lists" child objects of the opportunity? 

Thank you.

NOT(ISBLANK($ObjectType.Live_Event_Coverage__c.Fields.Live_Event_Allotment_Opportunity__c)), /*allows Live Events to process*/
NOT(ISBLANK($ObjectType.SE_Customer_Solution__c.Fields.Opportunity__c )), /*allows SE Customer Solutions to process*/
NOT(ISBLANK( $ObjectType.Live_Event_Coverage_Timing__c.Fields.CoverageLink__c)), /*allows Live Event Timings to process*/
Hi Team,

I'm reviewing an Apex Batch job that failed overnight. I would like to update the email address that it sends in case of failure. I cannot figure out where this is built, but I've found this code in the Apex Class. There is a function called 'Label.BatchJobMonitors.split(';')' but I cannot find the definition. The 'toAddresses' is build based on that.
Any help?
Thank you
String status = (String.isEmpty(job.Status)) ? '' : job.Status;
          status = status.toLowerCase();
          ApexClass ac = [SELECT Id, Name FROM ApexClass WHERE Id =: job.ApexClassID];
      String className = ac.Name;
          Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
          String[] toAddresses = Label.BatchJobMonitors.split(';');
          mail.setToAddresses(toAddresses);
          mail.setSubject(subject);

 

Dear Team,
we've found the following code of a Case Trigger which emits an error message related to the case owner time zone. I checked the users' time zone both in the SFDC Admin --> Users and also in every single profile in the "My Settings" section. They all have a timezone assigned but for some reason, I believe the bcHelper variable is always NULL and so it triggers the error message.
Where else should I be looking at?

Thank you. 

GC
 

Cannot match case owner's time-zone to
a business hour/holiday record; please update case owner's time-zone in the user profile
 
BusinessHoursUtilities.BusinessHoursHelper bhHelper =
mapBusinessHoursHelpersByUserId.get(c.OwnerId);
if (bhHelper == null) {
c.addError('Cannot match case owner\'s time-zone to
a business hour/holiday record; please update case owner\'s time-zone in
the user profile.');
}

 
Dear Team,
I am creating a email template in VF and I would like to include a link at the bottom. 
The link will ask the customer if the case is resolved or not. Something similar to the bottom of the shot. However, we'd like to ask the customer if the chase is "Resolved" or "not resolved". If the case is "Resolved" is there a way to automatically change the case status to "Need to close" or "Closed" or something which updates a case field.

Thank you.User-added image

Dear All, 
I have a set of records (about 100) of the BCAccount type object. I would need to go through each of them and update the same field with a specific value. 
What's the easiest and fast way to do it having the list of BCAccountId which identify each record?

I was thinking to use Dataloader.

Thank you for your help.

GC

 

Dear All,
I have the following project to develop: when a Case is submitted to us, we have to first-respond it within a certain time (our SLA due date/time). I would like to implement an Apex (trigger or Class?) that fires a notification (an outbound message, or email alert ...) 5 minutes before the SLA due date/time. For example:
a case is created on 05/01/2018 at 8.00AM with priority P1. It must be first responded within 15 minutes that means, at 8.15AM (this is our SLA due date/time). I want to be able to send a notification 5 minutes before we hit the SLA due time. 
The notification (either an outbound message or an email alert) should be sent at 8.10AM, 5 mins before the SLA due date/time: 8.15AM.

I know there are Workflows and time-based action, but would it be more accurate doing in an APEX class? if so? how? 
How can I also repeat the notification many times?

Thank you.
GC

Dear Team,
I need to trigger an APEX Trigger class only to a subset of Cases which oddly my APEX Batch class skipped. 
In my production environment, I have opened the Developer Console window --> Open Execute Anonymous Window and pasted the following code. By calling 'update cc' I will trigger the Case Trigger. However, I get the error in the snapshot.

My questions:
1) How can I run my apex batch class ONLY on the cases that were missed?
2) Is there a way to call the Apex instruction without generating the "Too Many SQL Queries" message?
Thank you.
GC
 
List<case> ccL = [SELECT CreatedDate, Met_SLA_2__c FROM Case WHERE ((CALENDAR_YEAR(CreatedDate) >= 2016) AND (Met_SLA_2__c = null) )];

System.debug('Size List: ' + ccl.size());

for (Case cc: ccL){
    update cc;
}


User-added image