• dgindy
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 18
    Replies
Is there way to send a message to the user from the Apex code like the "Alert" function in javascript when you are running pagereference funcitons?
  • January 13, 2009
  • Like
  • 0
Is it possible to upload a PDF in a visual force page?
 
Is it possible to save a PDF created by a visual force page as an attachment to a contact?
 
 
  • December 17, 2008
  • Like
  • 0
How come my style does not apply unless i'm outputing data?
 
Code:
<apex:pageBlock title="Sleep Target" tabStyle="Account">
    <apex:pageBlockTable value="{!AccountSleep}" var="Sleep" id="theSleepTable" rowClasses="odd,even" styleClass="tableClass" cellspacing="2" cellpadding="2">

           
                <apex:column width="240"  headervalue="Doctor Name"  >
                        
                        <apex:outputlink target="_top" title="" value="/{!Sleep.Id}" type="text/css">{!Sleep.name}</apex:outputlink>&nbsp;
                </apex:column>
                <!-- <apex:column styleClass="c160">
                        <apex:facet name="header"> PCC Name</apex:facet>
                        <apex:outputField value="{!Sleep.Owner.Name}"/>
                </apex:column>-->
                <apex:column styleClass="c160" >
                        <apex:facet name="header" ># Setups</apex:facet>
                        <apex:outputField value="{!Sleep.Setups__c}"/>
                </apex:column>
                <apex:column styleClass="c160" >
                        <apex:facet name="header"># In-Service</apex:facet>
                        <apex:outputField value="{!Sleep.In_Service__c}"/>
                </apex:column>
                <apex:column >
                        <apex:facet name="header"># Patient Visits</apex:facet>
                        <apex:outputField value="{!Sleep.PatientVisits__c}"/>
                </apex:column>                   
                
      </apex:pageBlockTable>
   </apex:pageBlock>

 
  • November 12, 2008
  • Like
  • 0
Code:
<apex:page Controller="DoctorContact">
    <apex:form >

       <apex:pageBlock title="New Contact"  mode="Edit" >
                <apex:pageBlockButtons >
                               <apex:commandButton action="{!save}" value="Save"/>
                               <apex:commandButton action="{!Leave}" value="Cancel" immediate="true"/>
                </apex:pageBlockButtons>
        <apex:pageBlockSection title="New Contact" columns="2" >
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Name" for="Name"/>
                   <apex:inputfield value="{!DoctorContact.Name}" id="Name"  required="true" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Doctor2" for="doctor"/>
                   <apex:inputfield value="{!DoctorContact.Account__c}" id="doctor"  required="true"  />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Phone" for="Phone"/>
                   <apex:inputfield value="{!DoctorContact.Phone__c}" id="Phone"   />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Fax" for="Fax"/>
                   <apex:inputfield value="{!DoctorContact.Fax__c}" id="Fax"   />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Contact Type" for="ContactType"/>
                   <apex:inputfield value="{!DoctorContact.Contact_Type__c}" id="ContactType"   />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                  <apex:outputLabel value="Notes" for="Notes"/>
                   <apex:inputfield value="{!DoctorContact.Notes__c}" id="Notes"   />
            </apex:pageBlockSectionItem>
           
            
        </apex:pageBlockSection>
                           
        </apex:pageBlock>
    </apex:form >

</apex:page>

 
 
I have a phone field that needs validation at the save.  The VF page is sending it to the object but it's not be caught and attached to the field on the page.  Example above. How do i connect the validation to the field on my VF page?
  • October 13, 2008
  • Like
  • 0
How do you prevent the data from saving on a trigger that is set to before insert?
 
  • October 01, 2008
  • Like
  • 1
Is there any way to control the output the of all account and all contact on the mobile application?  Right now all i can do is create a new view but I want to modify the standard views. 
 
  • September 30, 2008
  • Like
  • 0
Does anyone know if it's possible to put a S-control, custom button or VF page into salesforce mobile?
 
  • September 04, 2008
  • Like
  • 0
I want to output a &nbsp; when i run into a null so that my table does not have a break in the row line.  However I can't output a &nbsp; in
Code:
 {!if(!TSK.isEvent,nullValue(TSK.t.RelatedName__c,' ' ),TSK.e.RelatedName__c)}

 
and a space doesn't do anything
Any ideas?
  • August 27, 2008
  • Like
  • 0
Has anyone been successful with combining task and events into a single output? I can do it using two different APEX function but that leaves to having a sorting issue.  Is there anyway to combine the two type and sort?  Any Ideas?
 
Thanks
  • August 25, 2008
  • Like
  • 0
I have a page where I'm trying to leave the page on a cancel button but the required field wont let me. Any ideas?
Code:
public PageReference Leave() {
        string x = ApexPages.currentPage().getParameters().get('DoctorId');
        PageReference pageRef = (new PageReference('/'+x));
        pageRef.setRedirect(true);
        return pageRef;
    }

 
