• Etherios Dan
  • NEWBIE
  • 75 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies

Hello,

 

I try to rerender a pageblock that wasn't rendered before. In the page the user can select articles and add them as orderpositions to an order. When he comes here for the first time there are no orderpositions and I want to hide the pageblock. But that does not work. Here is my code:

 

<apex:page standardController="Auftragsposition__c" extensions="BarVerkaufWizardController" tabStyle="Auftragsposition__c" >
  <apex:form ID="Artikelform">

...

      <apex:PageBlock ID="ArtikelBar "rendered="{!Bar_prop}">  
      <apex:pageBlockSection title="ausgewaehlte Artikel Bar" collapsible="false" id="selectedArtBar" rendered="{!Bar_prop}">
           <apex:pageBlockTable value="{!BVAposlisteBar}" var="AP" id="selectedPBTableBar" rendered="{!Bar_prop}">
... //some columns

          </apex:pageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>

...

       <apex:pageBlock ID="Artikelblock">
              <apex:actionStatus id="Status" starttext="Suche..."/>
              <apex:pageBlockTable value="{!Artikelliste}" var="Art" id="Artikeltable">
                  <apex:column headerValue="Bar">
                      <apex:commandButton action="{!SelectedArtBar}"  rerender="ArtikelBar,selectedArtBar,selectedPBbTableBar,Gesamtpreis" value="Bar">
                        <apex:param name="b" assignTo="{!applyArtId}" value="{!Art.ID}"/>
                  </apex:commandButton>
                  </apex:column> 

...  //some more columns 

              </apex:pageBlockTable>
      </apex:pageBlock>
    </apex:form>

</apex:page>         

And here is the controller code:

 

    public Boolean Bar_prop{
        get{
            Boolean bar = True;
            system.debug ('################### Länge BVAposlisteBar ' + BVAposlisteBar.size());
            if (BVAposlisteBar.size() == 0){
                bar = False;
            }
            system.debug ('################### Bar Tabelle anzeigen ' + bar);
            return bar;
        }
        set;
    }

The system sets the right value for Bar_prop and it gets true if the user selects an article, but if the Pageblock and the pageblocksection weren't rendered before, they are not rendered. If only the pageblocktable wasn't rendered before, everything runs as expected.

 

Where is the problem?

Thanks in advance!

 

Harry

This should be super-simple, I'm just not seeing how to fix this.  I'd like to output HTML (a simple <br>) IF a certain condition is made.  Here is a snippet of my code:

 

<apex:outputField value="{!facility.Facility_Address_1__c}" />
{! IF(facility.Facility_Address_2__c!='','<br/>','NOPE')}
<apex:outputField value="{!facility.Facility_Address_2__c}" />

 

Basically, just want to output the first line of the address, if there is a second line to the address, add a new line break, then output the second line of the address.  Instead of a new line break, all I get is straight text, "<br/>" is stuck between the two address lines.

I also tried using br() and HTMLENCODE to no avail...even tried moving the text concatenation to the controller...I'm so lost...

  • January 06, 2011
  • Like
  • 0

Hello All - 

 

I am new to SF and I just wrote my first apex trigger.  I believe that in order to deploy the trigger into production I need to write test cases?  How and where do I do this?  I have looked at samples but they seem complex?

 

Any help would be great!

 

Below is my trigger....

Thanks!!!

 

 

 

trigger OrderOwnerUpdate on Opportunity (before insert, before update) {
//change the owner from customer service to RSM
ID TerritoryId;

Opportunity[] opp = Trigger.new;
for (opportunity s:opp)
  {
    if (s.name != null)
        {
            ID OpportunityOwnerId = [Select User_id__c from territories__c 
            where name = :s.opp_ship_to__c].user_id__c;
            s.ownerid = OpportunityOwnerId;
        }
  }

}

Our admin team has been tasked with re-designing the Accounts, Contacts etc. objects using Visualforce to make them cleaner and more user friendly. Has anyone come across any design templates that can be modified to fit a specific org? Basically we are trying to come up with some ideas for custom themes or styles that we can implement.

 

Any examples or hints of where to look would be greatly appreciated.

 

Thanks

I am using the code with a customer controller to manage notes and attachments.

 

    <apex:dataTable value="{!PostNoteList}" var="FbkAtt" width="100%" >
        <apex:column >
             <apex:outputLink target="_top" value="{!URLFOR($Action.Note.Edit,FbkAtt.id)}" style="font-weight: bold;">Edit</apex:outputLink> |&nbsp; 
        </apex:column>
   </apex:dataTable>  

 and i get the error: Field $Action.Note.Edit does not exist. Check spelling.

 

