• Bob DeRosier
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 15
    Replies
When I change a user from a "Customer Community" license to a "Customer Community Login" license, the user receives a Welcome email as if they had just joined. I want to keep using the Welcome email for actual new users for the site.  The tech support folk who do configurations would have me believe this is due to a trigger on my data and referred me here. The relevant line in the trigger is simply "update user;"    I don't think I have any control over the salesforce code that executes an update.

I will need to bulk change uses from one license to another every month to abide by license limits, so I would prefer to not spam them with Welcome emails.
Some users have two records with exactly the same name (because they are the same person). One is a licensed internal user, the other is a community user. When selecting such a user from the debug log filters, the error message "Error: Multiple items found. Select from drop-down or click icon to refine search." appears. However, the selecting from the drop down or search only produces the same message again. The search clearly picks up different records. The net effect is that I can't collect logs on the admin/office staff. However, there are old filters which do have these users selected, so it must have worked at some time in the past or else the filters could not have been saved.

Aside from making the names different, is there a way to resolve this ? 
I want to change a time, where I have datetime and a timezone, to GMT (actually I want ISO8601).   I the local time for an event and the timezone for it, but the conversions I tried don't change the time in GMT when the timezone changes.  That is the underlying problem.

The specific problem I have is:

I have this line of code:
string modStartDT = StartDT.format(('yyyy-MM-dd\'T\'HH:mm:ss','America/New_York'); 

The developer guide https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_datetime.htm says that 
.format(dateFormatString, timezone)   is valid.

However, compiling the class produces this error for the above line
Error: Compile Error: expecting a right parentheses, found ',' 

I am using v38 of the SalesForce API.

If you know of another way solve my problem, I am open to that as well.
Custom field didn't show up when - was skipped  (Roster_Fields_to_Hide) using the API.
    Exact same field in 2 diff obj - ref same global value set, same name, etc.  One was a custom object (Registration) and the a Standard Object (Contacts).  The field appeared in the custom object, not the standard.

To test whether it was a problem of two fields with same name in different objects, we added Roster_Fields_to_Hide1 to Contacts object and neither  of the two fields came down using the API.  
I have an HTML email template that keys off a registration record that I am attempting have display a datetime field under certain conditions.   If I display the field by itself
{!Event__c.Follow_up_Date__c}

  it displays as I expect. Similarly, this date/time field
{!DATEVALUE(Registration__c.Start__c)}
displays as I expect.  However,
{!DATEVALUE(Event__c.Follow_up_Date__c)}

 does not display anything event though the field is populated.   They are both date/time fields, so the non-uniform behavior puzzles me.

However If I put it inside an IF statement, it displays nothing. Both of the following produce blank output.
{!IF((1 = 1),DATEVALUE(Event__c.Follow_up_Date__c),'False')} 
{!IF((1 = 1),Event__c.Follow_up_Date__c,'False')}
Note that in these 2 lines, one has DATEVALUE and the other does not.

From my experimentation, this seems to be a problem displaying a date/time field within an IF statement.
I'm not sure where to post this issue - please let me know where to post it if this is the wrong place.

I am seeing an error "Apex trigger npe01.OpportunityPayments caused an unexpected exception, contact your administrator: npe01.OpportunityPayments: System.LimitException:npe01:Too many query rows:500001".

As near as I can tell, that trigger is managed, so I can't do anything about it except ask someone else to fix it.    How/who do I ask to resolve the issue ?
 

The VF page 
<apex:inputTextarea id="waiver" value="{!waiver.Waiver_Text__c}" style="width: 600px" rows="10" disabled="true"/>





The controller
Waiver_Text__c = getWaiverText()

     private String getWaiverText(){
        
        // Get document from document, document name hard coded right now ... not long-term
        String docContent = 'Waiver text is missing; make sure there is a document with the UNIQUE NAME HAI_Global_Waiver.';
        List<Document> doc = [SELECT Id, Body from Document WHERE DeveloperName = 'HAI_Global_Waiver'];
        
        if(!doc.IsEmpty()){
            try {
                docContent = doc[0].Body.ToString();
            }
            catch (Exception ex) {
                docContent = 'Error in loading waiver text. Check with the office or event registration desk.';
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'SYSTEM ERROR: There was an error loading the waiver file, please contact the office.')); 
            }
        }
        
        return docContent;
    }


When I check the SELECT statement, it produces a SF Object ID for a SF document and a body
015i0000001CB3yAAG   
     /services/data/v33.0/sobjects/Document/015i0000001CB3yAAG/Body

The SF document has a location link for a Google doc which is similar to, but not the text displayed.  
I would appreciate any help to locate the actual text. 
I have VF page in which some of the records as displayed on my VF page and the View State disagree.  Not all, just some and only for a couple fields.  Is that normal or expected ? 

If not expected behavior, how do I report it or resolve it ?  I only have standard support, so I got referred back here in my attempts to report it.
 
