• JaiChaturvedi
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Salesforce Technical Consultant
  • Davanti Consulting

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 8
    Replies
I've started writing a Test Case so I can deploy my trigger. These are both for custom objects, however these are also on a managed package.

I am getting the following error when executing my test case:
 
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, pse.handleTimecardHeaderChange: execution of AfterInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

I assume there is a perticular field which is used in an existing Trigger called pse.handleTimecardHeaderChange. However it has not been made mandatory, therefore the field is null?

If I am correct, how can I go about troubleshooting this as when I create the record through the Page it works fine and I cannot see any other fields that are populated by default.

Thanks
Hi,

when i try to click Cancel button here its cancelled at the same time page also refreshing and then  modal popup is closed ,but i want to close the modal popup without page refresh.i am new with modal popup can you please help me
here my code

Javascreept button code
-----------------------------------------
{!REQUIRESCRIPT("https://code.jquery.com/jquery-1.10.2.js")} 
{!REQUIRESCRIPT("https://code.jquery.com/ui/1.10.4/jquery-ui.js")} 
{!REQUIRESCRIPT("/resource/SoldHour_JS4")} 
var permissionsetName='GSD_SRM_Edit_Sold_Hour'; 
var ptask=''; 
var ptid='{!pse__Project_Task__c.Id}'; 
var projecttask = sforce.connection.query("Select id,PSA_Project_Task_Creation__c,GSD_Task_Type__c,PSA_Sold_Estimated_Hours__c,pse__Status__c,pse__Project__c from pse__Project_Task__c where id = '"+ptid+"' limit 1"); 
ptask=projecttask.getArray('records'); 
var projectid=ptask[0].pse__Project__c; 
var taskcreation=ptask[0].PSA_Project_Task_Creation__c; 
var taskType =ptask[0].GSD_Task_Type__c; 
var soldHours =ptask[0].PSA_Sold_Estimated_Hours__c; 
var custSetting="{!$Setup.GSDSRM_Settings__c.GSD_Project_Splitting_Active_Statuses__c}"; 
var status =ptask[0].pse__Status__c; 
var userid=sforce.connection.getUserInfo().userId; 
var manageAccess = sforce.apex.execute("GSDSRMValidateProjectAccess", "checkOwnerAccess",{projectId : projectid,ProjectOwnerId: userid}); 
var permissionsetaccess =sforce.apex.execute("GSDSRMValidateProjectAccess", "checkPermissionsetAccess",{permissionsetName: permissionsetName}); 