Thanks
  • August 12, 2008
  • Like
  • 0
Ok.  This would seem like a simple answer to find. I could be asking the wrong question. 
Code:
Overnight__c[] Overnight = [select Doctor__c,Oximetry__c,Patient__c,Task__c,Scheduled_Date__c,PCCName__c,id from Overnight__c where Oximetry__c=:OxTest[0].Id];

if(Overnight[0].Id != null)

 
I get an out of index error.  nullvalue()? What should I be using to check if I have a data set being returned.
 
Thanks
  • August 12, 2008
  • Like
  • 0
Is it possible to Union the SOSQL statement before returning it to the VF page? 
 
Code:
t1=[Select WhatId,Name__c,Description,ActivityDate,ActivityDateTime,Id,OwnerId,TimeConverted__c,RelatedName__c,Owner.Name from Event  where Type='In-Service'  and (ActivityDate = THIS_MONTH or ActivityDate = NEXT_WEEK)  and (Owner.UserRole.ParentRoleId=:GroupId or ownerid=:Userid)];
t2=[Select WhatId,Name__c,Description,ActivityDate,ActivityDateTime,Id,OwnerId,TimeConverted__c,RelatedName__c,Owner.Name from Event  where Type='In-Service'  and (ActivityDate =LAST_N_DAYS:30) and Status__c='Completed'  and (Owner.UserRole.ParentRoleId=:GroupId or ownerid=:Userid)];

[Union T1 T2]—–˜™

 ???
 
I have two seperate searchs i wish to return and display. 
 
Thanks
  • August 11, 2008
  • Like
  • 0
Are there If statement you can run inline with the APEX HTML?
 
