• zeezackisback
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 42
    Replies
I found the Timeline S-Control on the AppExchange and the documentation says you can use it for Custom Objects.
Has anyone tried this and gained some insight as to how one might accomplish this?

We have two org's and I need to figure out a way to export data from one, to the other. Problem is unique id's. The data to go on the new org will be given a new id, but I need to get it mapped to the other org.

 

Is it possible for apex code to pick up a new case on org 2 and relate it to accounts, contacts, etc... from org 1

 

 

I need to figure out a way, to provide a checkbox, with approximately 32 items. Whichever items are tickets, the data is entered into a field and populates a document with pre-defined text.

 

I see this as being similar to a report but I am not 100% sure where to start on this one.

I need to create a timer module on the case, using visualforce pages.

 

Does anyone have any links to refer to? 

I have been working on an application to create a claim timer... I remade it ok in s-control and now find I need to make it again in visual force...

 

where and how do I begin..?! please help.

 

 here is my s-control

 

 

 

 

 

<html>
<head>
<link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<script src="/soap/ajax/10.0/connection.js"></script>
<style type=text/css>
table {font-size:12px}
.fTitle {font-size:11px; width:150px}
.fData {font-size:12px;}
</style>
<script>

var tO = null;
//var caseId = '{!Claim__c.Id}';
var caseId = 'a07300000045gt4';
var caseNumber = '{!SUBSTITUTE(SUBSTITUTE(Claim__c.Name,"<","&lt;"),">","&gt;")}';

var timerStart = '{!TEXT( Claim__c.FM_Timer_Timer_Start__c )}';
var timerRunning = '{!Claim__c.FM_Timer_Timer_Running__c}';
var timerSeconds = parseInt('{!TEXT(Claim__c.FM_Timer_Timer_Current_Seconds__c)}');
var timerPrevSeconds = parseInt('{!TEXT(Claim__c.FM_Timer_Timer_Previous_Seconds__c)}');

if (!(timerPrevSeconds))
{
timerPrevSeconds = 0;
}

if (!(timerSeconds))
{
timerSeconds = 0;
}


function UpdateTimer(s) {
Timer.innerHTML = FormatDate(s);
TimerTotal.innerHTML = FormatDate(s + timerPrevSeconds);
}

function RunTimer() {
timerSeconds += 1;
UpdateTimer(timerSeconds);
tO = setTimeout("RunTimer();",1000);
}


function Zero(n) {
if (n < 10)
return "0" + n;
else
return n;
}

function FormatDate(d) {
days = Math.floor(d / 86400);
hours = Math.floor((d % 86400) / 3600);
mins = Math.floor((d % 3600) / 60);
secs = (d % 60);
return days + "D " + Zero(hours) + ":" + Zero(mins) + ":" + Zero(secs);
}

function setupPage() {
if (timerRunning == '1')
{
ToggleButton(true);
RunTimer();
}
else
{
UpdateTimer(0);
}
}

function ToggleButton(b) {
if (b)
{
document.getElementById('startButton').style.display = 'none';
document.getElementById('stopButton').style.display = 'inline';
}
else
{
startButton.style.display = 'inline';
stopButton.style.display = 'none';
}
}

var wiprate = '100';

function getWIP(w,t) {
result = sforce.connection.query("Select Id,WIP__c from Claim__c where Id = '" + caseId + "'");
var records = result.getArray("records");
var oldWIP = records[0].getInt("WIP__c");
//var WIP = (w * t) + oldWIP;
var latestWIP = w * t;
var WIP = oldWIP + latestWIP;

return WIP;
}


function SetTimer()
{
result = sforce.connection.query("Select Id,FM_Timer_Timer_Running__c from Claim__c where Id = '" + caseId + "'");
var records = result.getArray("records");
if (records.length != 1)
{
alert("An error occurred when starting the timer: cannot find case");
}
else
{
if (records[0].getBoolean("FM_Timer_Timer_Running__c"))
{
alert('Timer already started');
}
else
{
serverTime = sforce.connection.getServerTimestamp().timestamp;
thisClaim__c = new sforce.SObject("Claim__c");
thisClaim__c.id = caseId;
thisClaim__c.FM_Timer_Timer_Start__c = serverTime;
thisClaim__c.FM_Timer_Timer_Running__c = 1;
result = sforce.connection.update([thisClaim__c]);

if (!(result[0].getBoolean("success")))
{
alert('An error occurred when starting the timer: update failed');
}
else
{
ToggleButton(true);
RunTimer();
}
}
}
}

