• sfadm sfadm
  • NEWBIE
  • 285 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 54
    Questions
  • 19
    Replies
I have a custom lookup visualforce page implemented exactly as it is explained here (http://bobbuzzard.blogspot.com/2010/09/visualforce-lookup.html)
I need to know how to migrate my custom lookup visualforce page:
<apex:page id="SearchAccount" showHeader="false" sidebar="false" controller="SearchAccountController">
    <apex:includeLightning  />
<script>
      // 'LookupVfApp' Is Lightning Application Name
    $Lightning.use("c:LookupVfApp", function() {

      // 'LcForLookupVf' is Lightning Component Name
    $Lightning.createComponent("c:LcForLookupVf",
    {
      // Set Lightning Component Attributes Property before creating Lightning Component In Visualforce page
        label : "Press Me!"
    },
   "LcDisplayId",
    function(component) {
    });
    </script>

    <script>
            var newWin = null;

            function openLookupPopup(Name, id) {
                var url = "/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
                newWin = window.open(url, 'Popup', 'height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
                if (window.focus) {
                    newWin.focus();
                }
                return false;
            }

            function closeLookupPopup() {

                if (null != newWin) {
                    newWin.close();
                }
             populateNumber();     
            }
        </script>

        <apex:actionFunction name="populateNumber" action="{!PopulateAccNumber}" rerender="accinfo, msgs" />

       <apex:outputPanel> 
       <apexoutputText value="Name"/>
       <apex:outputPanel>
            <apex:inputHidden value="{!accountId}" id="targetId" />
            <apex:inputText value="{!laccountName}" id="targetName" onFocus="this.blur()"/>
       <div id="LcDisplayId"></div>
                    <!--  <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</a> -->                
        </apexoutputPanel>  
        </apex:outputPanel>
        <apex:outputText value="{!accountnumber}" id="accinfo"/>
    </apex:page>

So far I created a LcForLookupVf.cmp lightning component:
<aura:component implements="force:appHostable,force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes" access="global">

    <ui:button label="navigateToURL" press="{!c.gotoURL}" />

</aura:component>
The it is explained here (https://salesforce.stackexchange.com/questions/156425/how-to-navigate-to-vf-page-from-a-lightning-component-with-javascript) I Created a LcForLookupVfController.js:
gotoURL : function(component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
        "url":"vfpage url"
    });
    urlEvent.fire();
Created a LookupVFApp.app Lightning Application:
<aura:application access="GLOBAL" extends="ltng:outApp"> 
    <aura:dependency resource="c:LcForLookupVf"/>
</aura:application>
Please advise how to add the openLookupPopup function:
function openLookupPopup(name, id)
    {
        let url = new URL("{!URLFOR($Page.opptyStepMailPopup)}");
        let params = url.searchParams;
        //Add parameters
        params.append('namefield', name);
        params.append('idfield', id);

        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus)
        {
            newWin.focus();
        }

        return false;
    }
to my LcForLookupVfController.js and be able to navigate the Lookup link to pop up and open the
User-added imagelookup window?


 
I'm currently using the Document object/table in SOQL to extract attachments in Salesforce classic.
As far as I'm aware in Lightning it is necessary to use File instead of Document object to extract attachments.
In SOQL there is no such File table and I need to know how to extract attachments data in Lightning Experience?
I have a custom visualforce page with Recent Items sidebar enabled and visible to my users in Classic.
User-added imageIn Lightning however the Recent Items sidebar is not visible.
User-added imagePlease advise how to add and enable the Recent Items sidebar to be visible in Lightning Experience?
I have a custom VF page:
<apex:page standardController="Lead" extensions="LeadDuplicateController" tabStyle="Lead"> 
  <apex:pageBlock >
        <apex:pageBlockSection title="Lead Information">
            <apex:outputText value="{!plainHTML}" escape="false" />
        </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>

AND That is the controller class to the VF page:
 
public with sharing class LeadDuplicateController {

    Lead objLead;

    public String plainHTML { get; set; }

    public LeadDuplicateController(ApexPages.StandardController controller) {
        objLead = (Lead)controller.getRecord();
    }
}
How to invoke the setter method of plainHTML in beforeInsert() method?

The issue I strive to solve is that beforeInsert() method is in another class.
 
I have a custom VF page added to a section in a standard object layout.
I invoke my own method in beforeInsert() in the standard object.
The returned result from my method must be put in the custom VF page.
Please advise how to send the returned result from my method into my custom VF page?
I'm trying to set a picklist value in URLFOR.

I have a custom button and when the button is pressed the following javascript is executed:
window.parent.open("{!URLFOR( $Action.Custom_Object__c.New,null,[CF00M0N00000OpQRx = Account.Name, CF00NK0000001jyxH = {!URLENCODE(TEXT(Account.Schedule__c))}, CF00N2a000000b34C = Account.Custom_Number_Field __c])}", "_self");
In the first scenario:
CF00NK0000001jyxH = ''
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the second scenario:
CF00NK0000001jyxH = Account.Schedule__c
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the third scenario:
CF00NK0000001jyxH = TEXT(Account.Schedule__c)
I receive the following error:
Error: Field Account.Schedule__c is a picklist field. Picklist fields are only supported in certain functions.
In the forth scenario:
CF00NK0000001jyxH = {!URLENCODE(TEXT(Account.Schedule__c))}
I receive the following error:
Error: Syntax error
Could you please advise how to set a picklist value in URLFOR function?




 
I have a roll-up summary filed which is calculating the number of child records.

If the number of child records is greater than 2 I need to deny all users from creating new records except one.

I need to allow only one user / record owner to be able to create a third record.

I've created the following validation rule:
my_custom_rollup_field > 2 && $ObjectType.Child_Custom_Object__c.Fields.Owner__c <> 'owner.Id'
However that validation rule is not working.

Please advise what else I need in my validation rule to give the opportunity to only one user / record owner to be able to create a third record? ​​​​​​​
 
How can I get all picklist values in a validation rule?

I'm looking for a suitable function but I cannot find any.

What I need to achieve is that some string is among the picklist values.

Please advise.
I'm using the following formula in a validation rule:
IF(ISPICKVAL( Level_Name__c ,"Level"),
IF(RIGHT(Name, 3) == TEXT(Level_Name__c), TRUE, FALSE), FALSE)
How can I get the last three characters of the Name and compare with Level_Name__c except for the "Level" value?



 
I'm interested in using the Analytics Dashboard Designer which is part of the Einstein Analytics.

However I'm interested in the Analytics Dashboard Designer only.

I'd strongly appreciate if you can explain what are the advantages of the Analytics Dashboard Designer over the standard Salesforce dashboards?
When I use the JSENCODE I have the following issue:
var accRegNumber = "{!Account.Registration_Number__c}";
var accName = "{!Account.Name}";
var accType = "{!Account.Custom_Filed_Type__c}";
var accRate = "{!Account.Custom_Filed_Rate__c}";
var accId = "{!Account.Id}";

accRegNumber = {!JSENCODE(accRegNumber)};
accName = {!JSENCODE(accName)};
accType = {!JSENCODE(accType)};
accRate = {!JSENCODE(accRate)};
accId = {!JSENCODE(accId)};
Error: Field accRegNumber does not exist. Check spelling.

Could you please advise why adding {!JSENCODE(accRegNumber)}; to accRegNumber variable is giving an error message?
I have a custom parent object A and a child object B.
When I create a new record from the child object B via the related list, only the parent lookup field is defaulted and filled in.
When I hit create new in the related list, I need to add more fields to be auto filled in.
Is there an appropriate solution to such issue?
Please advise.
I have created a duplication rule so that when a new lead record is created to notify the user if there is an already existing lead.
When there is an existing and duplicated lead I need to forbid the user from creating a new lead record.
Please advise how to be able to remove the Save (Ignore Alert) and Save & New (Ignore Alert)buttons by stopping the users to create new lead records?
I'm looking at integrating Hubspot with my Salesforce, however I have never used HubSpot before. I intend to introduce Hubspot to my marketing team only. Is will be used solely by my marketing department to start creating lead records in HubSpot and integrate as well as synchronize those records in Salesforce. Also I'm looking to allow my marketing users to create campaigns, marketing e-mails, newsletters etc. in HubSpot and integrate such records in Salesforce. In order to become familiar with the integration process between the two systems I'm currently looking to find the most recent issues between HubSpot and Salesforce in terms of integration. Please share your experience and resources as I'm unaware what to expect in terms of issues related to the HubSpot and Salsforce integration.
I have an automation process based on the returned value from a count roll-up summary field.
For instace I have two statuses.
Primary status
Secondary status
Let's say the user creates two records. 

One record with Primary status and another record with Secondary status.
The count which rollup field will return will be 2, because the number of records is two: One with Primary and one with Secondary.
At a certain point in time the user checks a custom checkbox field.
As soon as the checkbox is checked I need to know how to make the rollup field to start couting only the records with Secondary status.
Istead of having 2 the returned count will have to be reduced the to 1, becuse there is only one record with Secondary status and also because the custom checkbox field is checked.
Another example:
User creates
1. record with Primary status
2. record with Primary status
3. record with Secondary status
4. record with Secondary status
5. record with Secondary status

As soon as the user checks the custom checkbox field the returned count will have to be equal to 3, because there are three records with Secondary status and also because the custom checkbox is checked.
Until the custom checkbox field remains checked only the records with Secondary status must be counted.
Please advise how it can be achieved?
In order to achieve mass update of my records I tried to execute the following script:
List<Task> taskList = [SELECT status, CalculatedWorkingHours__c FROM Task WHERE CalculatedWorkingHours__c = -1.0 AND status = 'Completed'];
        for(Task task :taskList) {
            task.CalculatedWorkingHours__c = 1.0;
        }   
        update taskList;
        System.debug('taskList ' + taskList);

in Anonymous window in my Developer Console however I received the following message: 
`System.LimitException: Too many SOQL queries: 101`

Please advise how to avoid such exception and execute my script successfully?
Hello,

What I need to achieve is explained in the image of my process builder.

Process Builder Fake Action

I need a dump or fake action of not doing anything when the first condition is met.

Becauser there is no standard way in Salesforce to allow the process builder to save process with NO immediate action I used the following apex class.
 
public class ReturnNull_Class {
  @InvocableMethod(label='Return null' description='Returns null for use in Process Builder.')
  public static List<String> returnNull(){
    return null;
  }
}
The issue I have is with the test class.

It does not cover the code in my ReturnNull_Class.

Here is the implementation of the Test Class:
@isTest
private class ReturnNull_Test {
    static testmethod void returnNullTest(){
        ReturnNull_Class.returnNull();
    }
}
Please andvise as well as please share an example of a test class which can help me achieve sufficient code coverage in the ReturnNull_Class?
 
I have an HTML template for e-mails and would like to add an image(logo) in the template in way that to display the logo in every change of the evironment - sandbox to production.

Is there way to use URLFOR in HTML template for e-mails in order to use static resources?

Please advise how it can be achieved?

 
Hello,

Please advise how to generate a .csv file report via apex?

What I would like to achieve is to automatically generate a .csv report file in the beginning and at the end of a working week.

Please advise how this can be achieved with an apex code?

I'll strongly appreciate if you can include an apex source code example.
I am trying to automate a report by scheduling the report to run at a date/time and emailing the results to mail group.

How do I send report results to mail group?

Apparently via the standard Salesfore functionality that is not possible that is why I need to know is there any other way and workaround to be able to send a scheduled report to mail group?

How about running the report in Apex and generating and sending emails in code.

Please advise and share an appropriate example.
I have a roll-up summary filed which is calculating the number of child records.

If the number of child records is greater than 2 I need to deny all users from creating new records except one.

I need to allow only one user / record owner to be able to create a third record.

I've created the following validation rule:
my_custom_rollup_field > 2 && $ObjectType.Child_Custom_Object__c.Fields.Owner__c <> 'owner.Id'
However that validation rule is not working.

Please advise what else I need in my validation rule to give the opportunity to only one user / record owner to be able to create a third record? ​​​​​​​
 
I'm using the following formula in a validation rule:
IF(ISPICKVAL( Level_Name__c ,"Level"),
IF(RIGHT(Name, 3) == TEXT(Level_Name__c), TRUE, FALSE), FALSE)
How can I get the last three characters of the Name and compare with Level_Name__c except for the "Level" value?



 
Hello,

What I need to achieve is explained in the image of my process builder.

Process Builder Fake Action

I need a dump or fake action of not doing anything when the first condition is met.

Becauser there is no standard way in Salesforce to allow the process builder to save process with NO immediate action I used the following apex class.
 
public class ReturnNull_Class {
  @InvocableMethod(label='Return null' description='Returns null for use in Process Builder.')
  public static List<String> returnNull(){
    return null;
  }
}
The issue I have is with the test class.

It does not cover the code in my ReturnNull_Class.

Here is the implementation of the Test Class:
@isTest
private class ReturnNull_Test {
    static testmethod void returnNullTest(){
        ReturnNull_Class.returnNull();
    }
}
Please andvise as well as please share an example of a test class which can help me achieve sufficient code coverage in the ReturnNull_Class?
 
In the following piece of code:
List<String> necessaryColumns = new List<String> {'columnA', 'columnB', 'columnC', 'columnD', 'columnE', 'columnF','columnG'};    
Set<String> columnsInFile = new Set<String>(necessaryColumns);
            System.debug('columnsInFile' + columnsInFile);
            // Get all column names from the CSV file
            List<String> columnNames = csvRecords.get(0);
            for(String columnName :columnNames) {
                System.debug('columnName: ' + columnName);
                if(!columnsInFile.contains(columnName)) {
                    System.debug('clmnName: ' + columnName);
                    ApexPages.Message myMessage = new ApexPages.Message(ApexPages.Severity.FATAL, 'The uploaded file is invalid');
                    ApexPages.addMessage(myMessage);
                    return;      
                }
            }
The issue I have is that the names of the columns in the set are in strict order.
|DEBUG|columnsInFile{columnA, columnB, columnC, columnD, columnE, columnF, columnG}
and if the order of the columns in the CSV file is changed for instance:
columnG, columnF, columnD, columnC, columnA, columnB
The algorithm is entering the if block and is showing the message, which is totally wrong.
What I'm trying to achieve is to show the message only if one of the columns in the CSV file is missing.
If there are 20 columns in the CSV file but for instance columnA is missing in the file only then the ApexPages.Message has to be displayed for the users.
Please advise how this can be achieved with apex?


 

I have a blob object which is a CSV file and I need a method to return all lines from that file in the following data structure:
List<List<String>>
where each element of that data structure
(List<String>)
is a separate line in the file.

Please advise how this can be achieved and implemented?
I'm getting this error while running this VF Page
 
Error: SObject row was retrieved via SOQL without querying the requested field: Task.LastModifiedById

An unexpected error has occurred. Your development organization has been notified.

VF Page:

<apex:page standardController="task" extensions="TaskHistoryController">
  <apex:form >
   <apex:pageBlock >
       <apex:pageMessages escape="false"/> 
    </apex:pageBlock>
  </apex:form>   
</apex:page>

Controller:
public with sharing class TaskHistoryController {



Task objTask;
String objTaskId;

public TaskHistoryController(ApexPages.StandardController controller) {
    objTask = (Task)controller.getRecord();
    Id taskId = objTask.Id;
    List<Task_Activity_History__c> listTaskActivityHistory = [SELECT Field_Name__c, Id, Old_Value__c, New_Value__c, LastModifiedById, LastModifiedDate FROM Task_Activity_History__c WHERE Task_ID__c = :taskId]; 
    Task_Activity_History__c taskHistory1 = listTaskActivityHistory.get(0);
    Task_Activity_History__c taskHistory2 = listTaskActivityHistory.get(1);
    String newValue1 = taskHistory1.New_Value__c;
    String newValue2 = taskHistory2.New_Value__c;
    String resultAll = buildTemplate(objTask);
    ApexPages.Message infoPage = new ApexPages.Message(ApexPages.Severity.INFO, resultAll);
    ApexPages.addMessage(infoPage);
}

public String buildTemplate(Task task) {
    Id lastModifiedBy = task.LastModifiedById;
    String userName = '';
    List<User> listOfUsers = [SELECT Id, IsActive, LastModifiedById, Name FROM User where Id = :lastModifiedBy];
    for(User user :listOfUsers) {
        userName = user.Name;
    }
    Id taskId = task.Id;
    List<Task_Activity_History__c> listTaskActivityHistory = [SELECT Field_Name__c, Id, Old_Value__c, New_Value__c, LastModifiedById, LastModifiedDate FROM Task_Activity_History__c WHERE Task_ID__c = :taskId];
    String pageHTMLContent = '<HTML><HEAD><STYLE>table.user_class, .user_class th, .user_class td { border: 1px solid black; padding: 10px; } table.user_class th { text-align: center; } </STYLE></HEAD><BODY><TABLE class="user_class">';
    pageHTMLContent += '<TR><TH>Comment Old Value</TH><TH>Comment New Value</TH><TH>Last Modified By</TH><TH>Last Modified Date</TH>';
    for(Task_Activity_History__c taskActivityHistory :listTaskActivityHistory) {
        String newValue1 = taskActivityHistory.Old_Value__c;
        String newValue2 = taskActivityHistory.New_Value__c;
        String lastModifiedById = taskActivityHistory.LastModifiedById;
        DateTime lastModifiedByDate = taskActivityHistory.LastModifiedDate;
        pageHTMLContent += '<TR>';
        pageHTMLContent += '<TD>' + newValue1 + '</TD><TD>' + newValue2 + '</TD><TD>' + userName + '</TD><TD>' + lastModifiedByDate + '</TD>';
        pageHTMLContent += '</TR>';
        System.debug('pageHTMLContent7 ' + pageHTMLContent);
    }
    pageHTMLContent += '</TABLE></BODY></HTML>';

    return pageHTMLContent;
}
Please advise an appropriate solution.
In my code
trigger ContactRole on Application__c (before update) {

// Get the time between the last aTeam and bTeam
                DateTime lastUWCreated = lastCCUW.Created_Date__c;
                System.debug('lastUWCreated ' + lastUWCreated);
                DateTime lastAmTeamCreated = lastCCRiskAndChecked.Created_Date__c;
                System.debug('lastAmTeamCreated ' + lastAmTeamCreated);
                
                Double workingHours = calculateWorkingHours(lastUWCreated, lastAmTeamCreated);
                System.debug('workingHours ' + workingHours);
                Id ccAppId = lastAmTeamCreated.Id;
                
                List<Application__c> ccAppList = [SELECT CalculatedWorkingHours__c from Application__c where id = :ccAppId];
                Application__c appRecord = ccAppList.get(0);
                appRecord.CalculatedWorkingHours__c = workingHours;
                System.debug('appRecord.CalculatedWorkingHours__c ' + appRecord.CalculatedWorkingHours__c);
}

I'm using the before update trigger in order to populate the calculated working hours into a custom field called "CalculatedWorkingHours__c".

I can see in the debug log that the  "CalculatedWorkingHours__c" field is updated
 
USER_DEBUG [184]|DEBUG|workingHours 17.5

USER_DEBUG [194]|DEBUG|ccAppRecord.CalculatedWorkingHours__c 17.5
but on a record level the field remains blank

Please advise what can be the issue and why the field is not populated in the record?
Hello,

I have setup a new SalesForce environment and I have to transfer my Apex classes on it.

In order to deploy my code I use a test class with test methods.

A validation process is started when I try to deploy the changes.

This validation invokes all existing test methods and the environment throws the following exception:
System.LimitException: Apex CPU time limit exceeded

Oddly enough on the old environment there is no such exceptions

I'm sending you a method of my source code where the Apex CPU time limit exceeded is most likely to happen:
 
private List<LeadConversionContainer> checkByWebsite(Lead leadObj) {
        List<LeadConversionContainer> accountWebsites = new 
        List<LeadConversionContainer>();
        String website = leadObj.Website;
        String leadId = leadObj.Id;
        List<Account> accWebsiteList = [SELECT Website, Url__c, Status__c FROM 
        Account];
        if(website != null && !website.equals('') && accWebsiteList != null) {
            List<String> leadWebsites = extractWebsites(website);
            for (String leadUrl : leadWebsites) {
                String normWebsite = normalizeWebsite(leadUrl);
                String leadWebsite = normWebsite.trim();
                for(Account acc : accWebsiteList) {
                    String accountWebsite = acc.Url__c;
                    String accountId = acc.Id;
                    List<String> extractedAccountWebsite = 
                    extractWebsites(accountWebsite);
                    for(String accWebsite :extractedAccountWebsite) {
                        String accountSite = normalizeWebsite(accWebsite);
                        if(accountSite != null) {
                            List<String> leadSplitWebsitesList = leadWebsite.split('[,;\\s]');
                            for(String leadSplitUrls :leadSplitWebsitesList) {
                                if(accountSite.equals(leadSplitUrls)) {
                                    boolean isAccountStatusActive = isAccountActive(acc);
                                    boolean isMerchantApplication = 
                                    isMerchantApplicationsAttached(acc);
                                    if(isAccountStatusActive || isMerchantApplication) {
                                        String reasonToStopConversion = 'Lead Website coincide with 
                                        Account Website';
                                        LeadConversionContainer leadConvert = new 
                                        LeadConversionContainer(acc.Id, '', reasonToStopConversion);
                                        accountWebsites.add(leadConvert);
                                    }
                                }    
                            }
                        }
                    }
                }    
            }
        }
        return accountWebsites;
    }

Please advise how to solve the issue with my deploy and avoid such System.LimitException: Apex CPU time limit exceeded exception?
I have an apex source code where I have plenty of if/else conditions which depend on the business hours Mon - Fri 9h - 18h settings in Salesforce.
I'm creating a test method to validate my code but because of the business hours settings the apex code enters only in few if conditions.
And I cannot reach the necessary percentage to validate my code.

Is it possible in the test method to change the business hours so that I can validate my code on 100% or is there a way to validate my code despite the fact that it is depending on the business hours?
Hello,

When the priority in a task is changed I calculate dynamically the calendar hours.

The calculated calendar hours are set and updated in a custom field called "timeframe".

After the value in the "timeframe" field is changed I want to send an e-mail alert based on the number of hours set in the "timeframe" field.

Example: If task priority is set to "High", the calendar hours in the "timeframe" filed will be 23 hours.

I want to know how to send an e-mail alert after 23 hours?

Could you please advise how to do that in Salesforce?
I need to get the current time but to be in type DateTime.

I use:
DateTime now = System.now();
but it returns wrong time.

I execute the code in 2017-08-04 00:38:46 AM

but it returns
00:38:46:023 USER_DEBUG [138]|DEBUG|now 2017-08-03 21:38:46
How can I get my correct current local time 2017-08-04 00:38:46?

I had even tried with:
DateTime now = DateTime.parse(System.Now().format());
but I still get wrong time.
01:10:09:021 USER_DEBUG [139]|DEBUG|now 2017-08-03 22:10:00
How can I get the correct current local time?



 
I have an object of type Time startWorkingTime and object of type DateTime nextBusinessDay. I want to create new object of type DateTime based on startWorkingTime and nextBusinessDay.
Here is my code:
DateTime startWorkingTime = DateTime.newInstance(nextBusinessDay.year(), nextBusinessDay.month(), nextBusinessDay.day(), currentStartHours.hour(), currentStartHours.minute(), currentStartHours.second());
After startworkingtime the time is set one hour earlier
For example:
23:59:24:025 USER_DEBUG [188]|DEBUG|currentStartHours 09:00:00.000Z
23:59:24:025 USER_DEBUG [189]|DEBUG|currentStartHours.hour() 9
23:59:24:025 USER_DEBUG [197]|DEBUG|startWorkingTime 2017-08-04 08:00:00
Could you please explain why the hour in startWorkingTime is 08:00:00 and advise how to fix it?


 

I need to calculate the out of office hours in apex.

The hours are:
6 pm – 9 am Mon – Fri
and
6 pm on Fri till 9 am on Mon

I've already configured the Business Hours:

Monday09:00to18:00
Tuesday09:00to18:00
Wednesday09:00to18:00
Thursday09:00to18:00
Friday09:00to18:00
Saturday24 Hours
Sunday24 Hours

and activate it in Salesforce.

Please advise how it can be achieved in apex?

Hello,

I have a custom vf page which is controlling the conversion process from Lead to Account. What I'd like to achieve is that once I convert the system to automatically redirect to the opportunity page. Could you please advise how this can be achieved?
Hello,

I'd like to know how to display a dialog or pop up window in Salesforce.

I'm using a convert button with associated custom visualforce page. I use custom visualfoce page to invoke appex controller class.

Depending on the given parameters the appex class the end result of the class is to return a message. The message is displayed in a visualforce page(see the attached screenshot).Custom Visualforce page

What I would like to know is how to dispaly a message in a dialog or a pop-up window instead of entire visualforce page.

Here is what I would like to achive:
Once the convert button is pressed(see the attached screenshot)Standard Convert Page
I would like to know how to dispaly the message in a dialog or a pop-up window.

Could you please advise how this can be achieved?

 
I have an existing workflow and some part of the workflow involves approval process for opportunities. During the approval process Opportunity object is locked. The unlock takes place at the end of the approval process. The lock for Opportunity object can not be removed in administrative way. What I strive to achieve is during the approval process the Opportunity object to be unlocked. There are two apex methods to lock and unlock in the Approval class but I'm not aware where to use those methods and which apex method and apex class exactly is invoked when the approval process is submitted. Please advise which apex method is invoked when the approval process is submitted.