• rbuchanan
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies

Hi.  I'm using classic ASP and the 4.0 version of the SForceOfficeToolkitLib to run a simple select query to retrieve the unitprice value from a record in the PricebookEntry object.   The query runs fine, but when I do the "for x in y"  where y is hte queryresultobject, the code inside the "for" loop is not giving me the answer.   I have a response.write immediately after the line where I move the query item into a variable, but the variable is not being printed out.   There's no error message - it's as if it's not going into the "For" loop at all.  I queried the "size" value and it equals 1, which is what I expect as I'm trying to get the unit price for a single part number in the pricebook entry object.  Here's the code.  Can anyone tell me why the UnitPrice is not coming back to me?    pbID is a parameter containing the pricebook ID and rs is a ADO (Active Data Object) recordset object containing the part number I want to query.  The queryresult object is created when the line of code executes that says "Set SFPrices = sfdc.query(strSQL, false)"     However, I don't have a class string to create the sObject4.   Could that be the problem??

 

 strSQL = "Select UnitPrice from PricebookEntry where Pricebook2Id = '" & pbID & "' and ProductCode = '" & rs("ITEM_NUMBER") & "'"

 

Set SFPrices = sfdc.Query(strSQL, False)

If sfdc.Error = NO_SF_ERROR Then

      If SFPrices.Size > 0 Then

            For Each SFPrice In SFPrices

                     vPrice = SFPrice.item("UnitPrice")

                     Response.Write " price = " & vPrice
            Next

      else

             vPrice = 0

             strERR = "This part is not active in the selected price book"

      End if

else

      Response.Write "Cannot make a connection to Salesforce"

End if

 

Hi.  I've spent the last 2 hrs looking at some threads that have to do w/ this topic but could not find anything that looks like what i need to do.

 

I need a custom button on the lead detail page which, when clicked, will send an email to a co-worker and update the activites of that lead to show this email was sent.   I'd like to be able to provide the subject and body with the javascript on the fly, but if I have to use an email template, that's OK.    Everything I've tried that's already been posted has either given me compile errors when I click the button or an error message saying something about an invalid ID  (I tried to substitute my own user ID to receive the email).

 

Thanks for any and all help!

 

Not sure why, but the vbscript I wrote in an .asp page (not asp.NET) runs fine on my local PC webserver but gives me an error message when I try to run it from the server where it will eventually reside.  I installed the "Connect for Office" software on the server.   Here's the simple code I'm trying to run just to establish a connection:

 

<%@ language=VBScript %>

<%   dim  sfdc

 

Set sfdc = server.createobject("SForceOfficeToolkit3.SForceSession3")

 

If not sfdc.login("username", "password") Then

     Response.write "Login error: " & sfdc.ErrorMessage

End If

 

 

On my local PC, it runs fine - no error messages.  On the server, I get this message back from the sfdc object:

 

Login error: Unable to send request to server.  Access is denied

 

 

Any thoughts?  I thought maybe the security token might be necessary as I'm using a specific user account to log into SF, but I was able to actually log into the Salesforce SFA using that account without needing a token, so I assume the IP address is trusted.  By the way, I can run this code (with a little modification of change the response.write to "msgbox") in an EXCEL macro ON THIS SERVER and not get any errors.  It seems to not like it only when running from this vbscript in my ASP page.

Hi.  I'm attempting to write my first APEX code in the form of a trigger.  I have a custom field on the Opportunity Product page called "Refurbished__c".  It's a checkbox.  If the salesperson checks that box on the item he's adding to the opportunity, I want the list price to automatically get a 65% discount and show that calculated amount on the same page that he checked the box. 

My code so far is this, but I get an error on line 3 just after the "=" sign when I try to compile (error message in subject line above)  Any help would be much appreciated!   Thanks.

 

trigger Refurbished_Checked on OpportunityLineItem (After Update) {
    if (OpportunityLineItem.Refurbished__c) {
        OpportunityLineItem.ListPrice = OpportunityLineItem.ListPrice * 0.35 ;
  } else {
        OpportunityLineItem.ListPrice = OpportunityLineItem.ListPrice ;
  }
}

Most of my users have the SF Outlook 2.0 edition installed and sync their emails, contacts and events all the time.  I just noticed that if I create an event in Outlook, set the reminder to 30 minutes notice, then click "Save and Mark for Sync", the outcome is that the event IS added to my Salesforce calendar.  However, I noticed that the event in Salesforce does not show the same 30-minute reminder nor is the reminder box even checked.   
 
Conversely, if I create the event in Salesforce and use a 30-minute reminder, when I sync my Outlook, that event is added to my Outlook calendar but at the default Salesforce.com setting of 15-minute reminder.  It would appear that there is no communication, whatsoever, between the Outlook reminder and the new reminder in SF.
 
If these pop-up reminders only work by setting the reminder manually or only creating the events in Salesforce first,  I don't see the advantage to anyone using Outlook.     Maybe this is being address in a future release of SF Outlook Edition ???
 
 

Hi.  I'm using classic ASP and the 4.0 version of the SForceOfficeToolkitLib to run a simple select query to retrieve the unitprice value from a record in the PricebookEntry object.   The query runs fine, but when I do the "for x in y"  where y is hte queryresultobject, the code inside the "for" loop is not giving me the answer.   I have a response.write immediately after the line where I move the query item into a variable, but the variable is not being printed out.   There's no error message - it's as if it's not going into the "For" loop at all.  I queried the "size" value and it equals 1, which is what I expect as I'm trying to get the unit price for a single part number in the pricebook entry object.  Here's the code.  Can anyone tell me why the UnitPrice is not coming back to me?    pbID is a parameter containing the pricebook ID and rs is a ADO (Active Data Object) recordset object containing the part number I want to query.  The queryresult object is created when the line of code executes that says "Set SFPrices = sfdc.query(strSQL, false)"     However, I don't have a class string to create the sObject4.   Could that be the problem??

 

 strSQL = "Select UnitPrice from PricebookEntry where Pricebook2Id = '" & pbID & "' and ProductCode = '" & rs("ITEM_NUMBER") & "'"

 

Set SFPrices = sfdc.Query(strSQL, False)

If sfdc.Error = NO_SF_ERROR Then

      If SFPrices.Size > 0 Then

            For Each SFPrice In SFPrices

                     vPrice = SFPrice.item("UnitPrice")

                     Response.Write " price = " & vPrice
            Next

      else

             vPrice = 0

             strERR = "This part is not active in the selected price book"

      End if

else

      Response.Write "Cannot make a connection to Salesforce"

End if

 

Hi.  I'm attempting to write my first APEX code in the form of a trigger.  I have a custom field on the Opportunity Product page called "Refurbished__c".  It's a checkbox.  If the salesperson checks that box on the item he's adding to the opportunity, I want the list price to automatically get a 65% discount and show that calculated amount on the same page that he checked the box. 

My code so far is this, but I get an error on line 3 just after the "=" sign when I try to compile (error message in subject line above)  Any help would be much appreciated!   Thanks.

 

trigger Refurbished_Checked on OpportunityLineItem (After Update) {
    if (OpportunityLineItem.Refurbished__c) {
        OpportunityLineItem.ListPrice = OpportunityLineItem.ListPrice * 0.35 ;
  } else {
        OpportunityLineItem.ListPrice = OpportunityLineItem.ListPrice ;
  }
}