• KevinLaurence
  • NEWBIE
  • 100 Points
  • Member since 2007
  • Consultant
  • Kevin M Laurence Consulting Ltd


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

Hello,

InlineEditing allows us to show and hide buttons during and after editing inline.  However buttons I want hidden by default are displayed.

 

For instance, I have several buttons I want to show by default and hide when editing, plus a Save and Cancel button that I want hidden unless told to display by inline editing.  But when the page loads all of these buttons are displayed.  How am I supposed to make Save and Cancel hidden on page load, surely I dont have to use JS or CSS for that, it must be part of the inline editing capability surely?!

 

 

MORE INFO: Im not using a standard controller everything in the page is handled in a class.  Clicking the Save button (which calls a save method which updates the database, as you'd expect) doesnt save any changes made in inline editing.

I'm starting to think that inline editing will only work with a Standard Controller...

Import Wizards, Data Loader, and Excel Connector -- Each of these tools inserts new records in batches.

 

I need a way to insert a spreadsheet of records one at a time.

 

Reason: Parent record has workflow that runs field updates based on data in the most recent child record. If insertion of child records is done in batches, parent record workflow only runs one time for each batch of child records inserted, rather than one time for EACH child record inserted.

 

When I load the records one at a time in Excel Connector, all is perfect.

 

Any help, tips, or suggestions are greatly appreciated.

I've setup my lead object with a trigger that looks at a zip code table and assigns the proper owner for the lead.

 

This works great when I manually create a lead or load them in with the dataloader. However, when someone submits a lead from our website (web-to-lead), they are all getting assigned to me (not even the default owner). 

 

Is there something I have to turn on to enable my web-to-lead to fire off my Apex trigger? Is there a way that I can debug the web 2 lead process besides the debug email option (I already have that turned on). I'm looking for a way to write out my trigger code to a log and see if it is firing in the web to lead process.

 

Thanks

I'm trying to use the Ajax Toolkit to update a contact record when the contact stops working for their employer. Users click on a custom detail page button which then automatically changes selected fields on the current contact record and refreshes the screen. Here's the code:

Code:
{!requireScript("/soap/ajax/11.0/connection.js")}

// Prompt user for salesforce password
var username = "{!User.Username}";
var password = "";

var x = 550, y = 150;
var w = window.open("","PswdWin","width=" + x + ", height=" + y);
w.moveTo((screen.availWidth / 2) - (x / 2), (screen.availHeight / 2) - (y / 2));
w.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n');
w.document.write(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
w.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n');
w.document.write('<head>\n');
w.document.write(' <meta http-equiv="content-type" content="text/html; charset=utf-8" />\n');
w.document.write(' <title>Salesforce User Password Form</title>\n');
w.document.write('</head>\n');
w.document.write('<body style="text-align: center;">\n');
w.document.write(' <form name="pswd" >\n');
w.document.write(' <p>Please enter your Salesforce password:</p>\n');
w.document.write(' <input type="password" name="password" size="28" />\n');
w.document.write(' <br /><br />\n');
w.document.write(' <input type="submit" name="submitbutton" value="Submit" onClick="window.opener.document.leftcompany(password.value); window.close();" />\n');
w.document.pswd.password.focus();
w.document.write(' </form>\n');
w.document.write('</body>\n');
w.document.write('</html>');
w.document.close();

function leftcompany(password)
{

// Login as user
sforce.connection.login("{!User.Username}", password);

// Create a new instance of the Contact object
MasterObject = new sforce.SObject("Contact");

// Set the Id of the new record to that of the currently viewed Contact
MasterObject["Id"] = "{!Contact.Id}";

// Amend the relevant fields given that we do not know where the Contact now works
MasterObject["Title"] = "Left Company";
MasterObject["Email"] = " ";
MasterObject["Phone"] = " ";
MasterObject["Fax"] = " ";
MasterObject["MobilePhone"] = " ";
MasterObject["Phone_Location_Code__c"] = " ";
MasterObject["Internal_Phone_Number__c"] = " ";
MasterObject["Do_Not_Post__c"] = 1;
MasterObject["HasOptedOutOfEmail"] = 1;
MasterObject["DoNotCall"] = 1;
MasterObject["HasOptedOutOfFax"] = 1;
MasterObject["Post_Preferred__c"] = 0;
MasterObject["Email_Preferred__c"] = 0;
MasterObject["Phone_Preferred__c"] = 0;
MasterObject["Fax_Preferred__c"] = 0;
MasterObject["Left_Company_User__c"] = "{!User.FirstName}" + " " + "{!User.LastName}";

// Update the relevant fields on the Contact record in Salesforce
sforce.connection.update([MasterObject]);

// Refresh the screen
window.top.location.href = window.top.location.href;
}

The error message I'm getting is "window.opener.document.leftcompany is not a function", but the function looks correctly defined to me.

Does anyone understand this error message, or can anyone tell me where I'm going wrong?

Thanks.

I am using Lexiloader v21 on Mac OSX version 10.6.8.  I exported some data to a file, modified one of the fields and then tried to update.  However, none of the buttons except Export will do anything.  If I restart Lexiloader and re-login, I can then do an update.  I've recreated this problem multiple times and it is consistent for me.  Anyone have ideas on how to correct?  Thanks!

Hi,

 

I'm new to SF and am working in Developer mode. I tried an insert of 30 records via Lexiloader (such a relief finding that it exists and that I don't need to run Parallels and Windows!) and it ran, showed no errors, but no success either. And no records were inserted (0 successful inserts and 0 errors).

 

The custom object I'm inserting into has two master-detail relationships - is that a limitation?

 

The custom object has the following fields:

MF_Transactions_Id (Name) = Autonumber

Posted_date_c = Date/Time (defaults to NOW())

Rate_c = Formula(Currency)

Scheme_c = Master-Detail(Scheme)

Squirrel_c = Master-Detail(Contact) [filtered]

Transaction_c = Picklist

Transaction_date_c = Date (defaults to TODAY())

Units_c = Number(8,4)

Value_c = Currency(10,2)

 

In my csv I have all the above fields except the autonumber and the formula field. In the two Master-Detail fields in the csv, I have entered the value that shows up in the Name field in the respective Master. E.g., for Squirrel_c where the Master is the Contacts object, I've used "Mr. Bob Dylan". Here's a sample line:

 

2011-06-23T00:00:00.SSSGMT+5:30,Templeton India Treasury Management Account,Mr. Bob Dylan,Dividend,2011-05-1T00:00:00.SSSGMT+5:30,0.088,133.75

 

Any ideas what could be causing this to bomb?

 

Thanks!

 

 

 

 

Hello,

InlineEditing allows us to show and hide buttons during and after editing inline.  However buttons I want hidden by default are displayed.

 

For instance, I have several buttons I want to show by default and hide when editing, plus a Save and Cancel button that I want hidden unless told to display by inline editing.  But when the page loads all of these buttons are displayed.  How am I supposed to make Save and Cancel hidden on page load, surely I dont have to use JS or CSS for that, it must be part of the inline editing capability surely?!

 

 

MORE INFO: Im not using a standard controller everything in the page is handled in a class.  Clicking the Save button (which calls a save method which updates the database, as you'd expect) doesnt save any changes made in inline editing.

I'm starting to think that inline editing will only work with a Standard Controller...

I've done some development of apex that reads and processes the custom object field history tables and produces that amounts to a cusotmized history related list.

 

That's all well and good, except that it seems that the apex test runner does not track field history, and the oldValue and newValue fields on the history object are not writable.

 

It's a large apex class and has taken the total coverage for my app below 75%. How can I properly test in this situation? Help salesforce!

Hi:

   What is wrong with this formula:

TODAY()+1 & '06:00:00' <== Tomorrow's Date at 6AM

It is a Date/Time Attribute...

 

Thanks

 

 

Hi All,

 

Can some please review this and let me know what the formula below means?  I ran a check syntax and it was approved but the function isn't doing what I want it so I must have an error:

 

Integration_Pendig_Due_Date__c < DATE( YEAR(TODAY()) , (DAY(TODAY()) - 7), DAY(TODAY()))

 

I'm trying to create a formula to run when the Release Date field (Integration_Pendig_Due_Date__c) is less than 7 days out. 

 

Thanks in advance for your help :smileywink:

  • October 08, 2009
  • Like
  • 0

Import Wizards, Data Loader, and Excel Connector -- Each of these tools inserts new records in batches.

 

I need a way to insert a spreadsheet of records one at a time.

 

Reason: Parent record has workflow that runs field updates based on data in the most recent child record. If insertion of child records is done in batches, parent record workflow only runs one time for each batch of child records inserted, rather than one time for EACH child record inserted.

 

When I load the records one at a time in Excel Connector, all is perfect.

 

Any help, tips, or suggestions are greatly appreciated.

Hi All, I have a question, I am trying to create a query to be passed to the datatable based on a value from VisualForce UI, though the query compiles it takes the value as null. for eg. the query line is similar to

object2list = [select id, name, field1__c, field2__c from Object2 where object1__c =: paramval];

1. Object1__c is a related to Object2.

2.paramval is the value passed to the controller from the UI using the apex:param tag.

3. query produces table taking the paramval to be null

4. If I substitue it with the Id the query returns proper data table.

5. If I use the paramval else where and it takes the value properly and am able to save it too.

I am trying to do this so that I can have dependent lookup, the value of paramval will be the id for the value choosen for Object1__c.

Thanks

KD 

  • June 06, 2009
  • Like
  • 0

Is it a Bug, Inline Edit on LEADS object's Enhanced List View tab is not working.

 

NO FIELD in Enhanced List view is displaying the Edit icon on Mouse Hover on Leads object, Other Custom objects and Standard Objects like Contacts are working fine with inline editing.

 

Any idea guys what could be an Issue with Leads object ???

 

Message Edited by vchaddha on 04-25-2009 02:58 AM
  • April 25, 2009
  • Like
  • 0

Hello -

 

I looked at the SOQL documentation. But i did not find...please help

 

if i write Select id,Name where expiration_date__c>=TODAY, it is working. but TODAY will not consider current Time.

 

How to write query to grab fields where datetime_field>=System.NOW() ?

 

Select id,Name where expiration_date__c>=System.NOW()

 

 

expiration_date__c is of type DateTime.

I want to display id and Name values where current datetime is not passed the expiration_date__c.

 

Please advise...Thanks

Message Edited by mavs on 04-14-2009 11:22 AM
Message Edited by mavs on 04-14-2009 12:25 PM
  • April 14, 2009
  • Like
  • 0

When rendering a page as a PDF the filename of the PDF is the name of the page which is not a good thing. The problem with this is that the name is not unique and can cause confusion with the user.

 

I'm working on a quoting app that renders a quote as a PDF. Some broswers open the PDF embed, others automatically launch your PDF reader, and some prompt you to save or open. The problem is that if opened or saved theses files are all saved as qoute.pdf, qoute[1].pdf, quote[2].pdf, quote[3].pdf. The problem should be obvious.

 

Ideally you should be able to define the name of the generated PDF but I haven't figured out how to do this.

 

Thanks,

Jason

  • February 25, 2009
  • Like
  • 1

I've setup my lead object with a trigger that looks at a zip code table and assigns the proper owner for the lead.

 

This works great when I manually create a lead or load them in with the dataloader. However, when someone submits a lead from our website (web-to-lead), they are all getting assigned to me (not even the default owner). 

 

Is there something I have to turn on to enable my web-to-lead to fire off my Apex trigger? Is there a way that I can debug the web 2 lead process besides the debug email option (I already have that turned on). I'm looking for a way to write out my trigger code to a log and see if it is firing in the web to lead process.

 

Thanks

Reference message:
 
I can't display a Histories related list in a VF page.  I used Ron Hess's method of using a pageBlock to get the related list items except one, "Field" (i.e. without the last column in the code below, the VF page displays without an error message).  The error message in the Subject is what is created when I try and access that field.  The WDSL has
 
 <element name="Field" nillable="true" minOccurs="0" type="xsd:string" /> 
 
Code:
<apex:pageBlockTable value="{!SCRB_SalesOrder__c.Histories}" var="h">
      <apex:column headerValue="Date" value="{!h.createddate}"/>
      <apex:column headerValue="User" value="{!h.CreatedById}"/>
      <apex:column headerValue="Action" value="{!h.Field}"/>
</apex:pageBlockTable>


 The normal View page displays the following after I created the record and then I made a change to the "Status Code" field.

DateUserAction
9/18/2008 7:04 PM    xxxxxxxxxxx   Changed Status Code from Draft to Pre-build.
9/13/2008 2:22 PM    xxxxxxxxxxx  

   Created.

The VF page generated the following error messages:
After the record was created:
Changed Field: bad value for restricted picklist field: created
 
Here is another error message on the VF page when "Status Code" field was changed:
Changed Field: bad value for restricted picklist field: StatusCode__c

Thanks for any help.
  • September 19, 2008
  • Like
  • 0
Not sure how many here this news comes as news to, but it sure came as news to us when we learned recently that, irrespective of how restrictive a user's given Profile may be, they will always still be able to change the record ownership on a record belonging to another user to themselves if they wish!

This was acknowledged by the Salesforce tech support team and management, and the only solution we were given was the use of the following validation constraint:

ISCHANGED(OwnerId)

This, however, has the unfortunate side effect of provoking the exact opposite problem accross all users: that of disabling the ability to modify ownership on any record even if you're the Administrator!

Neither situation being acceptable, I figured if I could adjust the formula to apply itself only to those users belonging to the appropriate ProfileID, then all other profile members would continue to be able to modify the ownership of records belonging to other users, and so attempted the following validation constraint instead:

AND (ISCHANGED( OwnerId ) , $User.ProfileId = "00e30000000evEUAAY"

==> By the way, that winking smilie face is supposed to be just a ')' <==

The ID shown is the ID for our sales team's custom profile, but this code - despite passing the syntax checker - provides no constraints whatsoever, even for members of the listed profile! Essentially, this code takes me back to square one, i.e. - as if I had no validation constraints entered to begin with.

Can someone please help us with this?

It's mind-boggling that a program as sophisticated as Salesforce would ommite such an essential function as the ability to restrict users from changing the ownership of records not belonging to them!

Please help...

Thanks,
Philip
I have a situation where we need to continue maintaining the previous employment history of contacts under the contacts as and when they change companies/titles. Any ideas on how to do that automatically or otherwise? I suppose I can generate a related list or a button which populates another object, I was wondering if there are any best practices...
 
Your input, please.
Hi,

I thought that the ID in the URL for any object is unique. For instance, if the URL is some account is ‘https://www.salesforce.com/0016000000In2ky’, where 0016000000In2ky is the internal SF ID. But the problem is that the actual ID pulled from the SF database is ‘0016000000In2kyAAB’.

So, if I want to create a SOQL query in AJAX based on ID like

Code:
result = sforce.connection.query("Select fice__c from Account where Id like ’" + name + "’");

 where 'name' is the ID from the URL, the query wont work. Also, even though documents suggets that you can use '%' in SOQL, a query like:

Code:
result = sforce.connection.query("Select fice__c from Account where Id like ’" + name + "%’");

 

still does not work.

I would truly appreciate any help in this regard.

Thanks,

  • February 25, 2008
  • Like
  • 0
Hello,
 
I am a current Windows XP user but moving over to Mac Leopard now. I will be using MS Office 2008 with Outlook on my Mac.
 
I am pretty happy with my XP outlook desktop integration of salesforce.
 
Is there a solution for my Mac also?
 
I have seen message on this board for use of Windows XP wit Parallels or similar, but wish to use the Mac's native Outlook that comes with Mac Office 2008.
 
Anybody that can advise me?
 
Thanks!