• Chiel de Graaf.
  • NEWBIE
  • 35 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 14
    Replies
Hi all,

I have this VF page, which displays some fields in columns, rendered by a field value.
The only problem i encounter is that the records that are not shown because of the rendering, sstill produce a blank line.
How do i get the blank lines to not show up on the VF page.

This is de code
<apex:page standardController="Discount__c" recordSetVar="Discounts" >
   <apex:form >
   <apex:pageBlock rendered="{!If(Discount__c.Status__c !='Draft', true, false)}" title="Draft discounts">
        <apex:pageBlockTable value="{!Discounts}" var="a" >
        <apex:column headerValue="Name">        
        <apex:outputLink rendered="{!If(a.Status__c =='Draft', true, false)}" target="_blank" value="/{!a.id}">{!a.Name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Status">
        <apex:outputText value="{!a.Status__c}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>
        </apex:column>
        <apex:column headerValue="API">
        <apex:outputText value="{!a.APIPartner__r.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>
        </apex:column>
        <apex:column headerValue="MP User">
        <apex:outputText value="{!a.MP_User__r.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>  
        </apex:column>
        <apex:column headerValue="Ingansdatum">
        <apex:outputText value="{0,date,dd'/'MM'/'yyyy}" rendered="{!If(a.Status__c =='Draft', true, false)}">
        <apex:param value="{!a.Discount_Start_Date__c}" /> 
        </apex:outputText>
        </apex:column>
        <apex:column headerValue="Ingediend door">
        <apex:outputText value="{!a.CreatedBy.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>  
        </apex:column>
      </apex:pageBlockTable>
    </apex:pageBlock>
   </apex:form>         
</apex:page>
And this the output with the empty rows

User-added image

Regards
Chiel
Hi all,

We use Salesforce knowledge to display articles on a Visualforce page.
I am having a problem with word-wraps or better link-wraps.

When a link is placed in an article at the end of a line, the link(text) is wrapped to the next line. Not neatly after a word but right inside a word 

User-added image

Is there a way in the Visualforce code or in the controller code to avoid this from happening?

Kind regards
Chiel 
Hi All,

I've got this weird problem in one of my validation rules.
When setup and tested in the full sandbox environment the rule triggers as it should.
When the rule is moved to production the rule fails to trigger.

Here is the rule itself.
 
(RecordType.DeveloperName = "Campaign_Delivery" || 
RecordType.DeveloperName = "Sales_Management" || 
RecordType.DeveloperName = "Year_Deal" || 
RecordType.DeveloperName = "Aanbieding" || 
RecordType.DeveloperName = "Order_Management") && 
(ISCHANGED(StageName)|| ISNEW() ) && 
(ISPICKVAL(PRIORVALUE(StageName ),"Booking") || ISPICKVAL(StageName , "Booking")) && 
OR($UserRole.Name ="Media Sales Manager",
$UserRole.Name ="Media Account Manager",
$UserRole.Name = "Account Management (National)", 
$UserRole.Name = "Head of Aanbieding", 
$UserRole.Name = "Account Management (City)",
$UserRole.Name = "Automotive - Sales Support")

Anyone got an idea what is going wrong?

Regards
Chiel
Hi all,

I am wondering if it is possible to put a horizontal line under a slack post from Salesforce.
For now i used just underline, but on different devices it displays differently.
@InvocableMethod(label='Post to Slack')
public static void postToSlack(List<oppty> oppties) {
Oppty o = oppties[0]; // If bulk, only post first to avoid overloading Slack channel
Map<string,object> msg = new Map<string,object>();
msg.put('text', o.stage + '\r' + '\ncase number: *' + o.casenumber + '*' + '\r' +
'\n__________________________________________________________________');
msg.put('mrkdwn', true);
String body = JSON.serialize(msg);
System.enqueueJob(new QueueableSlackCall(slackURL, 'POST', body));
}

Anyone knows how to achieve this?

Regards
Chiel
Hi,

I'm trying to measure the Average Handling Time on cases. When using the status of the case, then it only calculates how much time the case has spent in a particular status. If an agent isn't working the case, but it stays in the "in progress" status it messes up the metrics.
What i want to do is how much time a case is displayed on the screen of an agent.
I don't know if this is possible. If it is has anyone got a starting point for this problem for me.


Regards
Chiel
Hi all,

I've got an Apex class which updates a specific field in all cases every hour. A "problem" occurs with locked cases (cases open with agents).
The casefield is updated through the batchrun But when the case is opened by the agent before the batchrun and closed after the batchrun, the agent gets the errormessage that the case can't be saved because it was edited by .....

Is there a possibility in the Apex code to check in the query if a case is locked by an user, and if so exclude them from the queryresults and avoid the problem described above?

Regards
Chiel
Is it possible to reference a static resource within a custom HTML email template, without using css?

I uploaded a zip file containing the wanted .ttf and i want to use it in the mail.

It has to be placed inside this piece of code: 
 
<TABLE id=Banner border=0 cellSpacing=0 cellPadding=0 width="100%"><TR><TD><TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TR><TD style="MIN-WIDTH: 16px; WIDTH: 16px"></TD><TD style="LINE-HEIGHT: 16px; WIDTH: 400px;  MAX-WIDTH: 400px; COLOR: #666666; FONT-FAMILY:Arial, Helvetica, sans-serif; FONT-SIZE: 90%; PADDING-TOP: 30px; PADDING-RIGHT: 15px" class=text vAlign=top align=left>

 
Hi all,

We have a custom setting which we use to display the top 5 most viewed articles on a VF page.
The APEX code is written so to retrieve those articles, but when i add a 6th entry and set the limit to display 6 articles, the first 5 are properly displayed, but the 6th is the first article in our KB instead of the article marked as number six in the custom setting.

I tried to figure out why this happens, but i can't find the problem.
This is the part that was written in the controller Apex.

Does anyone has an idea on how to properly display the 6th article ?
//Get most top 5 viewed articles
    private void getTop5Article(){
        final Integer TOP5_SIZE_LIMIT = 6;
        
        numAllDtoResult = 0;
        isDisableGotoContact = true;
        searchType = '';
        lDTOResult = new List<DTOResult>();
        
        List<sObject> lArticleWithTop5 = KBArticleUtil.getArticleByTopFiveOrder(KBArticleUtil.ARTICLE_OBJECT_NAME);
        Map<String, String> mVoteTmp = KBArticleUtil.getMapVote(lArticleWithTop5);
        
        for(sObject obj:lArticleWithTop5){
            Aurora__kav k = (Aurora__kav)obj;
            for(Aurora__DataCategorySelection dcs:k.DataCategorySelections){
                if(dcs.DataCategoryGroupName==ClsCategory.DEFAULT_ROOT_CATEGORY){
                    lDTOResult.add(new DTOResult(k, mAllCategorySuggestion.get(dcs.DataCategoryName), '', mVoteTmp.get(k.KnowledgeArticleId)==null?false:true, mVoteTmp.get(k.KnowledgeArticleId)));
                    break;
                } 
                
            }
            if(lDTOResult.size()==TOP5_SIZE_LIMIT) break;
        }
        
        if(lDTOResult.size()<TOP5_SIZE_LIMIT){
            List<sObject> lArticleOrderByTitle = KBArticleUtil.getArticleOrderByTitle(KBArticleUtil.ARTICLE_OBJECT_NAME);
            for(sObject obj1:lArticleOrderByTitle){
                Aurora__kav k1 = (Aurora__kav)obj1;
                for(Aurora__DataCategorySelection dcs:k1.DataCategorySelections){
                    if(dcs.DataCategoryGroupName==ClsCategory.DEFAULT_ROOT_CATEGORY){
                        lDTOResult.add(new DTOResult(k1, mAllCategorySuggestion.get(dcs.DataCategoryName), '', mVoteTmp.get(k1.KnowledgeArticleId)==null?false:true, mVoteTmp.get(k1.KnowledgeArticleId)));
                        break;
                    } 
                }
                
                if(lDTOResult.size()==TOP5_SIZE_LIMIT) break;
            }
        }
    }
    
    //Initialize all categories
    public void initializeCategories(){
        ClsCategory.initCategories();
        if(!ClsCategory.isError){
            lLevelOneCate = ClsCategory.lCateLvOne;
            mLevelTwoCate = ClsCategory.mCateLvTwo;
            mLevelThreeCate = ClsCategory.mCateLvThree;
            mAllCategorySuggestion = ClsCategory.mAllCateLv;
        }else{
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, ClsCategory.errorMsg));
        }
    }

 
