You need to sign in to do that
Don't have an account?
Todd Kadas
create log a call list button with visualforce page (attempt to de-reference a null object
Hello kind people,
I'm sure this is rather simple but I've been struggling with it for a while. I'm just trying to create a list button for a custom log a call feature that I can add to my Account Activity History.
Here is the class:
I tried to give up and just go the old URL hack route with a custom record type and page layout but it seems I coudn't pass values to text fields in LEX.
Any assistance anyone can offer would be greatly appreciated.
I'm sure this is rather simple but I've been struggling with it for a while. I'm just trying to create a list button for a custom log a call feature that I can add to my Account Activity History.
Here is the class:
public class LogCallController2 { public LogCallController2(ApexPages.StandardSetController controller) { } public task t1{get;set;} //public task t1{get //{ //String strId = ApexPages.currentPage().getParameters().get('id'); //t1=[SELECT Id, WhatId FROM Task WHERE id =:strId]; //return t1; //} //set;} public LogCallController2(ApexPages.StandardController controller) { t1= new task(); } public PageReference save() { insert t1; //PageReference p=new PageReference('/a0T/o'); //return p; return null; } }And here is the VF page. Ideally, I would like to be able to pre-populate all fields with the exception of Comments (Description) and Who Id.
I tried to give up and just go the old URL hack route with a custom record type and page layout but it seems I coudn't pass values to text fields in LEX.
Any assistance anyone can offer would be greatly appreciated.
<apex:page standardController="Task" recordSetVar="tasks" extensions="LogCallController2"> <apex:form > <apex:pageBlock title="Log a Call"> <apex:pageBlockSection > <apex:inputField value="{!task.Subject}"/> <apex:inputField value="{!task.Description}"/> <apex:inputField value="{!task.ActivityDate}"/> <apex:inputField value="{!task.Priority}"/> <apex:inputField value="{!task.Status}"/> <apex:inputField value="{!task.WhatId}"/> <apex:inputField value="{!task.WhoId}"/> </apex:pageBlockSection> <apex:pageBlockButtons location="top"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>