function StopTimer() {
result = sforce.connection.query("Select Id,FM_Timer_Timer_Running__c,FM_Timer_Timer_Total_Seconds__c from Claim__c where Id = '" + caseId + "'");
var records = result.getArray("records");
if (records.length != 1)
{
alert("An error occurred when stopping the timer: cannot find case");
}
else
{
if (records[0].getBoolean("FM_Timer_Timer_Running__c"))
{
t = records[0].getInt("FM_Timer_Timer_Total_Seconds__c");
thisClaim__c = new sforce.SObject("Claim__c");
thisClaim__c.id = caseId;
thisClaim__c.FM_Timer_Timer_Start__c = null;
thisClaim__c.FM_Timer_Timer_Running__c = false;
thisClaim__c.WIP__c = getWIP(wiprate, t);
thisClaim__c.FM_Timer_Timer_Previous_Seconds__c = t;
result2 = sforce.connection.update([thisClaim__c]);
if (!(result2[0].getBoolean("success")))
{
alert('An error occurred when stopping the timer: update failed');
}
else
{
clearTimeout(tO);
timerPrevSeconds += timerSeconds;
timerSeconds = 0;
ToggleButton(false);
}
}
else
{
alert('Timer already stopped');
}
}
}

</script>
</head>

<body onload=setupPage() class="case" style="text-align:center; background-color:#f3f3ec">
<table border="0" cellpadding="0" cellspacing="0" style="text-align:center">
<tr>
<td class="fTitle" >Current Time</td>
<td class="fTitle">Total Time</td>
</tr>
<tr>
<td class="fData"><div id=Timer>0D 00:00:00</div></td>
<td class="fData"><div id=TimerTotal>0D 00:00:00</div></td>
</tr>
<tr>
<td colspan=2>
<input type=button class=btn id=startButton value=Start onclick=SetTimer() style="font-size:10px;">
<input type=button class=btn id=stopButton value=Stop onclick=StopTimer() style="font-size:10px; ">
</td>
</tr>

</tr>
</table>

</body>
</html>

 

 

Message Edited by zeezackisback on 07-23-2009 10:22 AM

How do I recover the Id for a custom objcet?

 

This was for the case

 

 

var caseId = '{!Case.Id}';

 

this was for my custom object claim..

 

 

var caseId = '{!Claim__c.Id}';

 

 but its not working.

 

 

 

I am working on a visual force page, which will display only high priority tasks. Ideally I want this on the home page or as a button. I've got it up and running on sandbox and now discover I need to get it passed 75% test status.

 

How do I do this?

 

I've tried looking around and created a private test class

 

 

please point me in the right direction.

 

Class

 

 

