• Jyoti Trailhead
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 15
    Replies
I have below code but it is not working - it is showing table row even if Location is not matching...... it displays Location value correctly:

<tr  style="{IF({!$User.Office_Location__c} = 'XXXX'),'display: table-row;,none;'}">
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
         </div>
    </td>
  </tr>
Hi 

I have an existing VF page which doesn't have any cotroller - it is showing links to others tabs/ pages, I need to show one tile to users only if they are from one particular location - user.location field in User object.

Here is  my code:

<tr  onClick="parent.addTab('BMCRF_HR_ListTickets','Tickets and Requests')">
    <td class="button" width="38em" height="69">
      <div>
      <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewTickets1)}"/>
      <div style="float:inherit">View Tickets</div>
      </div>
    </td>
  </tr>

  <tr  onClick="parent.addTab('BMCRF_HR_KnowledgeArticles','Self Help Articles')">
    <td class="button" width="38em" height="69">
      <div>
      <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewKA1)}"/>
      <div style="float:inherit">View HR and Benefits Knowledge Articles</div> <!--Code Change(Mayur): Label changed from View Knowledge Articles-->
      </div>
    </td>
  </tr>
  
  <tr>
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
      <!--<div style="float:inherit">HR Chatbot</div> <!--Code Change(Mayur): Label changed from View Knowledge Articles-->
      </div>
    </td>
  </tr>


I need to show the bold HR Chatbot option only to North America users.

Please help.

Regards
 
I am trying to run this code in Anonymous window:

List<Contact> ConList = New List<Contact>();
ConList = [Select id, name, Account.name, Parent_Account__r.name from Contact where Parent_Account__r.name != Account.Parent.name];
System.debug('Contact records :    ' + Con1);

getting error:

Line: 2, Column: 9
Unexpected token '='.

I need to run below query in Dev console or workbench to get the contact records where Parent Account on Contact is not equal to Parent Account of Account:

select id, name, Account.name, Parent_Account__r.name,(Select id,name, Parent.name from Account) from Contact where Parent_Account__r.name != Account.Parent.name

Please help

 
I have a VF page in which VF component is called using <C: VF Component/>

I need to show an error message based on entitlement of logged in user - entitlement functionality is defined in Component controller and isused in Component. Can I call those parameters set for entitlement in Component Controller in my VF page and based on that show error message else show my page content.

Please suggest- this is urgent.

Thanks
Jyoti
 
Hi
I need to built a page with say two or more fields – their values will be Yes or No – based on if it is selected or not.
Get these field values in class and based on field values set variable values and call the function e.g:
VF Page:
Text1: Yes(it is a radio button)
Text2: Yes(radio)
call saveList from action button on VF page.
Apex Class:
Public String Cat
Public String Req
public PageReference saveList()
{
if(Text1 == Yes):
Cat = ‘abc’
Req = ‘abc’
CallFunction(Cat,Req)
}
if(Text2 == ‘Yes’){
Cat = ‘def’
Req = ‘def’
CallFunction(Cat,Req)
}
}
public void CallFuntion(String Cat, String Req)
{
statements;
}
Hi 

I am new to Apex and created a class to delete Assets from Base Element class of particular status - here is the code : please help me in creating test class for code coverage.

##############################################################

global class BMCRF_ScheduledDeleteAssets Implements Schedulable {
  global void execute(SchedulableContext sc) {
       massDelete();
    }    
          // Query the accounts to delete
        public void massDelete() {
        List <BMCServiceDesk__BMC_BaseElement__c> listtoDelete = [Select Id FROM BMCServiceDesk__BMC_BaseElement__c WHERE BMCServiceDesk__CI_Status__c =: 'Disposal'];

        // Delete the assets
        Database.DeleteResult[] drList = Database.delete(listtoDelete, false);
           // Iterate through each returned result
               for(Database.DeleteResult dr : drList) {
               if (dr.isSuccess()) {
            // Operation was successful, so get the ID of the record that was processed
                System.debug('Successfully deleted account with ID: ' + dr.getId());
                }
                else {
                    for(Database.Error err : dr.getErrors()) {
                    System.debug('The following error has occurred.');                   
                    System.debug(err.getStatusCode() + ': ' + err.getMessage());
                    System.debug('Account fields that affected this error: ' + err.getFields());
                     }
                    }
                }
     #########################################################

      
            }
            }
Hi

I have an apex trigger which send an email when there is a respone(by email) related to a case by client - this email action sends an email to Support staff which is using a VF template - when Email is sent to users all line breaks in original email are omitted( I think VF doesn't send out email line breaks and is using Plain text) - is there any way I can convert it into HTML or if I can use HTML template in my apex code(that also doesn't work)

Thanks
Jyoti
 
I have below code but it is not working - it is showing table row even if Location is not matching...... it displays Location value correctly:

