• Scott0987
  • NEWBIE
  • 335 Points
  • Member since 2012

  • Chatter
    Feed
  • 13
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 63
    Questions
  • 58
    Replies

What I want to do is have a visualforce page that displays a simple text message something like "This page will close in 5 seconds" I then want to run a method or update a variable or something that will close the page.  I have used a method where you nest javascript in an output panel to get the page to close just not sure how to do the whole 5 second thing.  I am pretty good with visualforce and apex but have very little java knowledge.  Any help would be greatly appreciated.  

I have a page that is a license agreement.  It is a simple visualforce page.  I have renderas="PDF" set on it and it renders correctly as a PDF document.  What I then want to do is using a second page attach the first page to an opportunity as an attachment.   It seems to work but the attachment will not open.  My PDF program just says Loading...  Here is my class:

public with sharing class testing2ext {

	public blob pdfDoc {get;set;}
	public Attachment att {get;set;}

	public void runAtStart(){
		PageReference pdfPage = new PageReference('/apex/testing?id='+apexpages.currentpage().getparameters().get('id'));
		pdfDoc = pdfPage.getContentAsPdf();
		att = new Attachment();
		att.body=pdfDoc;
		att.ContentType='PDF';
		att.IsPrivate=false;
		att.Name='testing.pdf';
		att.ParentId=apexpages.currentpage().getparameters().get('id');
		insert att;
	}

}

 Any ideas why the attachment will not open after being attached?

What I am trying to do is convert a string like opportunity.name from the string opportunity.name into the field so that I can then assign a value to that field and update it.  What I don't know how to do is take my string and make it the value for the field.  

I have a pretty large visualforce page that I am having people fill out.  I have set about 50 fields on it to be required like <apex:inputfield required="true" value="{!var1}">  I want the field to be required so that before they can finish the page they need to fill that field out.  I would also like to give them a "Save and Continue" button so that they can save their progress.  I want this button to bypass the required flag but it needs to pass the variable var1 to the method so that it saves it.  Then I want a second save button that enforces the required flag.  Is there anyway to do this?

I have a site that has solutions on it.  If you log into the system and pull up the visualforce page you can see all of the fields for the solutions on the page.  But if you pull up the site that is linked to that visualforce page all Custom Fields on Solutions do not show up.  I have gone through all the permissions and everything is correct as far as I can tell.  Anyone have any idea why this might be happening?

I have a visualforce page that I have setup as a site using salesforce's built in method of doing that.  The site ends in /ci?************** where the * are replaced by a random string.  I have a button that changes a boolean from true to false.  It should then refresh the page so that a portion of the page controlled by the boolean shows or not.  What happens throw is when the command button is pressed the url changes to /ci/caseinfo   where caseinfo is the name of the visualforce page.  Any idea why the url would be changing like that?

I have a page that opens a popup window to input a new case comment.  when the comment is saved I want it to close the popup window and refresh the page that opened it so that it shows the new comment.   It just seems to do nothing.  I can replace the code that is supposed to reload the opener window with allert('afadsfdfa'); and it will popup an allert so I know the function is running.  

 

Here is the parent page:

<apex:tab label="Updates">
            <!-- script for poup window -->
            <script type="text/javascript">function newPopup(url) {popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')}</script>
            <!-- end script for poup window -->
            <apex:commandlink onclick="JavaScript&colon;newPopup('{!url}');" >Post Update
            </apex:commandlink>

 Here is the popup page:

<script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
    window.opener.location.reload(true);
    window.top.close();
}
</script>
<apex:form >
    <apex:outputlabel >Enter an update</apex:outputlabel><br />
    <apex:inputtextarea value="{!newUpdate}" rows="5" cols="35"/><br />
    <apex:commandbutton value="Cancel"/>
    <apex:commandButton value="OK" action="{!updteCase}" oncomplete="javascript&colon; CloseAndRefresh()" />
</apex:form>

 Thanks for any help you can give me. 