Code:
<apex:outputLink value="/{!Visits.WhoId}" target="_top">If({!Visits.RelatedName__c}=='')({!Visits.PatName__c}else ({!Visits.RelatedName__c}</apex:outputLink>
                

 
Any Ideas?
  • August 06, 2008
  • Like
  • 0
Is there  a way to setup SF so that you only see 1 reoccuring event on previous history with out going to view all?
  • August 05, 2008
  • Like
  • 0
I have a VF page with a dropdown list doing a javascript:form.submit().  However when I click on the back button i get a webpage has expired.  Any ideas on a work around?
 
I have a Visualforce page in an Iframe and when I click on it in developer mode and it loads in the top window.  But it doesn't load on the top level for non developer mode.  I want this to happen in none developer mode with out having to re-write my entire VF app.  Any ideas?
Thanks
How do you set the style of a page when showHeaders="false"?  Right now everything comes up as gray. 
I tried to create a selectlist with a controller using output from the user table.
  I get a read only error with user table
 
Controller:
Code:
public LIST<User> getUsers()
    {
        list<User> usr = [select id,firstname,lastname from user];
        return usr;
    }

 
Page:
Code:
<apex:form id="theForm" >
     <apex:selectList id="Id" value="{!Users}" size="1" readonly="true" >
             <apex:selectoption itemValue="{!Users.Id}" itemLabel="{!Users.firstname} {!Users.lastname}"></apex:selectoption>
             </apex:selectList> 
</apex:form>

 
Any ideas?
I'm trying to output the Activity Time using the Outputfield.  But it's displaying 2/2/2008 10:30 AM.  The Time is right but i don't want to show the date.  Any ideas?
Does anyone know how to deploy "Ideas" from sandbox to live?
How do you prevent the data from saving on a trigger that is set to before insert?
 
  • October 01, 2008
  • Like
  • 1
Is it possible to upload a PDF in a visual force page?
 
Is it possible to save a PDF created by a visual force page as an attachment to a contact?
 
 
  • December 17, 2008
  • Like
  • 0
Does anyone know the limitations of Visual Force with respect to mobile users and offline (sync) users?
 
If we create an Visualr Force applications and our customers want to use it for their mobile users or offline sync users.  Is visual force supported in these environments?
Hi,

I am getting this error: caused by: System.Exception: Too many SOQL queries: 21  

and I know why, however I don't really know how to solve it, could you please help me with this?

Code:
trigger TaskAccountNumber on Task (before insert, before update) {

/***************************************************************************
* TaskBefore Trigger - TaskCoverage 29/9/08
*
* Description:
* Before a task is inserted/updated, look for a matching contact/lead and update
* Account_Number__c on the task.
*
* Notes:
* To avoid reaching Apex code built-in limits, the code is structured to keep
* the number of SOQL queries to an absolute minimum.
*
* Revision History
* none
****************************************************************************/

// List to hold the WhoId of all incoming task records
List<String> whoIdList = new String [] {};
for(Task loopTask : Trigger.New) {
whoIdList.add(loopTask.WhoId);
}
//issue one query to get all contacts for all incoming who ids (to avoid Apex restrictions)
List<Contact> matchingContacts = [SELECT Id, Account_Number__c from Contact where Id IN :whoIdList];
// issue one query to get all leadsfor all incoming who ids (to avoid Apex restrictions)
List<Lead> matchingLeads = [SELECT Id, Demo_Account__c from Lead where Id IN :whoIdList];

Map<String, Contact> foundContacts = new Map<String, Contact>();
for (Contact loopContact : matchingContacts) {
foundContacts.put(loopContact.Id, loopContact);
}

Map<String, Lead> foundLeads = new Map<String, Lead>();
for (Lead loopLead : matchingLeads) {
foundLeads.put(loopLead.Id, loopLead);
}
// loop through the incoming tasks again, for each, loop through the found contacts/leads to find matching record
// on Id
for(Task loopTask : Trigger.New) {
if (loopTask.WhoId != null) {
Contact foundContact = foundContacts.get(loopTask.WhoId);
if (foundContact != null) {
loopTask.Account_Number__c = foundContact.Account_Number__c;
}else{
Lead foundLead = foundLeads.get(loopTask.WhoId);
if(foundLead != null){
loopTask.Account_Number__c = foundLead.Demo_Account__c;
}
}
}
}
}

 Many Thanks!

  • October 01, 2008
  • Like
  • 0
Hi all,
 
I have got a problem. One of the users is not able to view a particular record though his profile has access to this record type.
He is able to view other records in same record type. On viewing this particular record it throws an error 'Insufficent privileges'. I tried the option of 'Share Rules'. But, as far as I know, share rules are used to share the record types such that users in the group can see the records which are created by anyone in the group. But, this will not stop a user from seeing a record type that has been assigned to his profile.
 
Can anyone provide other clues?
I want to output a &nbsp; when i run into a null so that my table does not have a break in the row line.  However I can't output a &nbsp; in
Code:
 {!if(!TSK.isEvent,nullValue(TSK.t.RelatedName__c,' ' ),TSK.e.RelatedName__c)}

 
and a space doesn't do anything
Any ideas?
  • August 27, 2008
  • Like
  • 0
Ok.  This would seem like a simple answer to find. I could be asking the wrong question. 
Code:
Overnight__c[] Overnight = [select Doctor__c,Oximetry__c,Patient__c,Task__c,Scheduled_Date__c,PCCName__c,id from Overnight__c where Oximetry__c=:OxTest[0].Id];

if(Overnight[0].Id != null)

 
I get an out of index error.  nullvalue()? What should I be using to check if I have a data set being returned.
 
Thanks
  • August 12, 2008
  • Like
  • 0
Are there If statement you can run inline with the APEX HTML?
 
Code:
<apex:outputLink value="/{!Visits.WhoId}" target="_top">If({!Visits.RelatedName__c}=='')({!Visits.PatName__c}else ({!Visits.RelatedName__c}</apex:outputLink>
                

 
Any Ideas?
  • August 06, 2008
  • Like
  • 0
How do you set the style of a page when showHeaders="false"?  Right now everything comes up as gray. 
I tried to create a selectlist with a controller using output from the user table.
  I get a read only error with user table
 
Controller:
Code:
public LIST<User> getUsers()
    {
        list<User> usr = [select id,firstname,lastname from user];
        return usr;
    }

 
Page:
Code:
<apex:form id="theForm" >
     <apex:selectList id="Id" value="{!Users}" size="1" readonly="true" >
             <apex:selectoption itemValue="{!Users.Id}" itemLabel="{!Users.firstname} {!Users.lastname}"></apex:selectoption>
             </apex:selectList> 
</apex:form>

 
Any ideas?
I'm trying to output the Activity Time using the Outputfield.  But it's displaying 2/2/2008 10:30 AM.  The Time is right but i don't want to show the date.  Any ideas?
Does any know how to reduce the results of a search on a relationship that's not limit?  I don't need to reduce the number of lines returned. 

Select p.Doctor__c, p.Doctor__r.Name, p.Doctor__r.OwnerId, p.Name, (Select Description, Id From Tasks) from Patient__c p

 

It returns all doctors and any task.  if there is no task it still returns the doctor.  How do i get only doctors with tasks?

 

  • April 30, 2008
  • Like
  • 0
What’s the Salesforce definition of an API call in an S-Control?  Anything that uses sforce?
  • April 24, 2008
  • Like
  • 0
How do I move from sandbox to live?  The Help documentation is lacking in detail
  • April 21, 2008
  • Like
  • 0
How do I get a user's time zone with in a s-control?  We have Users all over the US and need the offset the time for each user individually. 
  • April 17, 2008
  • Like
  • 0