• Rhoose-boy
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Is it possible to query the userid for an aborted async job - in other words find who aborted it?

I'm struggling with using GETRECORDIDS in a javascript that is called from an apex command button on a VF page.

 

Keep getting 'getRecordIds is not defined' when using Firebug

 

Code is like this:

 

<script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript" > 
function massdelete(){
var records = {!GETRECORDIDS($ObjectType.Member__c )};

 

The HTML for the page shows as:

 

<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript"> 
function massdelete(){
var records = getRecordIds('a0B');

 

Is it possible to use GETRECORDIDS in this way?

 

 

Hi - I have a client request I'm struggling with, and would value any ideas.

 

I have members (Member__c as parent) that take awards (Award__c as child). Awards expire after time and have to be updated.

 

Certain high level awards require a combination of other awards before the member can qualify for awards. The client has asked to be able to add simple logic that determines which awards are required to gain the higher awards.

 

So I've set-up 5 look-up fields so that the user can select up to 5 awards needed to qualify for the higher level award.

And created a text field to enter a logic expressions - something like (AwardA OR AwardB) AND AwardC - a bit like the 'Add Filter Logic' when setting up a workflow.

 

So what I need to do is to check through all of the valid awards held by the member, and see if they have the awards required with the specified logic.

 

I can use a formula and SUBSTITUTE commands to create a query string using the user enter logic - 

 

Award_Type4__r.Qualifications_Awards__c.Name='SLSGB Assessor Update' OR Award_Type4__r.Qualifications_Awards__c.Name='SLSGB IRB Assessor'

 

and I can build this into a full query string. 

 

I have tried putting this into a query, but as I need to query from the parent, I'm struggling to get it to work..

 

I tried this:

 

Member__c[] members = [Select id, (select id from Awards__r  WHERE ((Award_Type4__r.Qualifications_Awards__r.Name='SLSGB Assessor Update' OR Award_Type4__r.Qualifications_Awards__r.Name='SLSGB IRB Assessor') AND Member__c=:memberid)) from Member__c WHERE id=:memberid];

 

but seem to get 1 result each time regardless of the awards held by the Member.

 

I'm not even sure a SOQL is the correct approach - I did consider putting all of the valid awards held by the member into a set, then uses the set.CONTAINS() to see if the required awards existed, but not sure how to apply the logic requirement with this approach.

 

Any ideas ?

 

Many thanks.

 

 

 

 

I'm struggling with using GETRECORDIDS in a javascript that is called from an apex command button on a VF page.

 

Keep getting 'getRecordIds is not defined' when using Firebug

 

Code is like this:

 

<script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript" > 
function massdelete(){
var records = {!GETRECORDIDS($ObjectType.Member__c )};

 

The HTML for the page shows as:

 

<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript"> 
function massdelete(){
var records = getRecordIds('a0B');

 

Is it possible to use GETRECORDIDS in this way?

 

 

Hi - I have a client request I'm struggling with, and would value any ideas.

 

I have members (Member__c as parent) that take awards (Award__c as child). Awards expire after time and have to be updated.

 

Certain high level awards require a combination of other awards before the member can qualify for awards. The client has asked to be able to add simple logic that determines which awards are required to gain the higher awards.

 

So I've set-up 5 look-up fields so that the user can select up to 5 awards needed to qualify for the higher level award.

And created a text field to enter a logic expressions - something like (AwardA OR AwardB) AND AwardC - a bit like the 'Add Filter Logic' when setting up a workflow.

 

So what I need to do is to check through all of the valid awards held by the member, and see if they have the awards required with the specified logic.

 

I can use a formula and SUBSTITUTE commands to create a query string using the user enter logic - 

 

Award_Type4__r.Qualifications_Awards__c.Name='SLSGB Assessor Update' OR Award_Type4__r.Qualifications_Awards__c.Name='SLSGB IRB Assessor'

 

and I can build this into a full query string. 

 

I have tried putting this into a query, but as I need to query from the parent, I'm struggling to get it to work..

 

I tried this:

 

Member__c[] members = [Select id, (select id from Awards__r  WHERE ((Award_Type4__r.Qualifications_Awards__r.Name='SLSGB Assessor Update' OR Award_Type4__r.Qualifications_Awards__r.Name='SLSGB IRB Assessor') AND Member__c=:memberid)) from Member__c WHERE id=:memberid];

 

but seem to get 1 result each time regardless of the awards held by the Member.

 

I'm not even sure a SOQL is the correct approach - I did consider putting all of the valid awards held by the member into a set, then uses the set.CONTAINS() to see if the required awards existed, but not sure how to apply the logic requirement with this approach.

 

Any ideas ?

 

Many thanks.

 

 

 

 

Our triggers add great new functionality but as of now none are system critial. So for each trigger I have try/catch statements that catch standard exceptions and adds it to a custom built exception log I've created. http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=978\

The problem I've run into is covering the catch code with test coverage.  It seems like a Catch 22. If my test throws an exception it fails, but I somehow need it to throw an exception to cover the catch statement. Even with the catch code not covered we still have 90% code coverage but I'd like to cover as much as possible.

-Thanks
Jason
  • September 05, 2007
  • Like
  • 0