I have a csv file that has about 30 custom fields that I need to add to salesforce.  The file has the field type like text(255), Date, Checkbox, and so forth.   Is there any way to import them into salesforce?  I would be interested in any option even if it requires the ide or an app.  Thanks.

I have a page I am creating that will send some information to a seperate site.  The code to send the information to that site is written in asp.  Can I include asp on a visualforce page?

I would like to run a trigger when a user logs out of Salesforce.   Is there a way to change salesforce's logout behavior?  I know that I could create a button that could do anything I want but I would like to have the session timeout be able to log the user out and have the trigger run at that point also. 

I am pretty new to batch apex.  I have written it a couple of times for database querys, but have a different need for it and am not sure where to go with it.  What I have is an integer say 150,000.  I would like to ran batch apex on it in groups of 10,000.  how would I go about doing that?

I have a requirement where I have an api key that needs to be stored in salesforce and then called from a visualforce page.  I do not want all uses to be able to see the field values and so have encrypted them.  All users though should be able to access the visualforce page where the encrypted field will be part of an api call out.  So here is what my code looks like:

d = [select fieldvalue__c from customSobject__c];

HttpRequest req = new HttpRequest();
req.setEndpoint('http://' + d.fieldvalue__c + 'restoftheURL');

 When I just open the visualforce page this works fine.  But the page is part of an account layout and on that page I get an error: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://*****.restoftheURL.com  On the page layout it puts the * symbols in and so does not work correctly.  

 

I hope this isn't a dumb question but I am still fairly new to apex.  I have an http callout in an @ future method.  Is there a way to wait for the response before moving on with the rest of the code?  Here is my code if that helps.

@future

HttpRequest req = new HttpRequest();
        req.setEndpoint('http://..... endpoint here);
        req.setMethod('GET');
        Http http = new Http();
        HTTPResponse res = http.send(req);
        JSONParser parser = JSON.createParser(res.getBody());
        //I want it to wait here for the response before moving on.
        while (parser.nextToken() != null) {
        if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
                String fieldName = parser.getText();
                parser.nextToken();
                if(fieldname == 'id') {
                    IDset.add(parser.getText());
                }
            }
        }

 

I am pretty new to apex and have never used batch apex.  I have read about it but don't quite understand it.  I have the need to write some code that will make http call outs.  My problem is that I am not sure of the exact number of call outs and I believe the govenor limit is 10.  My code for 1 call out looks like this:

global void runCallOuts{
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http........endpointhere);
    req.setMethod('GET');
    Http http = new Http();
    HTTPResponse res = http.send(req);
    JSONParser parser = JSON.createParser(res.getBody());
    while (parser.nextToken() != null) {
        if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
            String fieldName = parser.getText();
            parser.nextToken();
            if(fieldname == 'id') {
                IDset.add(parser.getText());
            }
        }
    }
}

 What I need to do is be able to run that piece of code for each of a specific sObject that meets the requirements.  I then want to set that to run every day at 5pm or some other specific time.  Thanks for the help.  

So what I have is an object that has a lookup field.  On my visualforce page I have an inputfield that is linked to the lookup field.  I need to have the lookup button on it so that the user can change the record that it is connected to, but I don't want to display the name on the field.  I would like to display a different field from the lookup object.  Is there a way to do that? 

I have a visualforce page with a list on it.  I want to be able to click a button on that list and have it open a popup allowing the user to edit the item from the list.  Then on he popup they would hit a button to put the edited data back in the list and close the popup. My issue is that I am not sure how to tie the information all together.  

Here is my visualforce page:

<apex:pageblocktable value="{!LineItemList}" var="lil" border="0"  columnsWidth="60px, 200px, 200px" width="100%" >
<apex:column headerValue="Action">
<apex:commandButton value="X" />
</apex:column>
<apex:column headerValue="Serial #">
<apex:inputField value="{!lil.SerialNo__c}"/>
</apex:column>
<apex:column headerValue="Part #" >
<apex:inputField value="{!lil.Part_Number_2__c}"/>
</apex:column>
<apex:column headerValue="Ship To Address" >
<apex:outputField value="{!lil.Display_Address__c}"/>
<span class="lookupInput">
<script type="text/javascript">function newPopup(url) {popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')}</script>
<apex:commandlink onclick="JavaScript&colon;newPopup('{!url}');">
<apex:param value="{!lil.ShipToAddress__c}"/>
<img src="/s.gif" alt="Ship To Address Lookup (New Window)"  class="lookupIcon" onblur="this.className = 'lookupIcon';" onfocus="this.className = 'lookupIconOn';" onmouseout="this.className = 'lookupIcon';this.className = 'lookupIcon';" onmouseover="this.className = 'lookupIconOn';this.className = 'lookupIconOn';" title="Ship To Address Lookup (New Window)"/>
</apex:commandlink>
</span>
</apex:column>
</apex:pageblocktable>

Here is the popup page:

<apex:form >
<apex:pageBlock >
<apex:pageBlockSection columns="1" >
<apex:dataTable value="{!AllAddresses}" var="a" rules="rows" cellpadding="3px">
<apex:column width="80%" >
<apex:outputField value="{!a.Full_Address__c}"/>
</apex:column>
<apex:column >
<apex:commandButton value="Select"/>
</apex:column>
</apex:dataTable>
<apex:commandButton value="Add New"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>

 Here is the controller that both pages use:

public list<OrderLine__c> getLineItemList(){
	newLineItems = new list<OrderLine__c>();
	billA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Bill To'];
	shipA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Ship To'];    
	ol0 = new OrderLine__c();
	ol1 = new OrderLine__c();
	ol2 = new OrderLine__c();
	ol3 = new OrderLine__c();
	ol4 = new OrderLine__c();
	ol5 = new OrderLine__c();
	ol6 = new OrderLine__c();
	ol7 = new OrderLine__c();
	ol8 = new OrderLine__c();
	ol9 = new OrderLine__c();
	ol0.ShipToAddress__c = shipA.id;
	ol1.ShipToAddress__c = shipA.id;
	ol2.ShipToAddress__c = shipA.id;
	ol3.ShipToAddress__c = shipA.id;
	ol4.ShipToAddress__c = shipA.id;
	ol5.ShipToAddress__c = shipA.id;
	ol6.ShipToAddress__c = shipA.id;
	ol7.ShipToAddress__c = shipA.id;
	ol8.ShipToAddress__c = shipA.id;
	ol9.ShipToAddress__c = shipA.id;
	ol0.Display_Address__c = shipA.Full_Address__c;
	ol1.Display_Address__c = shipA.Full_Address__c;
	ol2.Display_Address__c = shipA.Full_Address__c;
	ol3.Display_Address__c = shipA.Full_Address__c;
	ol4.Display_Address__c = shipA.Full_Address__c;
	ol5.Display_Address__c = shipA.Full_Address__c;
	ol6.Display_Address__c = shipA.Full_Address__c;
	ol7.Display_Address__c = shipA.Full_Address__c;
	ol8.Display_Address__c = shipA.Full_Address__c;
	ol9.Display_Address__c = shipA.Full_Address__c;   
	newLineItems = new list<OrderLine__c>();
	newLineItems.add(ol0);
	newLineItems.add(ol1);
	newLineItems.add(ol2);
	newLineItems.add(ol3);
	newLineItems.add(ol4);
	newLineItems.add(ol5);
	newLineItems.add(ol6);
	newLineItems.add(ol7);
	newLineItems.add(ol8);
	newLineItems.add(ol9);
return newLineItems;
}
url = '/apex/rmaAddressLookup?id='+acct.id
public list<address__c> addressLookup = new list<address__c>();
    public list<address__c> getAllAddresses(){
        addressLookup = [select Full_Address__c from Address__c where Account__c = :apexPages.currentPage().getParameters().get('id')];
    return addressLookup;
    }

 Any help you can give would be greatly appreciated.  Thanks. 

 

 Here is my controller:

I have a controller that creates a list and then the list is displayed in a pageblocktable.  For some reason one of the fields is not showing and I have no idea why.

here is the visualforce page:

<apex:pageblocktable value="{!LineItemList}" var="lil" border="0"  columnsWidth="60px, 200px, 200px" width="100%" >
<apex:column headerValue="Action">
<apex:commandButton value="X" />
</apex:column>
<apex:column headerValue="Serial #">
<apex:inputField value="{!lil.SerialNo__c}"/>
</apex:column>
<apex:column headerValue="Part #" >
<apex:inputField value="{!lil.Part_Number_2__c}"/>
</apex:column>
<apex:column headerValue="Ship To Address" >
<apex:inputField value="{!lil.Display_Address__c}"/>
</apex:column>
</apex:pageblocktable>

 Here is the controller:

public list<OrderLine__c> getLineItemList(){
	billA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Bill To'];
	shipA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Ship To'];    
	newLineItems = new list<OrderLine__c>();
	ol0 = new OrderLine__c();
	ol1 = new OrderLine__c();
	ol2 = new OrderLine__c();
	ol3 = new OrderLine__c();
	ol4 = new OrderLine__c();
	ol5 = new OrderLine__c();
	ol6 = new OrderLine__c();
	ol7 = new OrderLine__c();
	ol8 = new OrderLine__c();
	ol9 = new OrderLine__c();
	ol0.ShipToAddress__c = shipA.id;
	ol1.ShipToAddress__c = shipA.id;
	ol2.ShipToAddress__c = shipA.id;
	ol3.ShipToAddress__c = shipA.id;
	ol4.ShipToAddress__c = shipA.id;
	ol5.ShipToAddress__c = shipA.id;
	ol6.ShipToAddress__c = shipA.id;
	ol7.ShipToAddress__c = shipA.id;
	ol8.ShipToAddress__c = shipA.id;
	ol9.ShipToAddress__c = shipA.id;
	ol0.Display_Address__c = shipA.Full_Address__c;
	ol1.Display_Address__c = shipA.Full_Address__c;
	ol2.Display_Address__c = shipA.Full_Address__c;
	ol3.Display_Address__c = shipA.Full_Address__c;
	ol4.Display_Address__c = shipA.Full_Address__c;
	ol5.Display_Address__c = shipA.Full_Address__c;
	ol6.Display_Address__c = shipA.Full_Address__c;
	ol7.Display_Address__c = shipA.Full_Address__c;
	ol8.Display_Address__c = shipA.Full_Address__c;
	ol9.Display_Address__c = shipA.Full_Address__c;   
	newLineItems = new list<OrderLine__c>();
	newLineItems.add(ol0);
	newLineItems.add(ol1);
	newLineItems.add(ol2);
	newLineItems.add(ol3);
	newLineItems.add(ol4);
	newLineItems.add(ol5);
	newLineItems.add(ol6);
	newLineItems.add(ol7);
	newLineItems.add(ol8);
	newLineItems.add(ol9);
	system.debug('***** newLineItems *****'+newLineItems);
return newLineItems;
}

 Here is the debug log:

***** newLineItems *****(OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM})

 the issue I have is that the Display_Address__c field does not display.  Any idea why?

