• dedkins
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

I've been able to leverage the CalendarSimple code for our needs - however, I'm running into a challenge and can't figure out a way to make it work without creating several different pages to rerender based on input.

 

VF Page - combines two includes.  On the left I have a list of people that I can select from, on the right I have a calendar with associated open slots of time.  When a person is selected, it refreshes the right side (calendar) with all available slots of time using two variables passed in the url.  I'd like to allow the user to change the calendar view (availability) based on certain criteria after the screen has refreshed.  The code:

 

public CalendarMonth getMonth() { return month; } 

 

private void setMonth(Date d) {
month = new CalendarMonth(d);
system.assert(month != null);

Date[] da = month.getValidDateRange(); // gather events that fall in this month
events = [ select id,subject,availability__c,description,activitydate,activitydatetime,DurationInMinutes
from Event
where activitydate >= :da[0] AND activityDate <= :da[1] AND availability__c = 'Available' AND location__c = 'San Diego'
order by activitydatetime];

month.setEvents(events); // merge those events into the month class
}

 

I'd like to be able to dynamically add or change the blue text based on commandlinks on the page - without refreshing and losing the params that have been passed. 

 

How can I dynamically update a set method?

 

Thank you.

Dave

 

 

I have a custom object (order__c), it has (product_item__c) items; the product items have a look up field for products in (product__c).  I'm trying to close the order and update the quantity of the product__c items through the product_item__c line item in the order.  But they are not updating.  The order closes and the fields update, but the items (and  do not update.

 

heirarchy

*order__c -> product_Item__c -> product__c

 

I'm trying to update two fields in product__c (ros__c and committed__c) by the qty field in product_item__c.  There may be multiple product items for an order, so it needs to iterate through the list.

 

Here's what I have - but it doesn't work:

 

public PageReference save(){

Order__c ord = [select id from Order__c where id = :Apexpages.currentPage().getparameters().get('id')];
List<Product_Item__c> products = new List<Product_Item__c>();

for (Product_Item__c p : [select id,inventory__r.committed__c,inventory__r.ros__c,qty__c from Product_Item__c where order__r.id = :ord.Id]){

p.inventory__r.committed__c = p.inventory__r.committed__c - p.qty__c;
p.inventory__r.ros__c = p.inventory__r.ros__c - p.qty__c;

products.add(p);
}

update products;

controller.save();

return null;

 

 

Thank you.

I'm trying to separate attachments from the standard notes and attachments list for an account (we use person accounts) and having a heck of a time.  I've tried a number of different ways to get to the information.  I can successfully pull a list of attachments from the account record if the attachment was directly attached.  But I cannot seem to get to attachments that are in tasks in the account record.  

 

I have a record I'm using for test that has one attachment directly attached and another in a task.

 

Error when I use the following code is "Attempting to reference a null object":

"

Task t;

public List<Task> getTasks(){
List<Task> t = [select id from Task where accountId = :ApexPages.currentPage().getParameters().get('id')];
return t;
}

public List<Attachment> getTaskAttachments(){
List<Attachment> attach = [select Id,name from Attachment where parentId = :t.Id];
return attach;
}

"

Seems to me that the second method cannot see the list from the t variable.  If I change it from t:Id to :account.Id, I at least get the attachment directly attached to the account record.

 

When I try the following code is gives the error in Force IDE of Initial Term of field expression must be a concrete SObject List<Task>:

"

public List<Task> t = [select id from Task where accountId = :ApexPages.currentPage().getParameters().get('id')];

public List<Attachment> getTaskAttachments(){
List<Attachment> attach = [select Id,name from Attachment where parentId = :t.Id];
return attach;
}"

 

It will be apparent to many of you that I really don't know what I'm doing - with that said - I do appreciate any help you can provide.

 

Thank you.

We are looking for an experienced Salesforce Developer to join our team in Roseville, CA.  Job requirements include supporting Salesforce projects as well as facilitating training with development team.  Please message me if you are interested.