I've got an Apex class which writes a description text to a case on creation.
Now i want add a date (today()) into the line of text.

Before deploying this to production (and possibly break the case creation process), can anyone tell me if the following line will do the trick ?
 
Description = 'Gegevens: \n\n Ontvangstdatum: + date.today() \n\n nummer:  ' + Code

 
I'm struggeling a little bit with the following.

I've got a visualforce page where i need to change the value of the output label when another field is changed.

Got this code in my VF page

 <apex:pageBlock mode="maindetail" id="thePageBlock"> 
                        <apex:outputPanel layout="block" id="pbsNL" >
                            <apex:pageBlockSection columns="1" title="Kies taal" id="pbsectNL">
                                <apex:pageBlockSectionItem id="pbsitemNL">
                                    <apex:outputLabel value="Taal"/>
                                    <apex:selectList size="1" id="nlSelectList" multiselect="false" onChange="changeLanguage(this.value);"> 
                                        <apex:selectOption itemValue="nl" itemLabel="Nederlands"/>
                                        <apex:selectOption itemValue="en" itemLabel="English" title="Choose language"/>
                                    </apex:selectList>
                                </apex:pageBlockSectionItem>
                            </apex:pageBlockSection>
                        </apex:outputPanel>


The bold values have to change on choosing "en" or "nl".