I am looking for a method to backup the code for a visualforce page and controller.  If it could do it once a day that would be ok.  If it did it on a button click that would be great also.  Is there anything out there that can do that, or is there a way I can write an apex code to do it? 

I think a signature is what I am looking for but am not sure.  Here is what I want to do.  Some methods when you pass information to them have something like

 

public void mymethod(string abcd){

method here...

}

 

then when calling the method you have to pass a string onto the method.  I would like to setup something similar but have it be a list that is passed on.  So something like

public void mymethod(list abcdList){

method here....

}

 

I think that area is called a signature, but am not sure.  Can someone point me in the right direction?

I am trying to get the account and contact based on the portal user and is running the apex code.  I can get the user id using :

 

user uid = [select id from user where id = :UserInfo.getUserId()];

 

but when I add contact to that I get an error " No such column 'Contact' on entity 'User'" even though when I open the user object it has a lookup field called contact.  Any idea how to get the contact and account?

I have a site that has solutions on it.  If you log into the system and pull up the visualforce page you can see all of the fields for the solutions on the page.  But if you pull up the site that is linked to that visualforce page all Custom Fields on Solutions do not show up.  I have gone through all the permissions and everything is correct as far as I can tell.  Anyone have any idea why this might be happening?

I know that objects in salesforce have a 3 digit id, for instance accounts id is 001 so if you type /001 after salesforce.com/ in the url it will pull up a list of the accounts.  I can think of a number of times where having this id could be handy.  Is there a list someone of the default id's?  Also I know that custom objects have an id like this, but the only way I have found to get that ID is to create a tab for the object, open the tab and get the id from the URL.  I was hoping there is a better way to get those ID's.  Thanks.