private class SupermanTest { static testMethod void SupermanTest () { DashboardTaskController mySearchCon = new DashboardTaskController(); } } public class DashboardTaskController { //extends DashboardAbstractController public String objectId {get; set;} //public Task currentObject {get; set;} //public String updatedItemStatus{get; set;} public Integer numLeft {get; set;} public Integer total {get; set;} private Integer startNdx = 0; private static Integer PAGESIZE = 8; private List<Task> fullTaskList = new List<Task>(); private List<Task> displayedTaskList = new List<Task>(); public DashboardTaskController() { } public PageReference refreshPage() { return null; } public List<Task> getTasks() { String ownerId = UserInfo.getUserId(); if (fullTaskList.isEmpty()) { fullTaskList = [select id, WhatId, WhoId, ActivityDate, subject, status, priority, Description, ReminderDateTime, IsReminderSet,isClosed from Task where priority = 'High' and isClosed = false and OwnerId = :ownerId]; numLeft = fullTaskList.size(); total = numLeft; this.objectId = ((Task) fullTaskList[0]).id; //this.currentObject = (Task) fullTaskList[0]; } displayedTaskList.clear(); Integer endNdx = startNdx + PAGESIZE; if (endNdx > total) endNdx = total; for (Integer i=startNdx; i<endNdx; i++) displayedTaskList.add(fullTaskList.get(i)); return displayedTaskList; } private void updateTaskStatus() { System.debug('before : ' + fullTaskList); Integer i = 0; for (i=0; i<fullTaskList.size(); i++) { Task t = fullTaskList.get(i); if (this.objectId.equals(t.id)) { System.debug('updating status of ' + t); Task tmp = [select id, WhatId, WhoId, ActivityDate, subject, status, priority, Description, ReminderDateTime, IsReminderSet, isClosed from Task where id = :t.id]; fullTaskList.set(i, tmp); System.debug('updated to ' + tmp); //this.updatedItemStatus = tmp.status; break; } } System.debug('after : ' + fullTaskList); } private void nextTask() { for (Task t : fullTaskList) { if (!t.isClosed) { System.debug('found non-closed object with id ' + t.id); this.objectId = t.id; break; } } } public PageReference showDetail() { // since I can't get the assignTo to work in the VF page/component this.objectId = System.currentPageReference().getParameters().get('objectId'); /* bizarre ... if I call setObjectId, the id returned from the detailPage method is null but if I directly set the id in this method, everything works correctly setObjectId(System.currentPageReference().getParameters().get('objectId')); */ return null; } public void previous() { startNdx -= PAGESIZE; } public void next() { startNdx += PAGESIZE; } public void refreshNumbers() { // the only time this method should be called is when a submit is done // on a record -- we assume the submit closes the record (or at least // puts the record in a state where we are not interested in seeing // it in our todo list anymore updateTaskStatus(); nextTask(); this.numLeft = 0; for (Task t : fullTaskList) { if (!t.isClosed) { this.numLeft++; } } //this.objectId = prefetchedNextObjectId; } public Boolean getHasNext() { return total > (startNdx + PAGESIZE); } public Boolean getHasPrevious() { return startNdx > 0; } public Integer getNum() { return total; } public PageReference save(){ for (Task t : fullTaskList) { update t; } return null; } }

 

