• BrettB
  • NEWBIE
  • 9 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: JUSUMGZU



FYI I did Try Multiple Orgs of various types... The error Number may change, but it never validates. New Org or Not
  • February 03, 2017
  • Like
  • 0

Can I  capture the time a record is externally shared via s2s and put it in a custom Field Attached to the shared object ?

  • September 26, 2011
  • Like
  • 0

Im hitting my head against the wall and need some  assistance... in regards to a  test method...

Im trying to add a button to my production environment, that uses a controller to run some apex and move a S2S opportunity into a partner account.

The problem is i have ZERO percent coverage...below is my code...I know its bad, bu im just starting at this testMethod thing...Please help with what im missing,

Following is my controller and test method



 

public class VFController {
 
      private final Opportunity o;
    public VFController(ApexPages.StandardController stdController) {
        this.o = (Opportunity)stdController.getRecord();
    }
 
    // Code we will invoke on page load.
    public PageReference autoRun() {
 
        String theId = ApexPages.currentPage().getParameters().get('id');
 
        if (theId == null) {
            // Display the Visualforce page's content if no Id is passed over
            return null;
        }
 
        for (Opportunity o:[select id from Opportunity where id =:theId]) {
        PartnerNetworkRecordConnection newConnection =
                    new PartnerNetworkRecordConnection(
                        connectionId = '04PM0000000CaRqMAK',
                        LocalRecordId = o.Id);
                        insert newConnection;
           
        }
 
        // Redirect the user back to the original page
        PageReference pageRef = new PageReference('/' + theId);
        pageRef.setRedirect(true);
        return pageRef;
 
    }
     static TestMethod void test()
     {
      
List<PartnerNetworkRecordConnection> pncs = new List<PartnerNetworkRecordConnection>{};
  for (Opportunity o:[select id from Opportunity]) {
 PartnerNetworkRecordConnection pnc = new  PartnerNetworkRecordConnection ( connectionId = '04PM0000000CaRqMAK',
                        LocalRecordId = o.Id);
                        pncs.add(pnc);
                       
                        insert pnc;
                        
                       List<PartnerNetworkRecordConnection> insertedPncs = [select connectionId, localrecordId from PartnerNetworkRecordConnection where Id in :pncs];
                       }
     }
    }

Im hitting my head against the wall and need some  assistance... in regards to a  test method...

Im trying to add a button to my production environment, that uses a controller to run some apex and move a S2S opportunity into a partner account.

The problem is i have ZERO percent coverage...below is my code...I know its bad, bu im just starting at this testMethod thing...Please help with what im missing,

Following is my controller and test method



 

public class VFController {
 
      private final Opportunity o;
    public VFController(ApexPages.StandardController stdController) {
        this.o = (Opportunity)stdController.getRecord();
    }
 
    // Code we will invoke on page load.
    public PageReference autoRun() {
 
        String theId = ApexPages.currentPage().getParameters().get('id');
 
        if (theId == null) {
            // Display the Visualforce page's content if no Id is passed over
            return null;
        }
 
        for (Opportunity o:[select id from Opportunity where id =:theId]) {
        PartnerNetworkRecordConnection newConnection =
                    new PartnerNetworkRecordConnection(
                        connectionId = '04PM0000000CaRqMAK',
                        LocalRecordId = o.Id);
                        insert newConnection;
           
        }
 
        // Redirect the user back to the original page
        PageReference pageRef = new PageReference('/' + theId);
        pageRef.setRedirect(true);
        return pageRef;
 
    }
     static TestMethod void test()
     {
      
List<PartnerNetworkRecordConnection> pncs = new List<PartnerNetworkRecordConnection>{};
  for (Opportunity o:[select id from Opportunity]) {
 PartnerNetworkRecordConnection pnc = new  PartnerNetworkRecordConnection ( connectionId = '04PM0000000CaRqMAK',
                        LocalRecordId = o.Id);
                        pncs.add(pnc);
                       
                        insert pnc;
                        
                       List<PartnerNetworkRecordConnection> insertedPncs = [select connectionId, localrecordId from PartnerNetworkRecordConnection where Id in :pncs];
                       }
     }
    }

Hi Everyone,

 

I'm new to working with Apex code and I have looked around for the answer to this but everyone seems to have a slightly different situation. I have the fields for a custom object displayed on a site that I want public users to be able to use to create new records. However, when I submit a new record it takes me to a logon page because it is attempting to take me to the new record. Instead I want it to take users to a page that says they successfully created a record. I have created a controller extension to override the save action but something is wrong with it as it does not even work on the VF page, I get the error "System.NullPointerException: Attempt to de-reference a null object" "Class.MyPageController.save: line 8, column 8 External entry point" , where line 8 is the "Insert request" line. I have been working from information on the two sites below. Any help would be greatly appreciated.

 

http://blog.jeffdouglas.com/2008/11/14/redirecting-users-to-different-visualforce-pages/

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_pagereference.htm

 

Site Code