I have a page that is a license agreement.  It is a simple visualforce page.  I have renderas="PDF" set on it and it renders correctly as a PDF document.  What I then want to do is using a second page attach the first page to an opportunity as an attachment.   It seems to work but the attachment will not open.  My PDF program just says Loading...  Here is my class:

public with sharing class testing2ext {

	public blob pdfDoc {get;set;}
	public Attachment att {get;set;}

	public void runAtStart(){
		PageReference pdfPage = new PageReference('/apex/testing?id='+apexpages.currentpage().getparameters().get('id'));
		pdfDoc = pdfPage.getContentAsPdf();
		att = new Attachment();
		att.body=pdfDoc;
		att.ContentType='PDF';
		att.IsPrivate=false;
		att.Name='testing.pdf';
		att.ParentId=apexpages.currentpage().getparameters().get('id');
		insert att;
	}

}

 Any ideas why the attachment will not open after being attached?

What I am trying to do is convert a string like opportunity.name from the string opportunity.name into the field so that I can then assign a value to that field and update it.  What I don't know how to do is take my string and make it the value for the field.  

I have a pretty large visualforce page that I am having people fill out.  I have set about 50 fields on it to be required like <apex:inputfield required="true" value="{!var1}">  I want the field to be required so that before they can finish the page they need to fill that field out.  I would also like to give them a "Save and Continue" button so that they can save their progress.  I want this button to bypass the required flag but it needs to pass the variable var1 to the method so that it saves it.  Then I want a second save button that enforces the required flag.  Is there anyway to do this?

I have a site that has solutions on it.  If you log into the system and pull up the visualforce page you can see all of the fields for the solutions on the page.  But if you pull up the site that is linked to that visualforce page all Custom Fields on Solutions do not show up.  I have gone through all the permissions and everything is correct as far as I can tell.  Anyone have any idea why this might be happening?

I have a visualforce page that I have setup as a site using salesforce's built in method of doing that.  The site ends in /ci?************** where the * are replaced by a random string.  I have a button that changes a boolean from true to false.  It should then refresh the page so that a portion of the page controlled by the boolean shows or not.  What happens throw is when the command button is pressed the url changes to /ci/caseinfo   where caseinfo is the name of the visualforce page.  Any idea why the url would be changing like that?

I would like to run a trigger when a user logs out of Salesforce.   Is there a way to change salesforce's logout behavior?  I know that I could create a button that could do anything I want but I would like to have the session timeout be able to log the user out and have the trigger run at that point also. 

I am pretty new to batch apex.  I have written it a couple of times for database querys, but have a different need for it and am not sure where to go with it.  What I have is an integer say 150,000.  I would like to ran batch apex on it in groups of 10,000.  how would I go about doing that?

I hope this isn't a dumb question but I am still fairly new to apex.  I have an http callout in an @ future method.  Is there a way to wait for the response before moving on with the rest of the code?  Here is my code if that helps.

@future