Curiously it works for attachment downloads

 

{!URLFOR($Action.Attachment.Download,FbkAtt.id)}

but not Edit or Delete

 

Any help much appreciated.

 

 

  • January 07, 2011
  • Like
  • 0

Hello,

 

I try to rerender a pageblock that wasn't rendered before. In the page the user can select articles and add them as orderpositions to an order. When he comes here for the first time there are no orderpositions and I want to hide the pageblock. But that does not work. Here is my code:

 

<apex:page standardController="Auftragsposition__c" extensions="BarVerkaufWizardController" tabStyle="Auftragsposition__c" >
  <apex:form ID="Artikelform">

...

      <apex:PageBlock ID="ArtikelBar "rendered="{!Bar_prop}">  
      <apex:pageBlockSection title="ausgewaehlte Artikel Bar" collapsible="false" id="selectedArtBar" rendered="{!Bar_prop}">
           <apex:pageBlockTable value="{!BVAposlisteBar}" var="AP" id="selectedPBTableBar" rendered="{!Bar_prop}">
... //some columns

          </apex:pageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>

...

       <apex:pageBlock ID="Artikelblock">
              <apex:actionStatus id="Status" starttext="Suche..."/>
              <apex:pageBlockTable value="{!Artikelliste}" var="Art" id="Artikeltable">
                  <apex:column headerValue="Bar">
                      <apex:commandButton action="{!SelectedArtBar}"  rerender="ArtikelBar,selectedArtBar,selectedPBbTableBar,Gesamtpreis" value="Bar">
                        <apex:param name="b" assignTo="{!applyArtId}" value="{!Art.ID}"/>
                  </apex:commandButton>
                  </apex:column> 

...  //some more columns 

              </apex:pageBlockTable>
      </apex:pageBlock>
    </apex:form>

</apex:page>         

And here is the controller code:

 

    public Boolean Bar_prop{
        get{
            Boolean bar = True;
            system.debug ('################### Länge BVAposlisteBar ' + BVAposlisteBar.size());
            if (BVAposlisteBar.size() == 0){
                bar = False;
            }
            system.debug ('################### Bar Tabelle anzeigen ' + bar);
            return bar;
        }
        set;
    }

The system sets the right value for Bar_prop and it gets true if the user selects an article, but if the Pageblock and the pageblocksection weren't rendered before, they are not rendered. If only the pageblocktable wasn't rendered before, everything runs as expected.

 

Where is the problem?

Thanks in advance!

 

Harry

Hi developers,

                        how can we change the default Salesforce CRM UI.

defaultly some look and feel is observing in CRM but is possible to change as we customize some social networks themes. How can we? plz suggest options.

This should be super-simple, I'm just not seeing how to fix this.  I'd like to output HTML (a simple <br>) IF a certain condition is made.  Here is a snippet of my code:

 

<apex:outputField value="{!facility.Facility_Address_1__c}" />
{! IF(facility.Facility_Address_2__c!='','<br/>','NOPE')}
<apex:outputField value="{!facility.Facility_Address_2__c}" />

 

Basically, just want to output the first line of the address, if there is a second line to the address, add a new line break, then output the second line of the address.  Instead of a new line break, all I get is straight text, "<br/>" is stuck between the two address lines.

I also tried using br() and HTMLENCODE to no avail...even tried moving the text concatenation to the controller...I'm so lost...

  • January 06, 2011
  • Like
  • 0

Hello All - 

 

I am new to SF and I just wrote my first apex trigger.  I believe that in order to deploy the trigger into production I need to write test cases?  How and where do I do this?  I have looked at samples but they seem complex?

 

Any help would be great!

 

Below is my trigger....

Thanks!!!

 

 

 

trigger OrderOwnerUpdate on Opportunity (before insert, before update) {
//change the owner from customer service to RSM
ID TerritoryId;

Opportunity[] opp = Trigger.new;
for (opportunity s:opp)
  {
    if (s.name != null)
        {
            ID OpportunityOwnerId = [Select User_id__c from territories__c 
            where name = :s.opp_ship_to__c].user_id__c;
            s.ownerid = OpportunityOwnerId;
        }
  }

}

Hi

 

I develop a managed package which I test now on few SF editions.

There is a VisualPage which work fine on EE and Dev editions, while in PE edition I got the following error: "SObject row was retrieved via SOQL without querying the requested field..."

 

I know this error is happen when I do not add the field to the query, but in this situation I add it to the query and also I don't understand why the same package on the same page is works fine on EE edition but not on PE edition.

 

Yitzchak

 

  • December 30, 2011
  • Like
  • 0