• KC0798
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 10
    Replies
I'm looking to update a date field that I've queried and add days to that field. Anyone can tell me how I can convert the field? The value is just appending as string.
 
I have the following but can't figure out how to convert:
 
var opportunities = sforce.connection.query(
                                                                   // where Progress_Claim_Interval__c is a number value
"SELECT Id, AccountId, Claim_Date__c, Progress_Claim_Interval__c " +
"FROM Opportunity WHERE "+
"Claim_Date__c <> NULL and "+
"Claim_Date__c < today"
);
 
  var rec = opportunities.getArray("records");
  for (var i = 0;i<rec.length;i++) {
    alert("Old Claim Date:"+rec[i].Claim_Date__c);
    rec[i].Claim_Date__c = rec[i].Claim_Date__c + rec[i].Progress_Claim_Interval__c; //How can I do this?
    alert("New Claim Date:"+rec[i].Claim_Date__c);
  }
 
Many Thanks!
Hi,
 
Anyone can tell me which DB salesforce is using? I'm trying to run some queries using the APex Explorer, but don't now how to work comparisons for date fields.
 
Eg. Like to do comparison on dates fields against today's date.
 
Select o.AccountId, o.Claim_Date__c, o.Id, o.Installation_Completed_Date__c, o.Installation_Start_Date__c, o.Name, o.OwnerId, o.Progress_Claim_Interval__c from Opportunity o where (o.Claim_Date__c <> null and o.Installation_Completed_Date__c = null and o.Installation_Start_Date__c <> null and o.Claim_Date__c < TODAY()??)
 
Thanks,
KC
 
 
Hi, I notice several posts pointing to some fields, eg.
 
 
how would I know that there is a acc18street field under account? Where do I find this info?
 
If I have a customer website field created under User, eg. Website_c
 
how would I reference this in a similar code? Like this?
 
 
Need some pointers, am a little confused with the references.
 
Many Thanks!
KC
 
 
Hi there,
 
I'm writing a simple code to update my custom 'Mood' field on the user record. The result is successful, but the record is not updated. The mood field is a picklist. Anyone? Code below:
 
var result = sforce.connection.query("SELECT Id, Name, Mood__c " +
    "FROM User WHERE Id='{!User.Id}'");
var rec = result.getArray("records");
  alert(rec[0].Mood__c); //Testing with first record. Confirmed that a record is retrieved and show initial record value

  rec[0].Mood__c = "Happy";
  var saveResult = sforce.connection.update(rec);
  if(saveResult[0].success){  // Always indicates success
  alert('Successful');
  }
 else {
  alert('There was an error');
  }
Many Thanks!
KC
Hi there,
 
Wonder if anyone has found a way to trigger a workflow or action without the record being updated in Salesforce. I'm trying to create a workflow that tracks an opportunity and creates a task every day to alert the owner of follow-ups that need to be done.
The opportunity record, in which case, may not have been updated by anyone.
 
Many thanks for any suggestion!
 
Cheers,
KC
Hi,
 
I have been trying to solve this problem for a while, wondering if anyone can help me with this?
 
I have to put in a field in the opportunity screen that reflects the number of days since any activity was done for the opportunity.
Any activity done meaning the last modified date of the last activity associated to the opportunity. This can either be a task or an event. The idea is to check how long ago the activity was updated or created for this opportunity.
 
The tricky bit is that this is for the Group Edition and therefore no Apex or Ajax I believe?
 
I'm a newbie and have been trying this out but no luck?
 
Any help is greatly appreciated!
 
Many Thanks!
 
KC
  • April 28, 2008
  • Like
  • 0
I'm looking to update a date field that I've queried and add days to that field. Anyone can tell me how I can convert the field? The value is just appending as string.
 
I have the following but can't figure out how to convert:
 
var opportunities = sforce.connection.query(
                                                                   // where Progress_Claim_Interval__c is a number value
"SELECT Id, AccountId, Claim_Date__c, Progress_Claim_Interval__c " +
"FROM Opportunity WHERE "+
"Claim_Date__c <> NULL and "+
"Claim_Date__c < today"
);
 
  var rec = opportunities.getArray("records");
  for (var i = 0;i<rec.length;i++) {
    alert("Old Claim Date:"+rec[i].Claim_Date__c);
    rec[i].Claim_Date__c = rec[i].Claim_Date__c + rec[i].Progress_Claim_Interval__c; //How can I do this?
    alert("New Claim Date:"+rec[i].Claim_Date__c);
  }
 
Many Thanks!
Hi,
 
Anyone can tell me which DB salesforce is using? I'm trying to run some queries using the APex Explorer, but don't now how to work comparisons for date fields.
 
Eg. Like to do comparison on dates fields against today's date.
 
Select o.AccountId, o.Claim_Date__c, o.Id, o.Installation_Completed_Date__c, o.Installation_Start_Date__c, o.Name, o.OwnerId, o.Progress_Claim_Interval__c from Opportunity o where (o.Claim_Date__c <> null and o.Installation_Completed_Date__c = null and o.Installation_Start_Date__c <> null and o.Claim_Date__c < TODAY()??)
 
Thanks,
KC
 
 
Hi, I notice several posts pointing to some fields, eg.
 
 
how would I know that there is a acc18street field under account? Where do I find this info?
 
If I have a customer website field created under User, eg. Website_c
 
how would I reference this in a similar code? Like this?
 
 
Need some pointers, am a little confused with the references.
 
Many Thanks!
KC
 
 
Hi there,
 
I'm writing a simple code to update my custom 'Mood' field on the user record. The result is successful, but the record is not updated. The mood field is a picklist. Anyone? Code below:
 
var result = sforce.connection.query("SELECT Id, Name, Mood__c " +
    "FROM User WHERE Id='{!User.Id}'");
var rec = result.getArray("records");
  alert(rec[0].Mood__c); //Testing with first record. Confirmed that a record is retrieved and show initial record value

  rec[0].Mood__c = "Happy";
  var saveResult = sforce.connection.update(rec);
  if(saveResult[0].success){  // Always indicates success
  alert('Successful');
  }
 else {
  alert('There was an error');
  }
Many Thanks!
KC
Hi there,
 
Wonder if anyone has found a way to trigger a workflow or action without the record being updated in Salesforce. I'm trying to create a workflow that tracks an opportunity and creates a task every day to alert the owner of follow-ups that need to be done.
The opportunity record, in which case, may not have been updated by anyone.
 
Many thanks for any suggestion!
 
Cheers,
KC
Hi,
 
I have been trying to solve this problem for a while, wondering if anyone can help me with this?
 
I have to put in a field in the opportunity screen that reflects the number of days since any activity was done for the opportunity.
Any activity done meaning the last modified date of the last activity associated to the opportunity. This can either be a task or an event. The idea is to check how long ago the activity was updated or created for this opportunity.
 
The tricky bit is that this is for the Group Edition and therefore no Apex or Ajax I believe?
 
I'm a newbie and have been trying this out but no luck?
 
Any help is greatly appreciated!
 
Many Thanks!
 
KC
  • April 28, 2008
  • Like
  • 0