HttpRequest req = new HttpRequest();
        req.setEndpoint('http://..... endpoint here);
        req.setMethod('GET');
        Http http = new Http();
        HTTPResponse res = http.send(req);
        JSONParser parser = JSON.createParser(res.getBody());
        //I want it to wait here for the response before moving on.
        while (parser.nextToken() != null) {
        if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
                String fieldName = parser.getText();
                parser.nextToken();
                if(fieldname == 'id') {
                    IDset.add(parser.getText());
                }
            }
        }

 

I am pretty new to apex and have never used batch apex.  I have read about it but don't quite understand it.  I have the need to write some code that will make http call outs.  My problem is that I am not sure of the exact number of call outs and I believe the govenor limit is 10.  My code for 1 call out looks like this:

global void runCallOuts{
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http........endpointhere);
    req.setMethod('GET');
    Http http = new Http();
    HTTPResponse res = http.send(req);
    JSONParser parser = JSON.createParser(res.getBody());
    while (parser.nextToken() != null) {
        if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
            String fieldName = parser.getText();
            parser.nextToken();
            if(fieldname == 'id') {
                IDset.add(parser.getText());
            }
        }
    }
}

 What I need to do is be able to run that piece of code for each of a specific sObject that meets the requirements.  I then want to set that to run every day at 5pm or some other specific time.  Thanks for the help.  

I have a controller that creates a list and then the list is displayed in a pageblocktable.  For some reason one of the fields is not showing and I have no idea why.

here is the visualforce page:

<apex:pageblocktable value="{!LineItemList}" var="lil" border="0"  columnsWidth="60px, 200px, 200px" width="100%" >
<apex:column headerValue="Action">
<apex:commandButton value="X" />
</apex:column>
<apex:column headerValue="Serial #">
<apex:inputField value="{!lil.SerialNo__c}"/>
</apex:column>
<apex:column headerValue="Part #" >
<apex:inputField value="{!lil.Part_Number_2__c}"/>
</apex:column>
<apex:column headerValue="Ship To Address" >
<apex:inputField value="{!lil.Display_Address__c}"/>
</apex:column>
</apex:pageblocktable>

 Here is the controller:

public list<OrderLine__c> getLineItemList(){
	billA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Bill To'];
	shipA = [select Full_Address__c from Address__c where Account__c = :acct.id AND Default__c = true AND Type__c = 'Ship To'];    
	newLineItems = new list<OrderLine__c>();
	ol0 = new OrderLine__c();
	ol1 = new OrderLine__c();
	ol2 = new OrderLine__c();
	ol3 = new OrderLine__c();
	ol4 = new OrderLine__c();
	ol5 = new OrderLine__c();
	ol6 = new OrderLine__c();
	ol7 = new OrderLine__c();
	ol8 = new OrderLine__c();
	ol9 = new OrderLine__c();
	ol0.ShipToAddress__c = shipA.id;
	ol1.ShipToAddress__c = shipA.id;
	ol2.ShipToAddress__c = shipA.id;
	ol3.ShipToAddress__c = shipA.id;
	ol4.ShipToAddress__c = shipA.id;
	ol5.ShipToAddress__c = shipA.id;
	ol6.ShipToAddress__c = shipA.id;
	ol7.ShipToAddress__c = shipA.id;
	ol8.ShipToAddress__c = shipA.id;
	ol9.ShipToAddress__c = shipA.id;
	ol0.Display_Address__c = shipA.Full_Address__c;
	ol1.Display_Address__c = shipA.Full_Address__c;
	ol2.Display_Address__c = shipA.Full_Address__c;
	ol3.Display_Address__c = shipA.Full_Address__c;
	ol4.Display_Address__c = shipA.Full_Address__c;
	ol5.Display_Address__c = shipA.Full_Address__c;
	ol6.Display_Address__c = shipA.Full_Address__c;
	ol7.Display_Address__c = shipA.Full_Address__c;
	ol8.Display_Address__c = shipA.Full_Address__c;
	ol9.Display_Address__c = shipA.Full_Address__c;   
	newLineItems = new list<OrderLine__c>();
	newLineItems.add(ol0);
	newLineItems.add(ol1);
	newLineItems.add(ol2);
	newLineItems.add(ol3);
	newLineItems.add(ol4);
	newLineItems.add(ol5);
	newLineItems.add(ol6);
	newLineItems.add(ol7);
	newLineItems.add(ol8);
	newLineItems.add(ol9);
	system.debug('***** newLineItems *****'+newLineItems);
return newLineItems;
}

 Here is the debug log:

