• Jashugan
  • NEWBIE
  • 5 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 21
    Replies
I have a Sample Request object that uses an approval process. I have created a Flex control that allows sales reps to quickly add products to the sample request. This control currently allows them to add products even after the record has been submitted for approval and has been locked for editing. I would like to query the status of the record to see if it is locked or not.

The only method I found was to go through the ProcessInstance relationship. The problem with this method is that there could be multiple ProcessInstances for each sample request (as it gets rejected, revised, and finally approved). I would have to go through all of the ProcessInstances and find the newest one, and then query it's status to determine whether the record is locked. I feel like this method is overly tedious.

Ideally there would be a field on the Sample Request object which lets me know whether a record is locked or not. But so far I haven't found anything like this.
The activesalesforce plugin severely limits the names you are allowed to give to your custom classes. You cannot have any underscores in the API name for your custom object. So a name like "Core_Product" must be renamed to "CoreProduct", otherwise activesalesforce has a fit.

This class:


class SfCoreProduct < ActiveRecord::Base

set_table_name "Core_Product__c"
set_primary_key "id"
establish_connection "salesforce"

end


produces this error:


INVALID_TYPE: sObject type 'CoreProduct_c__c' is not supported


Setting the Salesforce object to "CoreProduct", and changing the "SfCoreProduct" class to the following code works.


class SfCoreProduct < ActiveRecord::Base

set_table_name "CoreProduct"
set_primary_key "id"
establish_connection "salesforce"

end


I have developed several S-Control's in the past using Javascript and Flex, and neither of those connectors changed the salesforce custom object names specified. I have two options:

1. Remove underscores from all of custom objects and the S-Controls that use them.
2. Hack activesalesforce to use the table name specified in "set_table_name".

Neither of these seem to appealing
I get the following error:


uninitialized constant Product2


coming from the class_from_entity_name method in asf_adapter.rb

Here is my sf_product.rb:

class SfProduct < ActiveRecord::Base

set_table_name "Product2"
set_primary_key "id"
establish_connection "salesforce"

end


Here is my product.rb:

class Product < ActiveRecord::Base
end


I can get rid of this error by changing the sf_product.rb file to this:

class SfProduct < ActiveRecord::Base

set_table_name "Product2"
set_primary_key "id"
establish_connection "salesforce"

end

# for some reason this is needed
class Product2 < ActiveRecord::Base
end


Is there a reason that the Product2 class must exist at all? Is there any documentation on ActiveSalesforce other than the README file?

Message Edited by Jashugan on 08-24-2007 10:15 AM

Hello,

I was wondering if it were possible to make synchronous calls using the flex toolkit (Adobe flex toolkit for Apex). If not, does anyone have ideas of what method I should use to wait for a series of asynchronous calls to finish before executing a function?

TIA

Message Edited by Jashugan on 06-20-2007 05:28 PM

I have a Sample Request object that uses an approval process. I have created a Flex control that allows sales reps to quickly add products to the sample request. This control currently allows them to add products even after the record has been submitted for approval and has been locked for editing. I would like to query the status of the record to see if it is locked or not.

The only method I found was to go through the ProcessInstance relationship. The problem with this method is that there could be multiple ProcessInstances for each sample request (as it gets rejected, revised, and finally approved). I would have to go through all of the ProcessInstances and find the newest one, and then query it's status to determine whether the record is locked. I feel like this method is overly tedious.

Ideally there would be a field on the Sample Request object which lets me know whether a record is locked or not. But so far I haven't found anything like this.
Hi,

I have built a custom S-Control for the Home Tab, and it is working for the most part.  The problem is that I want to show a listing of Opportunities, with one of the columns being the Account that the Opportunity has.

This query runs fine in my S-Control:
Select Id, Name, Theme__c, Stagename, Sales__c, GP__c From Opportunity

This query runs fine in Apex Explorer 8.0, but it will not run inside my s-control:
Select Id, Name, Account.EPF_Account_ID__c, Theme__c, Stagename, Sales__c, GP__c From Opportunity

I read in a previous post that relational SOQL queries need to use the 8.0 API to get them to work in S-Controls.  If this is my problem, how can I use the 8.0 API in my s-control?

Thanks,

Joanna
  • November 01, 2007
  • Like
  • 0
The activesalesforce plugin severely limits the names you are allowed to give to your custom classes. You cannot have any underscores in the API name for your custom object. So a name like "Core_Product" must be renamed to "CoreProduct", otherwise activesalesforce has a fit.

This class:


class SfCoreProduct < ActiveRecord::Base

set_table_name "Core_Product__c"
set_primary_key "id"
establish_connection "salesforce"

end


produces this error:


INVALID_TYPE: sObject type 'CoreProduct_c__c' is not supported


Setting the Salesforce object to "CoreProduct", and changing the "SfCoreProduct" class to the following code works.


class SfCoreProduct < ActiveRecord::Base

set_table_name "CoreProduct"
set_primary_key "id"
establish_connection "salesforce"

end


I have developed several S-Control's in the past using Javascript and Flex, and neither of those connectors changed the salesforce custom object names specified. I have two options:

1. Remove underscores from all of custom objects and the S-Controls that use them.
2. Hack activesalesforce to use the table name specified in "set_table_name".

Neither of these seem to appealing
Hi, I've been trying to use the Flex Toolkit for Apex as a plug-in to eclipse 3.2. I have tried versions R3_5[1] and R3_6 of the toolkit and I cannot get either to compile or run the sample salesforce.mxml. I have followed the quick start steps, but eclipse does not seem to be compiling the output files to the target directory and gives an error that it could not find the the file bin/salesforce.html.
 
There is one error which appears in eclipse for salesforce.mxml:
 
"1067: Implicit coercion of a value of type Array to an unrelated type String. FlexTest salesforce.mxml line 175"
 
which refers to the code line:
 
apex.retrieve(fields,"Account", ids,
Any thoughts?
 
Incidentally, I can't get the DayPlanner sample to run either.
 
Many thanks for any help, Chris
hai
Now in salesforce new feature is added(setup->build->code).in that i can write packages but my problem is ,where can i call this package.pls give me quick response.
 
Regards
madhu.
 
  • June 26, 2007
  • Like
  • 0
In my CASE function I have a merge field and and 2 case options.  When I view it in the "edit custom link" box it reports no syntax errors.  But when I try to launch the link and invoke the javascript which performs my case, I get an error which states that my "else_result" value is not defined.  Can anyone explain this or provide an alternative?

Thanks in advance.
hai
i can i invoke the parent window javascript function in child window(child window is developed in flex)
pls help me anyone.
 
Regards,
madhu
  • June 21, 2007
  • Like
  • 0
Hello,

I was wondering if it were possible to make synchronous calls using the flex toolkit (Adobe flex toolkit for Apex). If not, does anyone have ideas of what method I should use to wait for a series of asynchronous calls to finish before executing a function?

TIA

Message Edited by Jashugan on 06-20-2007 05:28 PM

2 questions as I am new to Actionscript and Flex:

1) How can I make data in a flex datagrid show up as a hyperlink if I am using an Arraycollection to populate the grid?

2) Is there any way in Flex/actionscript to combine multiple datasets (various custom objects related to 1 common custom object) and display them in a specified order?

Any help is greatly appreciated...

Thanks
hai
i have one doubt, will mozilla supports Ajax Tool Kit9.0 or not,my problem
is my code is working on IE but the same is not working on mozilla,in my code
i used Ajax Tool Kit9.0
 
 Regards,
  yellaiah.
  • June 15, 2007
  • Like
  • 0
I am looking for a way to set up a workflow rule with an email alert that will notify an opportunity when an open but not yet reached the closed/won stage has a close date earlier than today.
 
I have searched help and through the discussion groups and can not seem to find the right formula to put this in place.
 
Thank you
 
Rich P
Hi,

A dilemma:

When I type in John Doe (let's say I have 10 such people) as the contact for a new case I get the lookup for the matching contacts and accounts. My problem is that it displays the account name and I can only identify the account by a custom field in the account menu (account number for example)

For example:

John Doe    Seafood Corp.
John Doe    Bakery World
John Doe    Sushiland

I have no idea which John Doe I really need. What I am looking for is an option to add another field to the lookup so I can see the unique identifier which have:

John Doe    Seafood Corp.    Acct: 654654
John Doe    Bakery World     Acct: 966587
John Doe    Sushiland           Acct: 577485

Then I can choose the John Doe I need by selecting the Acct number.

Does this exist?
Anyone got some creative suggestions?

:smileywink:

While creating AJAX Toolkit apps I encountered an unexpected error, saying
uncaught exception: {faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element "query".', }
After long time debugging I finally found out following two libraries are conflicting, prototype.js and AJAX Toolkit. This simple S-Control would raise same error message.

Code:
<html>
  <head>
    <script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script>
    <script type="text/javascript" src="http://prototypejs.org/assets/2007/1/18/prototype.js"></script>
    <script type="text/javascript">    
window.onload = function() {
  var res = sforce.connection.query('SELECT count() FROM Account', function(res) { alert(res.size) })
}
    </script>
  </head>
  <body>
  </body>
</html>
It appears that some array prototype overiding in prototype.js causes this problem. Now prototype.js is one of the most major JavaScript library, do you have any workaround from AJAX Toolkit side?
  • January 30, 2007
  • Like
  • 0
Is it possible to default which Price Book is selected for a new Opportunity, based on data contained in the Account?
Specifically, my client has members and non-members, who get different prices on stuff.  The simple method for pricing would be to have a member and a non-member price book, each containing the same Products but with different prices.

The default behavior seems to be that the user must choose, every time, which PB to use.  Once it's selected for an Opp, it stays selected, but it must be chosen manually for every new Opp.

I'd like to know if it's possible to make this happen automatically, either within native Salesforce or via AJAX API.

Thanks!
M.
 

Hi all,

I have a request from a customer to tie each accounts with a specific price book, and once you create an opportunity for that account it would revert automatically to the attached price book?

Thanks,