• Elizabeth Stelter
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I am having issues where writing a VF page one way will work in the instance I am developing a managed package in, but not the one I install it in, or vice versa (which is even weirder to me).  Both are developer editions, and I haven't set up an environment hub (although it is on my to-do list).  Basically, if I put in the namespace prefix, it won't work in the instance I am building it in, but if I don't include the namespace prefix it won't work when I install it in a different instance.  

I feel like there must be a way for it to work in both, but I am using this project to teach myself as I go and feel like I must have missed something along the way.  

The following (condensed version) works in the development instance but throws the following error in the installed instance. 
"SObject row was retrieved via SOQL without querying the requested field: pattersonrd__NPBPCL__c.Name"  
<apex:page standardController="pattersonrd__NPBPCL__c" tabStyle="pattersonrd__NPBPCL__c">
    <apex:form >
        <apex:sectionheader title="Checklist Edit" subtitle="{! IF(NPBPCL__c.Id==null,'New Checklist',NPBPCL__c.Name)}"></apex:sectionheader>
        <apex:pageblock mode="edit" id="checklistPB" title="Checklist Edit">

            <apex:pageblockbuttons >
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
            </apex:pageblockbuttons>

            <apex:pagemessages ></apex:pagemessages> 
            		
            <apex:pageBlockSection title="Version" id="VersionPBS">
                <apex:inputField value="{! NPBPCL__c.Name }"/>
                    Name this checklist after the period under review, such as "2015 Checklist" or "3rd Quarter 2017 Checklist."  Conducting regluar reviews will help you track your progress over time.
            </apex:pageBlockSection>
            
            <apex:pageBlockSection Title="Federal" id="FederalPBS" columns="1">        
                <apex:pageBlockSection Title="Nonprofit Status" id="NonprofitStatusPBS">
                    <apex:inputField value="{! NPBPCL__c.Obtain_501_c_3_Status__c }" />
                    Obtaining your 501(c)3 status can be a long process, typically taking 2-12 months.
                    <apex:inputField value="{! NPBPCL__c.Retain_Determination_Letter__c }" />
                    You will need this document to prove your status to grantors and others.
</it goes on with input fields for quite a while and then has all the proper closing tags. but all the input fields are in the same basic format>

The following (condensed version) works in the installation instance but throws the following error in the development instance. 
"System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: pattersonrd__NPBPCL__c.Name "
<apex:page standardController="pattersonrd__NPBPCL__c" tabStyle="pattersonrd__NPBPCL__c">
    <apex:form >
        <apex:sectionheader title="Checklist Edit" subtitle="{! IF(pattersonrd__NPBPCL__c.Id==null,'New Checklist',pattersonrd__NPBPCL__c.Name)}"></apex:sectionheader>

        <apex:pageblock mode="edit" id="checklistPB" title="Checklist Edit">

            <apex:pageblockbuttons >
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
            </apex:pageblockbuttons>
            
            <apex:pagemessages ></apex:pagemessages> 
            
            <apex:pageBlockSection title="Version" id="VersionPBS">
                <apex:inputField value="{! pattersonrd__NPBPCL__c.Name }"/>
                    Name this checklist after the period under review, such as "2015 Checklist" or "3rd Quarter 2017 Checklist."  Conducting regluar reviews will help you track your progress over time.
            </apex:pageBlockSection>
            
            <apex:pageBlockSection Title="Federal" id="FederalPBS" columns="1">        
                <apex:pageBlockSection Title="Nonprofit Status" id="NonprofitStatusPBS">
                    <apex:inputField value="{! pattersonrd__NPBPCL__c.pattersonrd__Obtain_501_c_3_Status__c }" />
                    Obtaining your 501(c)3 status can be a long process, typically taking 2-12 months. 
                    <apex:inputField value="{! pattersonrd__NPBPCL__c.pattersonrd__Retain_Determination_Letter__c }" />
                    You will need this document to prove your status to grantors and others.
</it goes on with input fields for quite a while and then has all the proper closing tags.  but all the input fields are in the same basic format>

 
Im doing an HTML Post callout, I have an @invokeablemethod that ties to my @future which is where my callout is. Im using the SOQL to give field data in body, serializing json then sending over. It keeps sending over the information of the last opportunity not the current one which ping process builder. How do I select the current opportunity as the only record in the query. 
 