***** newLineItems *****(OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM}, OrderLine__c:{Display_Address__c=877n 8888s, dunesburry, Footah, foolah, 98745, ShipToAddress__c=a0SV00000014BTgMAM})

 the issue I have is that the Display_Address__c field does not display.  Any idea why?

I am trying to get the account and contact based on the portal user and is running the apex code.  I can get the user id using :

 

user uid = [select id from user where id = :UserInfo.getUserId()];

 

but when I add contact to that I get an error " No such column 'Contact' on entity 'User'" even though when I open the user object it has a lookup field called contact.  Any idea how to get the contact and account?

I have a map that is Map<string, id>  I want to get the information from the map.  I have a variable that will have the key information thatI want to get from the map.  If I put map.get(variable) I get a return of Null.   If I put map.get('12345') I get the correct result.  12345 is the information in the map.  If I use system.debug it shows that my variable has 12345.  Any idea why if I use a variable in the map.get(HERE) I do not get a result?

I am building an upload where the end user can upload a csv file and the page parses it and then will input the contents of the file.  The issue I am having is related to products.  One of the fields is a lookup to products.  I have created a list and then put that list into a map so that I can get the ID I need.  The problem I am having is that the map is not returning a result.  I have debuged it a bunch and can take the debug result and put it in and the map returns the result correctly.  

public class RMA_Upload_Ext {

    public boolean sec1 {get;set;}
    public boolean sec2 {get;set;}
    public blob contentFile {get;set;}
    public string nameFile {get;set;}
    public list<String> filelines {get;set;}
    list<OrderLine__c> LineItems {get;set;}
    public OrderLine__c oline {get;set;}
    public map<string, id> prodMap = new map<string, id>();


    public RMA_Upload_Ext(ApexPages.StandardController controller) {
        sec1=true;
        sec2 = false;
        oline = new OrderLine__c();
    }
    
    public void sec1to2(){
        sec1=false;
        sec2=true;
    }


    public pagereference readFile(){
        try{
            nameFile = contentFile.toString();
            filelines = nameFile.split('\n');
        }
        catch (Exception e){
            apexpages.message errormsg = new apexpages.message(apexpages.severity.error, ' File Must be in CSV Formate only ');
            apexpages.addmessage(errormsg);
        }
        LineItems = new list<OrderLine__c>();
        list<product2> pl = [select name, id from Product2 all rows];
        map<string, id> pm = new map<string, id>();
        for(product2 p : pl){
            prodMap.put(p.name, p.id);
        }
        for (integer i=1; i<filelines.size();i++){
            list<string> values = new list<string>();
            values = filelines[i].split(',');
            OrderLine__c o = new OrderLine__c();
            o.ShipToAddress__c=oLine.ShipToAddress__c;
            //id p = pm.get(values[1]);
            o.PartNumber__c = prodMap.get(values[1]);//Here is where the issue is.  I can replace this with 1113135 and it returns the result fine.  
            system.debug('*****'+prodmap);
            system.debug('*****'+values[1]);
            system.debug('*****'+prodMap.get(values[1]));
            system.debug('*****'+o.PartNumber__c);
            o.SerialNo__c = values[0];
        LineItems.add(o);
        }
    system.debug('*****' + lineitems);

    return null;
    }
}

 Help Please. Thanks.  

I would like to get a list of all of the products in the org so that I can work with it.  I have tried:

 list<product2> pl = [select name, id from Product2];

but I am only getting a few products not all of them.   Any idea how I can do this?