<tr  style="{IF({!$User.Office_Location__c} = 'XXXX'),'display: table-row;,none;'}">
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
         </div>
    </td>
  </tr>
Hi 

I have an existing VF page which doesn't have any cotroller - it is showing links to others tabs/ pages, I need to show one tile to users only if they are from one particular location - user.location field in User object.

Here is  my code:

<tr  onClick="parent.addTab('BMCRF_HR_ListTickets','Tickets and Requests')">
    <td class="button" width="38em" height="69">
      <div>
      <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewTickets1)}"/>
      <div style="float:inherit">View Tickets</div>
      </div>
    </td>
  </tr>

  <tr  onClick="parent.addTab('BMCRF_HR_KnowledgeArticles','Self Help Articles')">
    <td class="button" width="38em" height="69">
      <div>
      <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewKA1)}"/>
      <div style="float:inherit">View HR and Benefits Knowledge Articles</div> <!--Code Change(Mayur): Label changed from View Knowledge Articles-->
      </div>
    </td>
  </tr>
  
  <tr>
    <td class="button" width="38em" height="69">
      <div>
     <apex:image style="float:left; margin:1; width:44px; height:45px;"  value="{!URLFOR($Resource.BMCRF_ViewKA1)}"/>
      <apex:outputLink target="_blank"  value="https://www.salesforce.com" id="HRChatbot">HR Chatbot</apex:outputLink>
      <!--<div style="float:inherit">HR Chatbot</div> <!--Code Change(Mayur): Label changed from View Knowledge Articles-->
      </div>
    </td>
  </tr>


I need to show the bold HR Chatbot option only to North America users.

Please help.

Regards
 
I am trying to run this code in Anonymous window:

List<Contact> ConList = New List<Contact>();
ConList = [Select id, name, Account.name, Parent_Account__r.name from Contact where Parent_Account__r.name != Account.Parent.name];
System.debug('Contact records :    ' + Con1);

getting error:

Line: 2, Column: 9
Unexpected token '='.

I need to run below query in Dev console or workbench to get the contact records where Parent Account on Contact is not equal to Parent Account of Account:

select id, name, Account.name, Parent_Account__r.name,(Select id,name, Parent.name from Account) from Contact where Parent_Account__r.name != Account.Parent.name

Please help

 
I have a VF page in which VF component is called using <C: VF Component/>

I need to show an error message based on entitlement of logged in user - entitlement functionality is defined in Component controller and isused in Component. Can I call those parameters set for entitlement in Component Controller in my VF page and based on that show error message else show my page content.

Please suggest- this is urgent.

Thanks
Jyoti
 
Hi
I need to built a page with say two or more fields – their values will be Yes or No – based on if it is selected or not.
Get these field values in class and based on field values set variable values and call the function e.g:
VF Page:
Text1: Yes(it is a radio button)
Text2: Yes(radio)
call saveList from action button on VF page.
Apex Class:
Public String Cat
Public String Req
public PageReference saveList()
{
if(Text1 == Yes):
Cat = ‘abc’
Req = ‘abc’
CallFunction(Cat,Req)
}
if(Text2 == ‘Yes’){
Cat = ‘def’
Req = ‘def’
CallFunction(Cat,Req)
}
}
public void CallFuntion(String Cat, String Req)
{
statements;
}
Hi 

I am new to Apex and created a class to delete Assets from Base Element class of particular status - here is the code : please help me in creating test class for code coverage.

##############################################################

global class BMCRF_ScheduledDeleteAssets Implements Schedulable {
  global void execute(SchedulableContext sc) {
       massDelete();
    }    
          // Query the accounts to delete
        public void massDelete() {
        List <BMCServiceDesk__BMC_BaseElement__c> listtoDelete = [Select Id FROM BMCServiceDesk__BMC_BaseElement__c WHERE BMCServiceDesk__CI_Status__c =: 'Disposal'];

        // Delete the assets
        Database.DeleteResult[] drList = Database.delete(listtoDelete, false);
           // Iterate through each returned result
               for(Database.DeleteResult dr : drList) {
               if (dr.isSuccess()) {
            // Operation was successful, so get the ID of the record that was processed
                System.debug('Successfully deleted account with ID: ' + dr.getId());
                }
                else {
                    for(Database.Error err : dr.getErrors()) {
                    System.debug('The following error has occurred.');                   
                    System.debug(err.getStatusCode() + ': ' + err.getMessage());
                    System.debug('Account fields that affected this error: ' + err.getFields());
                     }
                    }
                }
     #########################################################

      
            }
            }
Hi

I have an apex trigger which send an email when there is a respone(by email) related to a case by client - this email action sends an email to Support staff which is using a VF template - when Email is sent to users all line breaks in original email are omitted( I think VF doesn't send out email line breaks and is using Plain text) - is there any way I can convert it into HTML or if I can use HTML template in my apex code(that also doesn't work)

Thanks
Jyoti