I have a VisualForce page with maddening behaviour. When I save data from the page the first time, all is well. When I save the same data, the second time, SalesForce switches the data in some pairs of records.  Saving the data beyond the second time does not seem to change any data. I can verify the data in ViewState and by looking at records.

I finally figured out a way to reproduce an example the problem in a sandbox, but because it looks like a developer type problem and I don't have developer support.   I don't have a way to report it. I am as certain as I can be that the problem is not with the code, so I would like to kick it up to SalesForce.     Any idea how begin that conversation ?
I have a visualforce page that is presented in an iframe  in WordPress and displays as I expect.  When I take the same URL, SalesForce asks me for a login.    I have another page that will not display in an iFrame and also requires a login when I type the URL in a browser.   How do I set a VF page to be publicly viewable ?     I have a test page with no content, a  minimal controller that still requires a login.   
Not sure if this is the right place to post this.

We saw this error - not sure what it means - same text, slightly different errors each time
Workflow Actions attempted

Error Number: 1585159311-507635 (1918307596)
Error Number: 1585159311-507641 (1918307596)
Error Number: 1585159311-507629 (1918307596)


I'm not sure if it is related, we also getting this error on about 3% of email for the last week:
421 4.4.0 [internal] no MXs for this domain could be reached at this time
The VF page works ok, I run into a problem on the test.  My belief is that I am not feeding it the correct information.  

Error Message System.NullPointerException: Attempt to de-reference a null object
Stack Trace Class.CateringReport_EventExtension1.<init>: line 115, column 1
Class.CateringReport_EventExtension1_Test.testclasses: line 26, column 1

The test code:
@isTest
public class CateringReport_EventExtension1_Test {

   private static region__c createRegion(){
       region__c reg = new region__c (Name = 'XXX');
       insert reg;
       return reg;
   }
   
    
    private static Event__c createEvent() {
               Event__c e = new Event__c(
               Start__c = Date.newinstance(2014, 1, 10),
               End__c = Date.newinstance(2014, 1, 13),
               region__c  = [SELECT Id FROM Region__c WHERE Name = 'XXX'].Id
             );
        insert e;   
        return e;
   }
  
   @isTest static void testclasses(){
       Event__c myEvent = new Event__c();
                
        Test.setCurrentPageReference(new PageReference('Page.thePageName'));
        ApexPages.StandardController sc = new ApexPages.standardController(myEvent);
        CateringReport_EventExtension1 doPage = new CateringReport_EventExtension1(sc);
  


It fails at the line "Start = "
 

public CateringReport_EventExtension1(ApexPages.StandardController controller) {        
        eventId = System.currentPageReference().getParameters().get('Id');
        if (eventId != null && eventId != '')
            eventName = ([SELECT Name FROM Event__c WHERE Id = :eventId]).Name;           
 
 // get location detail code from EventDetail_controller class           
        hEvent = new haiEvent(eventId);
        event = (EventId == null) ? new Event__c() : hEvent.Event;   
        
         // get location details
        if(event.Location__c != null)
                location = [SELECT Name, ZIP__c, Street__c, State__c, City__c, Google_Map_Url__c, Country__c, Small_Photo_URL__c
                                                FROM Location__c WHERE Id = :event.Location__c];   
        String tz = 'America/Los_Angeles';
        if(event.Timezone__c != null)
                tz = event.Timezone__c;                                       
        Start = event.Start__c.format('MMM d, yyyy h:mm a', tz); 
        StartDate = event.Start__c.format('MMM d, yyyy', tz); 
        EndDate = event.End__c.format('MMM d, yyyy', tz); 
                                                                                                   
        getRegistrations(eventId);
    }


 
I want to change a time, where I have datetime and a timezone, to GMT (actually I want ISO8601).   I the local time for an event and the timezone for it, but the conversions I tried don't change the time in GMT when the timezone changes.  That is the underlying problem.

The specific problem I have is:

I have this line of code:
string modStartDT = StartDT.format(('yyyy-MM-dd\'T\'HH:mm:ss','America/New_York'); 

The developer guide https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_datetime.htm says that 
.format(dateFormatString, timezone)   is valid.

However, compiling the class produces this error for the above line
Error: Compile Error: expecting a right parentheses, found ',' 

I am using v38 of the SalesForce API.

If you know of another way solve my problem, I am open to that as well.
I'm not sure where to post this issue - please let me know where to post it if this is the wrong place.

I am seeing an error "Apex trigger npe01.OpportunityPayments caused an unexpected exception, contact your administrator: npe01.OpportunityPayments: System.LimitException:npe01:Too many query rows:500001".

As near as I can tell, that trigger is managed, so I can't do anything about it except ask someone else to fix it.    How/who do I ask to resolve the issue ?
 

The VF page 
<apex:inputTextarea id="waiver" value="{!waiver.Waiver_Text__c}" style="width: 600px" rows="10" disabled="true"/>





The controller
Waiver_Text__c = getWaiverText()

     private String getWaiverText(){
        
        // Get document from document, document name hard coded right now ... not long-term
        String docContent = 'Waiver text is missing; make sure there is a document with the UNIQUE NAME HAI_Global_Waiver.';
        List<Document> doc = [SELECT Id, Body from Document WHERE DeveloperName = 'HAI_Global_Waiver'];
        
        if(!doc.IsEmpty()){
            try {
                docContent = doc[0].Body.ToString();
            }
            catch (Exception ex) {
                docContent = 'Error in loading waiver text. Check with the office or event registration desk.';
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'SYSTEM ERROR: There was an error loading the waiver file, please contact the office.')); 
            }
        }
        
        return docContent;
    }


When I check the SELECT statement, it produces a SF Object ID for a SF document and a body
015i0000001CB3yAAG   
     /services/data/v33.0/sobjects/Document/015i0000001CB3yAAG/Body

The SF document has a location link for a Google doc which is similar to, but not the text displayed.  
I would appreciate any help to locate the actual text. 
I have VF page in which some of the records as displayed on my VF page and the View State disagree.  Not all, just some and only for a couple fields.  Is that normal or expected ? 

If not expected behavior, how do I report it or resolve it ?  I only have standard support, so I got referred back here in my attempts to report it.
 
I have a VisualForce page with maddening behaviour. When I save data from the page the first time, all is well. When I save the same data, the second time, SalesForce switches the data in some pairs of records.  Saving the data beyond the second time does not seem to change any data. I can verify the data in ViewState and by looking at records.

I finally figured out a way to reproduce an example the problem in a sandbox, but because it looks like a developer type problem and I don't have developer support.   I don't have a way to report it. I am as certain as I can be that the problem is not with the code, so I would like to kick it up to SalesForce.     Any idea how begin that conversation ?
I have a visualforce page that is presented in an iframe  in WordPress and displays as I expect.  When I take the same URL, SalesForce asks me for a login.    I have another page that will not display in an iFrame and also requires a login when I type the URL in a browser.   How do I set a VF page to be publicly viewable ?     I have a test page with no content, a  minimal controller that still requires a login.   
The VF page works ok, I run into a problem on the test.  My belief is that I am not feeding it the correct information.  

Error Message System.NullPointerException: Attempt to de-reference a null object
Stack Trace Class.CateringReport_EventExtension1.<init>: line 115, column 1
Class.CateringReport_EventExtension1_Test.testclasses: line 26, column 1

The test code:
@isTest
public class CateringReport_EventExtension1_Test {