Anyone any suggestions?


Regards
Chiel
Hi all,

I have made a start with a visual force page to show specific records based on a field value. I've got the next code that displays all the records (but hides them when the value of field is other then "Opgelost"). What i want to achieve is that only the records with the value "Opgelost" in the field are shown.

Which bit of code should i add ?

<apex:page standardController="Storing__c" recordSetVar="Storingen">
    <apex:repeat value="{!storingen}" var="c">
            <apex:pageblock >
                    <apex:outputText value="{!c.Id}" rendered="{!c.Status__c =='Opgelost'}" />
                    <br/>
                    <apex:outputText value="{!c.Soort_storing__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Status__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Systeem__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Voor_welke_klanten_geldt_dit__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Wat_is_het_probleem__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
        </apex:pageblock>             
    </apex:repeat>
</apex:page>
Hi all,

I have this VF page, which displays some fields in columns, rendered by a field value.
The only problem i encounter is that the records that are not shown because of the rendering, sstill produce a blank line.
How do i get the blank lines to not show up on the VF page.

This is de code
<apex:page standardController="Discount__c" recordSetVar="Discounts" >
   <apex:form >
   <apex:pageBlock rendered="{!If(Discount__c.Status__c !='Draft', true, false)}" title="Draft discounts">
        <apex:pageBlockTable value="{!Discounts}" var="a" >
        <apex:column headerValue="Name">        
        <apex:outputLink rendered="{!If(a.Status__c =='Draft', true, false)}" target="_blank" value="/{!a.id}">{!a.Name}</apex:outputLink>
        </apex:column>
        <apex:column headerValue="Status">
        <apex:outputText value="{!a.Status__c}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>
        </apex:column>
        <apex:column headerValue="API">
        <apex:outputText value="{!a.APIPartner__r.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>
        </apex:column>
        <apex:column headerValue="MP User">
        <apex:outputText value="{!a.MP_User__r.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>  
        </apex:column>
        <apex:column headerValue="Ingansdatum">
        <apex:outputText value="{0,date,dd'/'MM'/'yyyy}" rendered="{!If(a.Status__c =='Draft', true, false)}">
        <apex:param value="{!a.Discount_Start_Date__c}" /> 
        </apex:outputText>
        </apex:column>
        <apex:column headerValue="Ingediend door">
        <apex:outputText value="{!a.CreatedBy.Name}" rendered="{!If(a.Status__c =='Draft', true, false)}"></apex:outputtext>  
        </apex:column>
      </apex:pageBlockTable>
    </apex:pageBlock>
   </apex:form>         
</apex:page>
And this the output with the empty rows

User-added image

Regards
Chiel
Hi All,

I've got this weird problem in one of my validation rules.
When setup and tested in the full sandbox environment the rule triggers as it should.
When the rule is moved to production the rule fails to trigger.

Here is the rule itself.
 
(RecordType.DeveloperName = "Campaign_Delivery" || 
RecordType.DeveloperName = "Sales_Management" || 
RecordType.DeveloperName = "Year_Deal" || 
RecordType.DeveloperName = "Aanbieding" || 
RecordType.DeveloperName = "Order_Management") && 
(ISCHANGED(StageName)|| ISNEW() ) && 
(ISPICKVAL(PRIORVALUE(StageName ),"Booking") || ISPICKVAL(StageName , "Booking")) && 
OR($UserRole.Name ="Media Sales Manager",
$UserRole.Name ="Media Account Manager",
$UserRole.Name = "Account Management (National)", 
$UserRole.Name = "Head of Aanbieding", 
$UserRole.Name = "Account Management (City)",
$UserRole.Name = "Automotive - Sales Support")

Anyone got an idea what is going wrong?

Regards
Chiel
I'm using the following statement in custom email template:
{!IF({!Battle_Station__c.Project_Status__c}="Green","Green","Not Green")}

It giving me an output like this:
="Green","Green","Not Green")}

Can somebody pointout what might be the reason?
Thanks in advance.
hi Team , 

i have a profile  named  " Knl_Profile  "  whih has 50 user , and that profile is added Delegated Group ie "Delegated_Knl_profile "  .  (5 / 50 )users are added to delegated system admin .  i need to write a vaildation rule in such a  way that , user detail can be edited by only delegated system admin of profile "Delegated_Knl_profile " or system admin profile . can you please help me here . getting no idea 
Hi all,

