• scriptagent
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 12
    Replies

Good morning,

 

I should check a 100000USD amount limit. If the currency is USD it's not a big deal, but what can I do, if the amount currency is e.g Euro or GBP and I have only the 100000 USD limit.

 

I found a convert function which converts an amount in the currency of the current user, but that's not helpful in this case.

 

I hope someone knows an alternative! Thank you very much in advance, Peter

Good morning,
 
I wrote a testMethod, in which I use a runAs user, like:
Code:
                Profile pr2 = [select id from profile where name='Standard User'];
                User u = new User(Manager=OTHERTESTUSER,alias = 'standt', email='standarduser@testorg.com',emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',localesidkey='en_US', profileid = pr2.Id,timezonesidkey='America/Los_Angeles', username='standarduser@testorg.com');

                System.runAs(u)
                {...}

 
I want to set an other TestUser as the Manager of RunAs User....is that possible ?
 
I have attempted to create and insert a new User before the System.runAs statement, but that works somehow not..hmm.
 
Thanks a lot in advance for help!
Peter
Hi,
I'm trying to write a testMethod for the select statement below.
 
Code:
ProcessInstanceWorkitem[] prInstWItem = [select Id from ProcessInstanceWorkitem where Id=:id_tmp]

 But when I try this:
 
Code:
ProcessInstanceWorkitem pIw = new ProcessInstanceWorkitem();
insert pIw;
ProcessInstanceWorkitem[] pIwQuery = [select Id from ProcessInstanceWorkitem where Id=: pIw.Id];
pIwId = pIwQuery[0].Id;

 I can compile the code, but then I get an error at the testRun, called:
MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object

 

What can I do to fix this problem ? Thank you very much in advance for any suggestion!

Peter

 
Good morning,
 
I'm a bit confused right now:
 
Code:
Id idt = '04iR00000008W50';
ProcessInstanceWorkitem[] prInstWItem = [select Id from ProcessInstanceWorkitem where Id=:idt];
//when I display prInstWItem[0].Id, I get '04iR00000008W50PIA' Id idt2 = '04iR00000008W50PIA'; ProcessInstanceWorkitem[] prInstWItem2 = [select Id from ProcessInstanceWorkitem where Id=:idt2]; //when I display prInstWItem2[0].Id, I get '04iR00000008W50PIA'

 
Why have these two requests the same result?
 
Thx for help! Peter
 
 

 

 


 
Hi,
 
is it possible to get the targetObjectId with only an email_id ?
 
Or in general, is the email_id of a 'submit for approval email' in some way connected with the targetObject ?
 
Thank you very much in advance!
Peter 
Hi guys,
 
I'm trying to reassign an approval request with an apex code.
So for example, after a click on the "Submit for approval"- button, I want to change the approver,
but only for the current Quote. 
 
I guess, maybe I should use the ProcessSubmitRequest() method, but unfortunately I haven't a real idea right now.
 
Hope someone can help, thank you very much in advance!
Peter
Good morning @ all,

yesterday I have created a new Report Type. The primary object has 2 related objects.

The report runs successful, but:

Is it possible to export/store these records in a custom object and not only to export as .xls/.csv file ?
Or is it necessary that I write my own SQL query with Apex/S-control...? After I have stored these data, I want to make some calculations in a s-control....


Thank you very much in advance!
Cheers, Peter

Is there a way to read some values from a database and to generate a graphic diagram ?
I want to code a function, when a user goes over a link, the user gets information....like:
 
<- try a mouseover over the image 'smart people', you will see information and average (stars)...
 
 
Thank you very much!
 
Hi @ all,
 
I want to display a empty input field on a visual page. The customer should be able to enter a number in this input field.
After clicking the "save button", the number should be saved.
 
I found a example for a standart controller, but I need a custom controller for my own custom object.
How can I realize this ?
 
Thank you very much!
pete
 
 
I want to create relationships between some fields. Normally a simply Lookup would be enough and I know a Lookup(where you choose a data set from a popuplist) is possible in Salesforce, but I want an automatic Lookup, for example if UserX == profile_HighManager then 80%...elseif UserX == profile_NormalManager == 60% ........ or if UserX choice productA  then discount 20%
Is there a way to develop such a thing without programming or will be Apex necessary ?
I want to call fields from two different tables.
 
Thank you very much! 
Peter
Hi !
 
I try to connect two tables, which are based on Salesforces.com .
Now I need relationships between some fields. Normally a simply Lookup would be enough and I know a Lookup(where you choose a data set from a popuplist) is possible in Salesforce, but I want an automatic Lookup, for example if UserX == profile_HighManager then 80%...elseif UserX == profile_NormalManager == 60% ........ or if UserX choice productA  then discount 20%
It is only a simple example I have to connect a big pricelist with a decide matrix......is there a way to develop such a thing without programming or will be Apex necessary ?
 
Thank you very much! 
Hi,
 
I have already created a custom object, which has a price field.
Now I want to include a logic, which checks what profile the currently user has and depending on the profile, the price-edit-rule dynamically allocates.  
 
Is there a way to develop such a thing with Salesforce options ? Or do I have to use my own database requests and pages ?
 
Thank you very much! Peter
Hi,
 
I try to develop a trigger, which displays, if(customObject.newValue < customObject.oldValue), a popup (javascript) or a text warning . The customer should be able to change the newValue or to ignore the warning. 
Unfortunately I don't have the right idea, how I can develop this or I don't know how I can call a javascript code in a Apex trigger.
 
I'm open for other suggestions or solution ideas too.
 
Hope you are able to help!
Thanks a lot! Peter


Message Edited by scriptagent on 10-02-2008 07:14 AM
Good morning,
 
I wrote a testMethod, in which I use a runAs user, like:
Code:
                Profile pr2 = [select id from profile where name='Standard User'];
                User u = new User(Manager=OTHERTESTUSER,alias = 'standt', email='standarduser@testorg.com',emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',localesidkey='en_US', profileid = pr2.Id,timezonesidkey='America/Los_Angeles', username='standarduser@testorg.com');

                System.runAs(u)
                {...}

 
I want to set an other TestUser as the Manager of RunAs User....is that possible ?
 
I have attempted to create and insert a new User before the System.runAs statement, but that works somehow not..hmm.
 
Thanks a lot in advance for help!
Peter
Hi,
I'm trying to write a testMethod for the select statement below.
 
Code:
ProcessInstanceWorkitem[] prInstWItem = [select Id from ProcessInstanceWorkitem where Id=:id_tmp]

 But when I try this:
 
Code:
ProcessInstanceWorkitem pIw = new ProcessInstanceWorkitem();
insert pIw;
ProcessInstanceWorkitem[] pIwQuery = [select Id from ProcessInstanceWorkitem where Id=: pIw.Id];
pIwId = pIwQuery[0].Id;

 I can compile the code, but then I get an error at the testRun, called:
MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object

 

What can I do to fix this problem ? Thank you very much in advance for any suggestion!

Peter

 
Hi all,

I am not very familiar with SOQL yet. I want a query that returns the Maximum value for an autonumber field on a custom object. On ANSI SQL I would use MAX but it doesn´t seem to be available in SOQL. I can see that the below statement provides me with the result I want but not sure if it is optimal (it doesn´t look great):

SELECT Name FROM X__c ORDER BY Name DESC LIMIT 1

Any suggestions?

Thanks,

J
  • January 12, 2009
  • Like
  • 0
Good morning,
 
I'm a bit confused right now:
 
Code:
Id idt = '04iR00000008W50';
ProcessInstanceWorkitem[] prInstWItem = [select Id from ProcessInstanceWorkitem where Id=:idt];
//when I display prInstWItem[0].Id, I get '04iR00000008W50PIA' Id idt2 = '04iR00000008W50PIA'; ProcessInstanceWorkitem[] prInstWItem2 = [select Id from ProcessInstanceWorkitem where Id=:idt2]; //when I display prInstWItem2[0].Id, I get '04iR00000008W50PIA'

 
Why have these two requests the same result?
 
Thx for help! Peter
 
 

 

 


 
Hi guys,
 
I'm trying to reassign an approval request with an apex code.
So for example, after a click on the "Submit for approval"- button, I want to change the approver,
but only for the current Quote. 
 
I guess, maybe I should use the ProcessSubmitRequest() method, but unfortunately I haven't a real idea right now.
 
Hope someone can help, thank you very much in advance!
Peter
Good morning @ all,

yesterday I have created a new Report Type. The primary object has 2 related objects.

The report runs successful, but:

Is it possible to export/store these records in a custom object and not only to export as .xls/.csv file ?
Or is it necessary that I write my own SQL query with Apex/S-control...? After I have stored these data, I want to make some calculations in a s-control....


Thank you very much in advance!
Cheers, Peter

Hi @ all,
 
I want to display a empty input field on a visual page. The customer should be able to enter a number in this input field.
After clicking the "save button", the number should be saved.
 
I found a example for a standart controller, but I need a custom controller for my own custom object.
How can I realize this ?
 
Thank you very much!
pete
 
 
I want to create relationships between some fields. Normally a simply Lookup would be enough and I know a Lookup(where you choose a data set from a popuplist) is possible in Salesforce, but I want an automatic Lookup, for example if UserX == profile_HighManager then 80%...elseif UserX == profile_NormalManager == 60% ........ or if UserX choice productA  then discount 20%
Is there a way to develop such a thing without programming or will be Apex necessary ?
I want to call fields from two different tables.
 
Thank you very much! 
Peter
Hi !
 
I try to connect two tables, which are based on Salesforces.com .
Now I need relationships between some fields. Normally a simply Lookup would be enough and I know a Lookup(where you choose a data set from a popuplist) is possible in Salesforce, but I want an automatic Lookup, for example if UserX == profile_HighManager then 80%...elseif UserX == profile_NormalManager == 60% ........ or if UserX choice productA  then discount 20%
It is only a simple example I have to connect a big pricelist with a decide matrix......is there a way to develop such a thing without programming or will be Apex necessary ?
 
Thank you very much! 
Hi,
 
I try to develop a trigger, which displays, if(customObject.newValue < customObject.oldValue), a popup (javascript) or a text warning . The customer should be able to change the newValue or to ignore the warning. 
Unfortunately I don't have the right idea, how I can develop this or I don't know how I can call a javascript code in a Apex trigger.
 
I'm open for other suggestions or solution ideas too.
 
Hope you are able to help!
Thanks a lot! Peter


Message Edited by scriptagent on 10-02-2008 07:14 AM