console.log('manageAccess'+manageAccess ); 
if(manageAccess=='False' ) { 
alert('{!$Label.GSD_Edit_Sold_Hour}'); 

else if(permissionsetaccess=='False' ) { 
alert('{!$Label.GSD_Edit_Sold_Hour}'); 

else if(taskcreation!='Manual with PG Templates' ) { 
alert('{!$Label.GSD_Validate_Status_for_Edit_Sold_Hour}'); 

else if(custSetting.indexOf(status) < 0){ 
alert('{!$Label.GSD_Validate_Status_for_Edit_Sold_Hour}'); 

else { 
j$("#modalDiv").dialog('option','title','{!pse__Project_Task__c.Name}').dialog('open'); 
}

ModalDialog popup code
-----------------------------------
/*@description: This script will insert a modal div in the standard page.
                the modal will contain a VF page. This file should be located in static resource.*/
var j$ = jQuery.noConflict();
var currentUrl = window.location.href;
var hostIndex = currentUrl.indexOf(window.location.host+'/')+(window.location.host+'/').length;
var objectId = currentUrl.substring(hostIndex,hostIndex+15); 
j$(function(){
    /*Insert the jQuery style sheets in the Head.*/
    /*Insert the Modal dialog along with the VF as an iframe inside the div.*/
    j$("head").after(
        j$("<link>",{rel:"stylesheet",
                    href:"https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"}));
    j$("body").after(
        j$("<div>",{id:"modalDiv",
                    style:"display:none;"
           }).append(
            j$("<iframe>",{id:"vfFrame",
                         src:"/apex/GSDSRMEditSoldHourPage?id="+objectId,
                         height:200,
                         width:550,
                         frameBorder:0})
           ));
    /*Initialize the Dialog window.*/
    j$("#modalDiv").dialog({
        autoOpen: false,
        height: 275,
        width: 620,
        modal:true
    });
});


VF page
-------------------------


<apex:page showHeader="false"  sidebar="false" standardController="pse__Project_Task__c" extensions="GSDSRMSoldHourExtension">
    <style type="text/css">
body {
    margin:0;
    padding:0;
    font: 70%/1.3 arial,helvetica,sans-serif;
    background:#e6e6ff;
}
</style>
    <apex:form >
            
            <apex:pageblock id="pageBlock">
            <div align="Center">
            <br></br>
            <br></br>
            <b>Sold Hours</b>&nbsp;&nbsp;&nbsp;<apex:inputField value="{!pse__Project_Task__c.PSA_Sold_Estimated_Hours__c}"/>
                <br></br>        
             <apex:outputPanel >
            <br></br>
            <apex:commandButton action="{!saveAndReturn}" value="Save" onComplete="closeAndRefresh();" status="actionStatus" reRender="pageBlock"/>&nbsp;&nbsp;
            <apex:commandButton value="Cancel" onclick="window.close();"/>
            
            <apex:actionStatus id="actionStatus">
                <apex:facet name="start"> 
                    <img src="/img/loading.gif"/>
                </apex:facet>
            </apex:actionStatus>
            </apex:outputPanel>
            </div>
            </apex:pageblock>
            
           
            
    </apex:form>
    <script>
        function closeAndRefresh(){
            console.log('clicked on the button');
            window.top.location = '/{!$CurrentPage.parameters.id}';
        }
        
    
    </script>
</apex:page>

Modal Dialog popup
I have a picklist on a standard visualforce page. Based on the piclist value i want to display different page block section on the bottom of the page. I.e i want to divide the page in two sections.
Hello there,

I need to display 2 different types of decimal place number one with one decimal like (300.4) and other with 2 decimal places like (192.56)
I did some search and I found below logic but still I am unable to display decimal places.
 
<apex:outputText value="{0, number, ###.##}">
     <apex:param value="{!amountVarienceValue}" />
  </apex:outputText>

 <apex:outputText value="{0, number, ###.#}">
     <apex:param value="{!amountVarienceValue}" />
  </apex:outputText>

Can please anyone just how to display decimal places on visual force page.

Thank you.
  • June 28, 2016
  • Like
  • 0
Hi all,

 - I want to acheive something by using $('.ClassName') in JS controller it is looking like impossible to do that by component.find('aura:id');
 - I am using <ltng:require scripts="{!$Resource.MyNameSpace__MyResourceName}"  /> as per lightning guide to add external source library.
 - I found one blog as well there we have unmanaged package and we can use external libraries below is the link
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB000000011BS 
But I cannot able to install this package as well..some error is coming..

Anybody has any idea how to overcome this error below is the screenshot for the same
User-added image
Hi everyone,

Can anyone help me in how can I apply pagination To lightning component that is in Aura:iteration records list.

Thanks in advance.
Hi ,
Based on my requiremnets i have created a single compenent in which i am showing the details.On page launch it will show a particular tab for instance the Channel tab  in this case but on click of other tabs like Overview or Team Members ,it is suppose to show the tab specific detail on the same page but it is not working as intended .I have placed the tab specific details in <div> tag but still on click of a tab its not showing the details.I also want the selected tab to be highlighted with the same background.I would like to have a  solution on this issue.Please help on this.I have attached the screenshot .Please refer it .Thanks in advance.
Feel free to ask any qusetion sif you have any doubt.Salesforce Lightning