Map < string, object > Postdata =new Map<string, object>();
    Map < string, object > Document =new Map<string, object>();
    Map < String, object > patientdata = new Map<String, object>();    
    Map < string, object > insurancedata1 = new Map <string, Object>();	      
    list<object> insurancesdata = new list<object> {insurancedata1};

        for (Opportunity client: [SELECT id, first_name__c, Last_Name__c, Date_Of_Birth1__c, Client_SSN1__c, Gender__c, Client_Email__c, Client_Phone__c, Other_Pone__c, Mailing_City__c, Mailing_State__c, Mailing_Street__c, Mailing_Zip_Postal_Code__c, Insurance_Company1__c, Insurance_Phone_Number__c, Subscriber_Name__c, Subscriber_DOB__c, INS_ID__c, INS_Group__c, Client_Relationship_to_Primary__c, Primary_Policy_Holder_Employer__c from opportunity where Opportunity.id = :  ]){

        
        insurancedata1.put('subscriber_employer', client.Primary_Policy_Holder_Employer__c);
        insurancedata1.put('subscriber_relationship', client.Client_Relationship_to_Primary__c);
        insurancedata1.put('group_ID', client.INS_Group__c);
        insurancedata1.put('policy_no', client.INS_ID__c);
        insurancedata1.put('subscriber_DOB', client.Subscriber_DOB__c);
        insurancedata1.put('subscriber_last_name', client.Subscriber_Name__c);
        insurancedata1.put('insurance_phone', client.Insurance_Phone_Number__c);
        insurancedata1.put('insurance_company', client.Insurance_Company1__c);
        patientdata.put('insurances_attributes',insurancesdata);
        patientdata.put('address_zip', client.Mailing_Zip_Postal_Code__c);
        patientdata.put('address_street', client.Mailing_Street__c);
        patientdata.put('address_state', client.Mailing_State__c);
        patientdata.put('address_city', client.Mailing_City__c);
        patientdata.put('alternate_phone', client.Other_Pone__c);
        patientdata.put('phone', client.Client_Phone__c);
        patientdata.put('email', client.Client_Email__c);
        patientdata.put('gender', client.Gender__c);
        patientdata.put('ssn', client.Client_SSN1__c);
        patientdata.put('dob', client.Date_Of_Birth1__c);
        patientdata.put('last_name', client.Last_Name__c);
        patientdata.put('first_name', client.first_name__c);
        patientdata.put('sending_app_patient_id', client.Id);
        document.put('data', patientdata);
        document.put('sending_app_name', 'Salesforce');
        document.put('recipient_id', Kipuinstanceid);
        postdata.put('document', Document);
        
    }

 
I am having issues where writing a VF page one way will work in the instance I am developing a managed package in, but not the one I install it in, or vice versa (which is even weirder to me).  Both are developer editions, and I haven't set up an environment hub (although it is on my to-do list).  Basically, if I put in the namespace prefix, it won't work in the instance I am building it in, but if I don't include the namespace prefix it won't work when I install it in a different instance.  

I feel like there must be a way for it to work in both, but I am using this project to teach myself as I go and feel like I must have missed something along the way.  

The following (condensed version) works in the development instance but throws the following error in the installed instance. 
"SObject row was retrieved via SOQL without querying the requested field: pattersonrd__NPBPCL__c.Name"  
<apex:page standardController="pattersonrd__NPBPCL__c" tabStyle="pattersonrd__NPBPCL__c">
    <apex:form >
        <apex:sectionheader title="Checklist Edit" subtitle="{! IF(NPBPCL__c.Id==null,'New Checklist',NPBPCL__c.Name)}"></apex:sectionheader>
        <apex:pageblock mode="edit" id="checklistPB" title="Checklist Edit">

            <apex:pageblockbuttons >
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
            </apex:pageblockbuttons>

            <apex:pagemessages ></apex:pagemessages> 
            		
            <apex:pageBlockSection title="Version" id="VersionPBS">
                <apex:inputField value="{! NPBPCL__c.Name }"/>
                    Name this checklist after the period under review, such as "2015 Checklist" or "3rd Quarter 2017 Checklist."  Conducting regluar reviews will help you track your progress over time.
            </apex:pageBlockSection>
            
            <apex:pageBlockSection Title="Federal" id="FederalPBS" columns="1">        
                <apex:pageBlockSection Title="Nonprofit Status" id="NonprofitStatusPBS">
                    <apex:inputField value="{! NPBPCL__c.Obtain_501_c_3_Status__c }" />
                    Obtaining your 501(c)3 status can be a long process, typically taking 2-12 months.
                    <apex:inputField value="{! NPBPCL__c.Retain_Determination_Letter__c }" />
                    You will need this document to prove your status to grantors and others.
</it goes on with input fields for quite a while and then has all the proper closing tags. but all the input fields are in the same basic format>

The following (condensed version) works in the installation instance but throws the following error in the development instance. 
"System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: pattersonrd__NPBPCL__c.Name "
<apex:page standardController="pattersonrd__NPBPCL__c" tabStyle="pattersonrd__NPBPCL__c">
    <apex:form >
        <apex:sectionheader title="Checklist Edit" subtitle="{! IF(pattersonrd__NPBPCL__c.Id==null,'New Checklist',pattersonrd__NPBPCL__c.Name)}"></apex:sectionheader>

        <apex:pageblock mode="edit" id="checklistPB" title="Checklist Edit">

            <apex:pageblockbuttons >
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
            </apex:pageblockbuttons>
            
            <apex:pagemessages ></apex:pagemessages> 
            
            <apex:pageBlockSection title="Version" id="VersionPBS">
                <apex:inputField value="{! pattersonrd__NPBPCL__c.Name }"/>
                    Name this checklist after the period under review, such as "2015 Checklist" or "3rd Quarter 2017 Checklist."  Conducting regluar reviews will help you track your progress over time.
            </apex:pageBlockSection>
            
            <apex:pageBlockSection Title="Federal" id="FederalPBS" columns="1">        
                <apex:pageBlockSection Title="Nonprofit Status" id="NonprofitStatusPBS">
                    <apex:inputField value="{! pattersonrd__NPBPCL__c.pattersonrd__Obtain_501_c_3_Status__c }" />
                    Obtaining your 501(c)3 status can be a long process, typically taking 2-12 months. 
                    <apex:inputField value="{! pattersonrd__NPBPCL__c.pattersonrd__Retain_Determination_Letter__c }" />
                    You will need this document to prove your status to grantors and others.
</it goes on with input fields for quite a while and then has all the proper closing tags.  but all the input fields are in the same basic format>