   private static region__c createRegion(){
       region__c reg = new region__c (Name = 'XXX');
       insert reg;
       return reg;
   }
   
    
    private static Event__c createEvent() {
               Event__c e = new Event__c(
               Start__c = Date.newinstance(2014, 1, 10),
               End__c = Date.newinstance(2014, 1, 13),
               region__c  = [SELECT Id FROM Region__c WHERE Name = 'XXX'].Id
             );
        insert e;   
        return e;
   }
  
   @isTest static void testclasses(){
       Event__c myEvent = new Event__c();
                
        Test.setCurrentPageReference(new PageReference('Page.thePageName'));
        ApexPages.StandardController sc = new ApexPages.standardController(myEvent);
        CateringReport_EventExtension1 doPage = new CateringReport_EventExtension1(sc);
  


It fails at the line "Start = "
 

public CateringReport_EventExtension1(ApexPages.StandardController controller) {        
        eventId = System.currentPageReference().getParameters().get('Id');
        if (eventId != null && eventId != '')
            eventName = ([SELECT Name FROM Event__c WHERE Id = :eventId]).Name;           
 
 // get location detail code from EventDetail_controller class           
        hEvent = new haiEvent(eventId);
        event = (EventId == null) ? new Event__c() : hEvent.Event;   
        
         // get location details
        if(event.Location__c != null)
                location = [SELECT Name, ZIP__c, Street__c, State__c, City__c, Google_Map_Url__c, Country__c, Small_Photo_URL__c
                                                FROM Location__c WHERE Id = :event.Location__c];   
        String tz = 'America/Los_Angeles';
        if(event.Timezone__c != null)
                tz = event.Timezone__c;                                       
        Start = event.Start__c.format('MMM d, yyyy h:mm a', tz); 
        StartDate = event.Start__c.format('MMM d, yyyy', tz); 
        EndDate = event.End__c.format('MMM d, yyyy', tz); 
                                                                                                   
        getRegistrations(eventId);
    }


 

Within an if statement I want to print a line break to the screen. However, there seems to be no easy way to do this in any forums thus far. I found a few answers, but none of them seem to work within the TRUE argument in my IF conditional statement. Here is a snippet of my code:
{! IF (relatedTo.Budget_In_Stream_Video__c != null, "In-Stream Video", null)}
{! IF (relatedTo.Budget_Interactive_InStream_Video__c != null, "Interactive In-Stream Video", null)}

Outputs

I have tried \n, <br/>, and many others with little or no success. BR() only gives this output:
In-Stream Video_BR_ENCODED_Interactive In-Stream Video

 

Someone please tell me I'm crazy and this isn't that hard and doesn't require some crazy hack...