 Apex

 

 

<apex:page controller="DashboardTaskController" standardStylesheets="true" showHeader="true"> <!-- close date will be null since we will only display open ones ... but might want to be more flexible here so management view will look different ... see class --> <!-- {!recordType}---{!num} --> <apex:form id="taskList"> <script> function checkIfNeedRefresh() { //alert('checking for full refresh'); var left = document.getElementById('{!$Component.taskList.numberOfItemsLeft}'); //alert('found items left todo : ' + left.innerHTML); var tmp = parseInt(left.innerHTML); if (tmp == NaN || tmp == 0) { parent.refreshPage(); } } </script> <apex:pageBlock id="pageBlock" title="Priority Task List"> <apex:pageBlockTable value="{!tasks}" var="o" id="table"> <apex:column > <apex:commandLink action="{!showDetail}" value="{!o.subject}" reRender="detail"> <apex:param value="{!o.id}" name="objectId" assignTo="{!objectId}"></apex:param> </apex:commandLink> </apex:column> <apex:column id="status" headerValue="Status" value="{!o.status}"/> <apex:column id="priority" headerValue="Priority" value="{!o.priority}"/> <apex:column id="ActivityDate" headerValue="Due Date" value="{!o.ActivityDate}"/> <apex:column id="WhatId" headerValue="Related to" value="{!o.WhatId}"/> <apex:column id="WhoId" headerValue="Contact/Lead" value="{!o.WhoId}"/> <apex:column id="IsReminderSet" headerValue="Reminder" value="{!o.IsReminderSet}"/> <apex:column id="ReminderDateTime" headerValue="Reminder" value="{!o.ReminderDateTime}"/> <apex:column id="Description" headerValue="Comments" value="{!o.Description}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:panelGrid columns="2"> <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous Page</apex:commandlink> <apex:commandLink action="{!next}" rendered="{!hasNext}">Next Page</apex:commandlink> </apex:panelGrid> <apex:outputText id="numberOfItemsLeft" value="{!numLeft}" style="visibility:hidden"/> <apex:actionFunction action="{!refreshNumbers}" immediate="true" name="refreshNumbers" rerender="numberOfItemsLeft, detail, table" oncomplete="checkIfNeedRefresh();"/> </apex:form> </apex:page>

 

 

 

 

 

<apex:page standardController="Claim__c" showHeader="true" tabStyle="Claim__c" > <style> .activeTab {background-color: #236FBD; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <apex:tabPanel switchType="client" selectedTab="tabdetails" id="ClaimTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab label="Details" name="AccDetails" id="tabdetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Open Activities" name="OpenActivities" id="tabOpenAct"> <apex:relatedList subject="{!Claim__c}" list="OpenActivities" /> </apex:tab> <apex:tab label="Notes and Attachments" name="NotesAndAttachments" id="tabNoteAtt"> <apex:relatedList subject="{!Claim__c}" list="NotesAndAttachments" /> </apex:tab> <apex:tab label="Special" name="Special" id="tabSpec"> <script> claim.name = "{!Claim__c.Name}"; document.write("test"); </script> <apex:outputPanel layout="block"> <label for="checkbox">Click this box to change text font: </label> <input id="checkbox" type="checkbox" onclick="changeFont(this,'{!$Component.thePanel}');"/> </apex:outputPanel> </apex:tab> </apex:tabPanel> </apex:page>

 

Hey ya guys, I am trying to re-create the case section...in my situation claims. I've got all the tabs out apart from the tracking history one... can't seem to get it working.

 

I'm creating a special tab that I want to DISPLAY a particular selection of input fields dependant on say a few other fields... like if the claim has just been made, or if its received a document etc...

 

 

How do I resolve this mamoth task? Need help urgently.

I work for a company that handles legal claims. They need me to modify their case page so that particular sections become available or modifyfiable when the claim has reached particular stages... where do I begin?!

 

Am I to create an apex class to control this ? Do I try and modify the page using large amounts of javascript... what is the best soloution for what could be a mammoth task?

How do I go about creating the apex for listing high priority tasks?

 

<apex:page standardController="Account">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are viewing the {!account.name} account.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{!account.Contacts}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

What would be the html/javascript to create a list of priority tasks on the home page. What javascript would I use to connect to the salesforce table and then pull down the results?

 

 

<html> <head> <script> function GetPriorityTask() { result = sforce.connection.query("Select Id from Case'"); var records = result.getArray("records"); if (records.length != 1) { alert("An error occurred"); } else { alert(records[0]); } } </script> </head> <body> <script> GetPriorityTask(); </script> </body> </html>

 

 

I am trying to customize the timer api, but alas its considered to be managed...thus locked down... how do I unlock it or clone the object?

 

http://sites.force.com/appexchange/listingDetail?listingId=a0N300000016c2LEAQ

 

I am trying to create a roll up summary field, but its shaded out... claiming I can not add the field type...

 

 

"You cannot create this type of field on this object because it is not the master in a master-detail relationship."

 

How can I make it so?

I am trying to modify the timer, by making it more automatic...trying to get it to work on a new table...so instead of case, its claims.

 

I would like it to be able to pull out the claim id it is on.

 

I've tried doing this, but its coming up as false.. how do I get the id of the page its on?

 

 

<script language="javascript" type="text/javascript"> // initialize and set global variables var isClaim = new Boolean( "{!$Request.eid}" == "{!Claim__c.Id}" ); // see what tab we are called from function validId(id) { return ("{!$Request.eid}" != null && "{!$Request.eid}" != "" && "{!$Request.eid}" === id); } function _WhatId() { if (isClaim == true) return "{!Claim__c.Id}"; return null; } var WhatId = _WhatId(); alert(isClaim); alert(WhatId); </script>

 

Does anyone know more information about this case timer... has anyone modified it before?

 

http://sites.force.com/appexchange/listingDetail?listingId=a0N300000016c2LEAQ

 

I am trying to modify the timeline api, but I am not having much success.

 

 

 

sforce.connection.query( "SELECT Id, OldValue, NewValue, IsDeleted, Field, CreatedDate, CreatedById FROM Claim__History"+ " where ParentId = '{!Claim__c.Id}' order by CreatedDate ", layoutCaseHist );

 

 

 

I am getting some strange errors trying to manipulate the timeline code from the api exchange... can anyone help.

 

if ( validId("{!Claim__c.Id}") ) { // we are on a case page, this gets interesting...

        // query the case history and display that
        sforce.connection.query( "Select OldValue, NewValue, IsDeleted, Id, Field, CreatedDate, c.CreatedBy.Name, c.CreatedById, c.Id From Claim__History"+
        " where c.Claim__c= '{!Claim__c.Id}' order by CreatedDate ",
        layoutCaseHist );   
       
        // case comments
        sforce.connection.query( "Select c.ParentId, c.LastModifiedDate, c.LastModifiedById, c.IsPublished, c.IsDeleted, c.Id, c.CreatedDate, c.CreatedBy.FirstName, c.CreatedBy.LastName, c.CreatedById, c.CommentBody From CaseComment c " +
         " where ParentId = '{!Case.Id}' order by CreatedDate ",
         layoutCaseComment    );
       
    } // end case
   
 

 

 

didn't understand relationship 'c' in field path

and an invalid field

 

 

ERROR: ........... {faultcode:'sf:INVALID_FIELD', faultstring:'INVALID_FIELD:
IsDeleted, Id, Field, CreatedDate, c.CreatedBy.Name, c.CreatedById
                                   ^
ERROR at Row:1:Column:63
Didn't understand relationship 'c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.', detail:{InvalidFieldFault:{exceptionCode:'INVALID_FIELD', exceptionMessage:'
IsDeleted, Id, Field, CreatedDate, c.CreatedBy.Name, c.CreatedById
                                   ^
ERROR at Row:1:Column:63
Didn't understand relationship 'c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.', row:'1', column:'63', }, }, }

   Problem: Cannot create a new namespaced component

 

How do I resolve this... I can not deploy?

 

I'm trying to depoy to an org..but I am getting errors claiming particular bits are not present in the package.xml - I am wondering if its not native to the current org...

how do I resovle.

Is there a way using the phptoolkit... to pull out the data strucutre of salesforce and INSERT it into another salesforce.

 

 

I've been able to pull out database structure... and data... but is there a way to do the reverse to paste the data into a new org?

I have been trying to duplicate an org from some test accounts.

 

I've made some records and a custom field etc... in the first org. The second org is blank.

 

 

I've connected to the 1st org using Force.com eclipse... pulled in ALL required apex,classes,objects... ticked the whole lot.

 

then I tried deploying to the second org... I've had to change a few things like user of the org to this user.... but there are other errors which are stopping deployment...

 

in particular reports...

 

Please can anyone help me clone the data structure, schema and data from one ORG to another?

 

 

 

*** Deployment Log ***
Result: FAILED
Date: 29 May 2009 14:07:43 BST

# Deployed From:
   Project name: Test org1
   Username: *****@XXX.com
   Endpoint: www.salesforce.com

# Deployed To:
   Username: ****@hotmail.com
   Endpoint: www.salesforce.com

# Deploy Results:
   File Name:    reports/TEST1-meta.xml
   Full Name:  TEST1
   Action:  NO ACTION
   Result:  FAILED
   Problem: Not in package.xml

   File Name:    reports/TEST1/TEST1.report
   Full Name:  TEST1/TEST1
   Action:  NO ACTION
   Result:  FAILED
   Problem: Cannot find folder:TEST1

   File Name:    workflows/Account.workflow
   Full Name:  Account.TEST1
   Action:  NO ACTION
   Result:  FAILED
   Problem: In field: recipient - no User named rob.lone@pixpaycard.com found

   File Name:    layouts/Account-Account %28Marketing%29 Layout.layout
   Full Name:  Account-Account %28Marketing%29 Layout
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    layouts/Account-Account %28Sales%29 Layout.layout
   Full Name:  Account-Account %28Sales%29 Layout
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    layouts/Account-Account %28Support%29 Layout.layout
   Full Name:  Account-Account %28Support%29 Layout
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    layouts/Account-Account Layout.layout
   Full Name:  Account-Account Layout
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    layouts/TEST1__c-TEST1 Layout.layout
   Full Name:  TEST1__c-TEST1 Layout
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objectTranslations/TEST1__c-en_US.objectTranslation
   Full Name:  TEST1__c-en_US
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.Active__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.CustomerPriority__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.NumberofLocations__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.SLAExpirationDate__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.SLASerialNumber__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.SLA__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.TEST1__c
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.UpsellOpportunity__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/Account.object
   Full Name:  Account.Billing
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    objects/TEST1__c.object
   Full Name:  TEST1__c
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    package.xml
   Full Name:  package.xml
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Admin.profile
   Full Name:  Admin
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/ContractManager.profile
   Full Name:  ContractManager
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Custom%3A Marketing Profile.profile
   Full Name:  Custom%3A Marketing Profile
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Custom%3A Sales Profile.profile
   Full Name:  Custom%3A Sales Profile
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Custom%3A Support Profile.profile
   Full Name:  Custom%3A Support Profile
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/CustomerManager.profile
   Full Name:  CustomerManager
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/MarketingProfile.profile
   Full Name:  MarketingProfile
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Partner.profile
   Full Name:  Partner
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/ReadOnly.profile
   Full Name:  ReadOnly
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/SolutionManager.profile
   Full Name:  SolutionManager
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/Standard.profile
   Full Name:  Standard
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    profiles/StandardAul.profile
   Full Name:  StandardAul
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    workflows/Account.workflow
   Full Name:  Account
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    workflows/Account.workflow
   Full Name:  Account.TEST1
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

   File Name:    workflows/TEST1__c.workflow
   Full Name:  TEST1__c
   Action:  NO ACTION
   Result:  SUCCESS
   Problem: n/a

# Test Results:
   n/a

 

 

 

How do I recover the Id for a custom objcet?

 

This was for the case

 

 

var caseId = '{!Case.Id}';

 

this was for my custom object claim..

 

 

var caseId = '{!Claim__c.Id}';

 

 but its not working.

 

 

 

I am working on a visual force page, which will display only high priority tasks. Ideally I want this on the home page or as a button. I've got it up and running on sandbox and now discover I need to get it passed 75% test status.

 

How do I do this?

 

I've tried looking around and created a private test class

 

 

please point me in the right direction.

 

Class

 

 

private class SupermanTest { static testMethod void SupermanTest () { DashboardTaskController mySearchCon = new DashboardTaskController(); } } public class DashboardTaskController { //extends DashboardAbstractController public String objectId {get; set;} //public Task currentObject {get; set;} //public String updatedItemStatus{get; set;} public Integer numLeft {get; set;} public Integer total {get; set;} private Integer startNdx = 0; private static Integer PAGESIZE = 8; private List<Task> fullTaskList = new List<Task>(); private List<Task> displayedTaskList = new List<Task>(); public DashboardTaskController() { } public PageReference refreshPage() { return null; } public List<Task> getTasks() { String ownerId = UserInfo.getUserId(); if (fullTaskList.isEmpty()) { fullTaskList = [select id, WhatId, WhoId, ActivityDate, subject, status, priority, Description, ReminderDateTime, IsReminderSet,isClosed from Task where priority = 'High' and isClosed = false and OwnerId = :ownerId]; numLeft = fullTaskList.size(); total = numLeft; this.objectId = ((Task) fullTaskList[0]).id; //this.currentObject = (Task) fullTaskList[0]; } displayedTaskList.clear(); Integer endNdx = startNdx + PAGESIZE; if (endNdx > total) endNdx = total; for (Integer i=startNdx; i<endNdx; i++) displayedTaskList.add(fullTaskList.get(i)); return displayedTaskList; } private void updateTaskStatus() { System.debug('before : ' + fullTaskList); Integer i = 0; for (i=0; i<fullTaskList.size(); i++) { Task t = fullTaskList.get(i); if (this.objectId.equals(t.id)) { System.debug('updating status of ' + t); Task tmp = [select id, WhatId, WhoId, ActivityDate, subject, status, priority, Description, ReminderDateTime, IsReminderSet, isClosed from Task where id = :t.id]; fullTaskList.set(i, tmp); System.debug('updated to ' + tmp); //this.updatedItemStatus = tmp.status; break; } } System.debug('after : ' + fullTaskList); } private void nextTask() { for (Task t : fullTaskList) { if (!t.isClosed) { System.debug('found non-closed object with id ' + t.id); this.objectId = t.id; break; } } } public PageReference showDetail() { // since I can't get the assignTo to work in the VF page/component this.objectId = System.currentPageReference().getParameters().get('objectId'); /* bizarre ... if I call setObjectId, the id returned from the detailPage method is null but if I directly set the id in this method, everything works correctly setObjectId(System.currentPageReference().getParameters().get('objectId')); */ return null; } public void previous() { startNdx -= PAGESIZE; } public void next() { startNdx += PAGESIZE; } public void refreshNumbers() { // the only time this method should be called is when a submit is done // on a record -- we assume the submit closes the record (or at least // puts the record in a state where we are not interested in seeing // it in our todo list anymore updateTaskStatus(); nextTask(); this.numLeft = 0; for (Task t : fullTaskList) { if (!t.isClosed) { this.numLeft++; } } //this.objectId = prefetchedNextObjectId; } public Boolean getHasNext() { return total > (startNdx + PAGESIZE); } public Boolean getHasPrevious() { return startNdx > 0; } public Integer getNum() { return total; } public PageReference save(){ for (Task t : fullTaskList) { update t; } return null; } }

 

 Apex

 

 

<apex:page controller="DashboardTaskController" standardStylesheets="true" showHeader="true"> <!-- close date will be null since we will only display open ones ... but might want to be more flexible here so management view will look different ... see class --> <!-- {!recordType}---{!num} --> <apex:form id="taskList"> <script> function checkIfNeedRefresh() { //alert('checking for full refresh'); var left = document.getElementById('{!$Component.taskList.numberOfItemsLeft}'); //alert('found items left todo : ' + left.innerHTML); var tmp = parseInt(left.innerHTML); if (tmp == NaN || tmp == 0) { parent.refreshPage(); } } </script> <apex:pageBlock id="pageBlock" title="Priority Task List"> <apex:pageBlockTable value="{!tasks}" var="o" id="table"> <apex:column > <apex:commandLink action="{!showDetail}" value="{!o.subject}" reRender="detail"> <apex:param value="{!o.id}" name="objectId" assignTo="{!objectId}"></apex:param> </apex:commandLink> </apex:column> <apex:column id="status" headerValue="Status" value="{!o.status}"/> <apex:column id="priority" headerValue="Priority" value="{!o.priority}"/> <apex:column id="ActivityDate" headerValue="Due Date" value="{!o.ActivityDate}"/> <apex:column id="WhatId" headerValue="Related to" value="{!o.WhatId}"/> <apex:column id="WhoId" headerValue="Contact/Lead" value="{!o.WhoId}"/> <apex:column id="IsReminderSet" headerValue="Reminder" value="{!o.IsReminderSet}"/> <apex:column id="ReminderDateTime" headerValue="Reminder" value="{!o.ReminderDateTime}"/> <apex:column id="Description" headerValue="Comments" value="{!o.Description}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:panelGrid columns="2"> <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous Page</apex:commandlink> <apex:commandLink action="{!next}" rendered="{!hasNext}">Next Page</apex:commandlink> </apex:panelGrid> <apex:outputText id="numberOfItemsLeft" value="{!numLeft}" style="visibility:hidden"/> <apex:actionFunction action="{!refreshNumbers}" immediate="true" name="refreshNumbers" rerender="numberOfItemsLeft, detail, table" oncomplete="checkIfNeedRefresh();"/> </apex:form> </apex:page>

 

 

 

 

 

Hi,

 

I am trying to code my first VF page and am stuck. gone through documentations and guides and community.

if anyone can help with this , would appreciate.

 

I am trying to show a pageblock based on the results of first query results. Searching for accounts. when clicked on account Name, show details about the cases in another panel.

 

I know I am doing something wrong but dont know what.

 

here is my code

markup

 

<apex:page controller="Mycontroller" >
<apex:form >
    <apex:pageBlock id="block">
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
            <apex:outputLabel for="searchText">Search Account</apex:outputLabel>
                <apex:panelGroup >
                <apex:inputText id="searchText" value="{!searchText}"/>
                <apex:commandButton value="Go!" action="{!doSearch}" rerender="block" status="status"/>
                </apex:panelGroup>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
        <apex:actionStatus id="status" startText="Processing..."/>
        <apex:pageBlockSection title="Account Detail Results" id="results" columns="2">
        <apex:pageBlockTable value="{!results}" var="l" rendered="{!NOT(ISNULL(results))}">
               <apex:actionSupport event="ondblClick" action="{!getScore}" reRender="Score">
               <apex:param name="aid" value="{!l.Name}"/>
               </apex:actionSupport>
             <apex:column value="{!l.Name}"/>
             <apex:column value="{!l.Account_Type__c}"/>
        </apex:pageBlockTable>
        </apex:pageBlockSection>
        </apex:pageblock>
        </apex:form>               
        <apex:outputPanel id="Score" rendered="true" >
        <apex:pageblock>
        <apex:pageBlockSection title="Score Card"  id="results" columns="4" rendered = "True">
        <apex:pageBlockTable value="{!Score}" var="S" rendered="{!NOT(ISNULL(Score))}">
            <apex:column value="{!S.Account.Name}"/>
            <apex:column value="{!S.casenumber}"/>
            <apex:column value="{!S.Solution_Type__c}"/>
            <apex:column value="{!S.ClosedDate}"/>
        </apex:pageBlockTable >
        </apex:pageBlockSection >
        </apex:pageBlock>
        </apex:outputPanel>
</apex:page>

 

Controller

 

Public class Mycontroller {
       
    String searchText;
    List<Account> results;
    List<Case> Score;
       
    Public string getSearchtext(){
        return searchText;
        }
       
    Public void setSearchText (String s) {
        searchtext = s;
        }
    
           
    Public List<Account> getResults() {
        return results;
        }
   
    Public List<Case> getScore() {
        Score = [select Account.Name, casenumber, Solution_Type__C, ClosedDate from case where Account.Name = :searchText and status = 'Closed' limit 10];
        return Score;
        }
       
    Public PageReference doSearch () {
        results = (List<Account>) [FIND :searchtext RETURNING Account(ID, Name, Account_type__C)][0];
        return null;
        }
  }

 

I also wanted to move away from :searchtext and pass aid from markup to this query, not sure how to do it.

 

I also tried this rendered function but did not appear to resolve what I am trying to do.

 

 Public boolean getRendered() {
        Boolean render = (Score == null || results.size() == 0 );
        return render;
        }

 

 

any help anyone can provide is appreciated. been on this for last 3 days.

 

thanks a lot

Poojan.

What would be the html/javascript to create a list of priority tasks on the home page. What javascript would I use to connect to the salesforce table and then pull down the results?

 

 

<html> <head> <script> function GetPriorityTask() { result = sforce.connection.query("Select Id from Case'"); var records = result.getArray("records"); if (records.length != 1) { alert("An error occurred"); } else { alert(records[0]); } } </script> </head> <body> <script> GetPriorityTask(); </script> </body> </html>

 

 

Is there any other way to include visualforce page into home page instead of using iframe?

 

By using iframe, there will have scroll bar which I do not want.

I am trying to create a roll up summary field, but its shaded out... claiming I can not add the field type...

 

 

"You cannot create this type of field on this object because it is not the master in a master-detail relationship."

 

How can I make it so?

Hi,

 

I have a Custom object detail page which has SControl embedded in it.

My SControl has a merge field in it.

 

I created a Visualforce page and added the apex:detail tag in it.

When i viewed the Visualforce page, the entire detail page gets displayed well. But the SControl which is embedded on it is unable to get the value of the Merge Field. 

How should i get the value for the Merge Field or Custom Object id in this scenario?

 

Any help on this will be highly appreciated.

 

Thanks,

OnDem

 

How can i Change Layout of Home Page of my custom application?
OR
 
Is there any way to redirect user after login in Salesforce account to own created page?
Hi,

Is there a timer functionality in Apex?  I want to be able to schedule some operations on a periodic basis.

The second related question is to invoke something that is only accessible from a UI control (from an installed package for which either the backend code or the web service is not available).  Is it possible to simulate a mouse click based on a timer event?

Thanks in advance!