<apex:page sidebar="false" showHeader="false" standardController="Request__c" extensions="MyPageController">   
<apex:form >
    <apex:pageBlock >
    <apex:pageMessages />
    <apex:pageBlockSection >
    <apex:detail />
        <apex:inputField value="{! Request__c.First_Name__c}" />
        <apex:inputField value="{! Request__c.Last_Name__c}"/>
        <apex:inputField value="{! Request__c.Email_Address__c}"/>
        <apex:inputField value="{! Request__c.Cost_Center__c}"/>
        <apex:inputField value="{! Request__c.Department__c}"/>
        <apex:inputField value="{! Request__c.Director_s_Email__c}"/>
        <apex:inputField value="{! Request__c.Director_s_First_Name__c}"/>
        <apex:inputField value="{! Request__c.Director_s_Last_Name__c}"/>
        <apex:inputField value="{! Request__c.Mailstop__c}"/>
        <apex:inputField value="{! Request__c.Phone_Number__c}"/>

    </apex:pageBlockSection>
    </apex:PageBlock>       
        <apex:commandButton action="{! save}" value="Save"/>
       
    </apex:form>
</apex:page>

 

Controller Extension

public class MyPageController {
Request__c request;
private ApexPages.StandardController controller;
public MyPageController(ApexPages.StandardController controller) {
this.controller = controller;
}
public PageReference save() {
insert request;
PageReference requestPage = Page.Congratulations;
requestPage.setRedirect(true);
return requestPage;

}

  • April 12, 2011
  • Like
  • 0

is it possible to do a salesforce to salesforce connection between a production org and a sandbox org?

 

when creating a connection from production to sandbox i've tried changing the connection link from "login.salesforce.com" to "test.salesforce.com" but i get a 

 

"Salesforce to Salesforce: Partner org is not active and no API calls are allowed"

 

But both sandbox and production are Enterprise orgs with plenty of API calls still left for the 24 hours period. i have used the api to push data into both.

  • March 31, 2011
  • Like
  • 0

I have a custom ojbect (Internal_Request__c) for which I am building a custom "new record" page.  Following the typical pattern of first making the user select a Record Type, I created a simple "select record type" page that gives the user a list of record types.  After submitting that page, the user is directed to the full form page with the selected Record Type ID on the query string.   Ideally, based on the new feature in version 20.0, I would like that form to be aware of the record type so that the select lists are filtered accordingly.  I can't seem to get it work though.  The page loads but the default RecordType is selected, not the one that was passed on the querystring from the previous page.

 

The parameter name on the query string is "rType"

 

Here is my controller for the second page:

 

public with sharing class CreateIRFormController {
	
    public Internal_Request__c ir {get;set;}
    
    public String rType {get; set;}
    
    public CreateIRFormController() {
        rType = ApexPages.currentPage().getParameters().get('rType');
        ir = new Internal_Request__c(recordtypeid = (ID)rType, subject__c = 'test pre-pop');
    }

    public PageReference save() {
        insert ir;
        ApexPages.StandardController sc = new ApexPages.StandardController(ir);
        return sc.edit();
    }
}

 

 

And the associated VF page:

 

<apex:page controller="CreateIRFormController">
	<apex:form >
	    <apex:pageBlock >
	        <apex:pageBlockSection >
		        <apex:inputField value="{!ir.RecordType}" />
		        <apex:inputField value="{!ir.Type__c}"  />
		        <apex:inputField value="{!ir.Account__c}"  />
		        <apex:inputField value="{!ir.Opportunity__c}"  />
		        <apex:inputField value="{!ir.Issue_Date__c}"  />
		        <apex:inputField value="{!ir.Number_of_Copies__c}"  />
		        <apex:inputField value="{!ir.Request_Due_Date_Time__c}"  />
		        <apex:inputField value="{!ir.Subject__c}"  />
		        <apex:inputField value="{!ir.Description__c}"  />
	        </apex:pageBlockSection>
	        
	       <apex:pageBlockSection >
	            <apex:inputHidden value="{!rType}" />            
	            <apex:commandButton value="Create" action="{!save}" />
	        </apex:pageBlockSection>
	
	    </apex:pageBlock>    
	</apex:form>
</apex:page>

 Note: the subject__c is correctly pre-populated by the constructor, but the record type does not work.

 

 

I tried a second version of the controller constructor, but it results in the following error message (which doesn't really make sense to me):

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Record Type ID: value not of required type: [RecordType (Name:PS Data Center, Id:012Q00000004SJfIAM)]".

 

    public CreateIRFormController() {
        rType = ApexPages.currentPage().getParameters().get('rType');
        RecordType rt = [select id,name from RecordType where id = :rType];
        ir = new Internal_Request__c(recordtype = rt);
    }

 

 

This feels like a common thing people would want to do, so I'm hoping I'm just missing something.  Any help is appreciated.

 

-Cory

  • November 08, 2010
  • Like
  • 0

Hi my header name goes away when I render the column but the value comes up???

 

<apex:column rendered="{!dd.TermD='9.2'}">
<apex:facet name="header">Subject Area</apex:facet>
<apex:outputText value="{!dd.Subject}"/>
</apex:column>

 

 Thanks

 

Message Edited by MMA_FORCE on 03-19-2010 11:07 AM

I am establishing S2S between two orgs . Org A (source Org) and Org B (Target Org)

 

Org A has an object (Object1) with look up on the two other objects (Object2 and Object3)

 

Object2 and Object3 are already externally shared with Org B.

 

while sharing Object1 , I am setting parentrecordid to Object2 so Object1 shows up correctly linked to Object2

 

but I am not able link Object1 with both Object2 and Object3 at the same time.

 

here is the code from the after insert trigger on Object1 in Org A.

 

stripped down code...

 

 

            PartnerNetworkRecordConnection newConnection = new PartnerNetworkRecordConnection (
            ConnectionId = networkId,
            LocalRecordId = obj1.Id, 
            ParentRecordId = obj1.obj2);

 

            insert  newConnection;

 

Thanks for your help.