I've got an Apex class which updates a specific field in all cases every hour. A "problem" occurs with locked cases (cases open with agents).
The casefield is updated through the batchrun But when the case is opened by the agent before the batchrun and closed after the batchrun, the agent gets the errormessage that the case can't be saved because it was edited by .....

Is there a possibility in the Apex code to check in the query if a case is locked by an user, and if so exclude them from the queryresults and avoid the problem described above?

Regards
Chiel
Is it possible to reference a static resource within a custom HTML email template, without using css?

I uploaded a zip file containing the wanted .ttf and i want to use it in the mail.

It has to be placed inside this piece of code: 
 
<TABLE id=Banner border=0 cellSpacing=0 cellPadding=0 width="100%"><TR><TD><TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TR><TD style="MIN-WIDTH: 16px; WIDTH: 16px"></TD><TD style="LINE-HEIGHT: 16px; WIDTH: 400px;  MAX-WIDTH: 400px; COLOR: #666666; FONT-FAMILY:Arial, Helvetica, sans-serif; FONT-SIZE: 90%; PADDING-TOP: 30px; PADDING-RIGHT: 15px" class=text vAlign=top align=left>

 
I've got an Apex class which writes a description text to a case on creation.
Now i want add a date (today()) into the line of text.

Before deploying this to production (and possibly break the case creation process), can anyone tell me if the following line will do the trick ?
 
Description = 'Gegevens: \n\n Ontvangstdatum: + date.today() \n\n nummer:  ' + Code

 
I'm struggeling a little bit with the following.

I've got a visualforce page where i need to change the value of the output label when another field is changed.

Got this code in my VF page

 <apex:pageBlock mode="maindetail" id="thePageBlock"> 
                        <apex:outputPanel layout="block" id="pbsNL" >
                            <apex:pageBlockSection columns="1" title="Kies taal" id="pbsectNL">
                                <apex:pageBlockSectionItem id="pbsitemNL">
                                    <apex:outputLabel value="Taal"/>
                                    <apex:selectList size="1" id="nlSelectList" multiselect="false" onChange="changeLanguage(this.value);"> 
                                        <apex:selectOption itemValue="nl" itemLabel="Nederlands"/>
                                        <apex:selectOption itemValue="en" itemLabel="English" title="Choose language"/>
                                    </apex:selectList>
                                </apex:pageBlockSectionItem>
                            </apex:pageBlockSection>
                        </apex:outputPanel>


The bold values have to change on choosing "en" or "nl".

Anyone any suggestions?


Regards
Chiel
Hi all,

I have made a start with a visual force page to show specific records based on a field value. I've got the next code that displays all the records (but hides them when the value of field is other then "Opgelost"). What i want to achieve is that only the records with the value "Opgelost" in the field are shown.

Which bit of code should i add ?

<apex:page standardController="Storing__c" recordSetVar="Storingen">
    <apex:repeat value="{!storingen}" var="c">
            <apex:pageblock >
                    <apex:outputText value="{!c.Id}" rendered="{!c.Status__c =='Opgelost'}" />
                    <br/>
                    <apex:outputText value="{!c.Soort_storing__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Status__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Systeem__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Voor_welke_klanten_geldt_dit__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
                    <apex:outputText value="{!c.Wat_is_het_probleem__c}" rendered="{!c.Status__c =='Opgelost'}" style="font-weight:bold" />
                    <br/>
        </apex:pageblock>             
    </apex:repeat>
</apex:page>
global class ScheduledApexOnCase implements Schedulable {    
 
    global void execute(SchedulableContext sc) {
     
    Date today = system.today();
    Decimal caseAge;
    List<case> newCaseList = new List<case>();
     
    BusinessHours stdBusinessHours = [select id from businesshours where isDefault = true];
    newCaseList = [Select id, CreatedDate, Status, CaseAge__c from Case]; //CaseAge__c is a Text field
    for(Case eachCase: newCaseList) {        
        if(eachCase.Status != 'Closed') 
            caseAge = BusinessHours.diff(stdBusinessHours.id, eachCase.CreatedDate, today) / 1000 / 3600; 
        else
            caseAge = BusinessHours.diff(stdBusinessHours.id, eachCase.CreatedDate, eachCase.ClosedDate) / 1000 / 3600;
        eachCase.CaseAge__c = String.valueOf(caseAge) + ' hours';        
    }
    update newCaseList;
    }    
}

Here iam getting  Compile Error: Illegal assignment from String to Decimal at line 16 column 9, How to solve the above scenario please give me some ideas