• U
  • NEWBIE
  • 50 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I created a test class in API version 32 that is trying to query the Product2 to get the Product Name. It doesn't work unless I set SeeAllData=True. In my old classes, I can query the products table directly.

I thought that according to this we can set it to false again and still be able to get the products.
https://success.salesforce.com/ideaView?id=08730000000j9TpAAI

Here's my query. 
Product2 prod = [select Id, Name, Included_Components__c, HasVersadoc__c from Product2 where Name =: productName];

Why doesn't that work unless I set "SeeAllDate=True"? 


Hi experts,

I would like to get all fields API names on specific page layout and use the fields in SOQL. Then I want to display the query results on Visualforce page.

I asked Salesforce Support for help but they cannot answer this question so I searched on Discussion Forums and found some articles about DescribeLayoutResult.
https://developer.salesforce.com/forums/?id=906F0000000AG13IAG

I read links for references but I'm just confused and not sure what to do.

Does anyone provide me simple but complete code to display field details on Visualforce page so that I can amend it for my use.
It would be nice if you can use Lead object and Name field.

Thank you in advance.


 
  • March 29, 2016
  • Like
  • 0
Hi experts,

I would like to ask you some advise for what I am doing now.

I made following page block on Visualforce page so far. I want to highligh row when I click checkbox (Address 1 Line 1 H) on the right. 
User-added image

This is sample screen that I want to get see when I select the checkbox.
User-added image

Visualforce
<apex:form>
    <apex:inlineEditSupport event="ondblclick"/>
    <apex:pageBlock title="Sample Page Block">
        <apex:pageBlockSection collapsible="false" title="Address" columns="2">
          <apex:repeat value="{!AddressFields}" var="f"> <!--AddressFields contains FieldSet, retreived by Apex-->
            <apex:outputField value="{!account[f.fieldPath]}" />
          </apex:repeat>
        </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>

​Apex - Retrieve FieldSet, called "Account_Address", by using FieldSet
public list<Schema.FieldSetMember> getAddressFields(){
      return SobjectType.Account.FieldSets.Account_Address.getFields();
}

How do you implement highligh feature?

Thank you for your comment in advance!
  • January 15, 2016
  • Like
  • 0
Hi all,

Can you please teach me how to delete Account record of Customer Portal user?

I already tried to..
1. delete ContactId on User with Developer's Console
     -> Fail. ContactId field cannot be editted
2. delete ContactId with dataLoader
     -> Fail. ContactId is not selectable from list

I am about to try Apex but since (it seems) ContactId could not be updated from Developer's Console, I wonder if it is possible to update this field from Apex.....

I appreciate any comments.

Thank you in advance!
  • September 17, 2014
  • Like
  • 0
Hi all,

I have multiple records in the list in Apex and want to display them like below by using apex:dataTable. Is it possible to do that?

Let's say I have three contact records,
Contact A
First Name : John
Phone No. : 123xx

Contact B
First Name: Emily
Phone No. 567xx

Contact C
First Name: Bob
Phone No. 987xx


I want to display three records like this table↓

==================
|  First Name  |  John    |
--------------------------------
|  Phone          |  123xx   |
================== 
First Name  |  Emily   |
--------------------------------
Phone          |  567xx   |
==================
First Name  |  Bob      |
--------------------------------
Phone          |  987xx   |
==================



*****
I could achieve this table sturucture by using apex:repeat and HTML table tag but I want to know if it is possible by using apex:dataTable
here is my sample code
<table>
 <apex:repeat value="{!lcontactList}" var="c">
  <tr><td>FirstName</td><td>{!c.FirstName}</td></tr>
  <tr><td>Phone</td><td>{!c.Phone}</td></tr>
 </apex:repeat>
</table>

Thank you in advance!
  • July 21, 2014
  • Like
  • 0
Hi experts,

I would like to get all fields API names on specific page layout and use the fields in SOQL. Then I want to display the query results on Visualforce page.

I asked Salesforce Support for help but they cannot answer this question so I searched on Discussion Forums and found some articles about DescribeLayoutResult.
https://developer.salesforce.com/forums/?id=906F0000000AG13IAG

I read links for references but I'm just confused and not sure what to do.

Does anyone provide me simple but complete code to display field details on Visualforce page so that I can amend it for my use.
It would be nice if you can use Lead object and Name field.

Thank you in advance.


 
  • March 29, 2016
  • Like
  • 0
Hi experts,

I would like to ask you some advise for what I am doing now.

I made following page block on Visualforce page so far. I want to highligh row when I click checkbox (Address 1 Line 1 H) on the right. 
User-added image

This is sample screen that I want to get see when I select the checkbox.
User-added image

Visualforce
<apex:form>
    <apex:inlineEditSupport event="ondblclick"/>
    <apex:pageBlock title="Sample Page Block">
        <apex:pageBlockSection collapsible="false" title="Address" columns="2">
          <apex:repeat value="{!AddressFields}" var="f"> <!--AddressFields contains FieldSet, retreived by Apex-->
            <apex:outputField value="{!account[f.fieldPath]}" />
          </apex:repeat>
        </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>

​Apex - Retrieve FieldSet, called "Account_Address", by using FieldSet
public list<Schema.FieldSetMember> getAddressFields(){
      return SobjectType.Account.FieldSets.Account_Address.getFields();
}

How do you implement highligh feature?

Thank you for your comment in advance!
  • January 15, 2016
  • Like
  • 0
I created a test class in API version 32 that is trying to query the Product2 to get the Product Name. It doesn't work unless I set SeeAllData=True. In my old classes, I can query the products table directly.

I thought that according to this we can set it to false again and still be able to get the products.
https://success.salesforce.com/ideaView?id=08730000000j9TpAAI

Here's my query. 
Product2 prod = [select Id, Name, Included_Components__c, HasVersadoc__c from Product2 where Name =: productName];

Why doesn't that work unless I set "SeeAllDate=True"? 


Hi all,

I have multiple records in the list in Apex and want to display them like below by using apex:dataTable. Is it possible to do that?

Let's say I have three contact records,
Contact A
First Name : John
Phone No. : 123xx

Contact B
First Name: Emily
Phone No. 567xx

Contact C
First Name: Bob
Phone No. 987xx


I want to display three records like this table↓

==================
|  First Name  |  John    |
--------------------------------
|  Phone          |  123xx   |
================== 
First Name  |  Emily   |
--------------------------------
Phone          |  567xx   |
==================
First Name  |  Bob      |
--------------------------------
Phone          |  987xx   |
==================



*****
I could achieve this table sturucture by using apex:repeat and HTML table tag but I want to know if it is possible by using apex:dataTable
here is my sample code
<table>
 <apex:repeat value="{!lcontactList}" var="c">
  <tr><td>FirstName</td><td>{!c.FirstName}</td></tr>
  <tr><td>Phone</td><td>{!c.Phone}</td></tr>
 </apex:repeat>
</table>

Thank you in advance!
  • July 21, 2014
  • Like
  • 0