• Krishna Prasad K P
  • NEWBIE
  • 0 Points
  • Member since 2007
  • Solution/Technical Architect


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 18
    Replies
I have 4 questions on record locking:
  1. Does attaching a file lock the parent record?
  2. I have a Master object record M1 and detail records D1 and D2. When I update D1 and D2, I understand that the M1 gets locked. I have 2 sub questions on it.
    1. I am updating D1 and D2, So the execution order goes through Before update Trigger, actual DML, after update trigger, Workflow field updates etc. So my question is, does M1 get locked from beginning to end till WF field update, or only while the actual update on D1 and D2 into DB (means after BEFORE UPDATE trigger and before AFTER UPDATE trigger)?
    2. Probably related to Q 2.1:  In my AFTER UPDATE trigger context of D1 and D2 update, I wanted to insert one more detail record D3 under the same master M1. Will I get "unable to lock row : M1" error ? 
    3. In my AFTER UPDATE trigger context on child object can I update some field of the master record? 

Guys, I need to open a web based application from Salesforce. I wanted the application to call back to SFDC to get some data. So I was thinking of passing SFDC session ID and server URL as query string parameters to the destination page. Is it safe to expose the Session ID in URL query string parameters? I am curious on whether the query string parameters in the URL be visible over the network even though the end point is an  "https" URL..? Strangely when you right click a code in Eclipse-Force.com-IDE and select "Force.com>>Show in Salesforce web" it automatically opens up SFDC page by passing the session ID in the URL.However I am curious about how secure sending session ID through URL.? Please let me know your thoughts on it.

 

Thanks,

Krishna

We have a functionality where in a particular catogory of people are given explicit access permission on Accounts which obeys certain eligibility criteria, via Apex sharing.

 

Basically we created a public group for those users and we create AccountShare records on those accounts that need to be shared, using a batch Apex job.

 

Now,  the issue is, all the users who belong to higher roles than the above mentioned group of people, also get access on the Accounts.  which we dont need to give. So means we need to restrict the role hierarchy based access for the above scenario where we intended to share it with ONLY a particular catogory of people not thier managers or users on higher roles.

 

Our role structure is well defined and we don't want to change the role hierarchy  or isolate those special group of people from role hierarchy.. So could anybody please suggest a way to tackle this issue and restrict the access for the managers by role hierarchy for this particular scenario... 

 

Thanks in Advance

Krishna.

Hi guys,

 

I had my old FiscalyearSettings with Week Start day as "Saturday"; For testing pupose I created a new Fiscal Year Setting with Monday as Week Start day.   Even though the Week start day is "Monday" (value : 2) in that new Fiscal Year Settings record, the Week type period records have start dates with Saturday as thier week day.  But when I open the Fiscal Book date calender, it DISAPLAYS with Monday as the Week Start day... 

 

So does that mean that..

 

  1. "Week Start Day" on the Fiscal year setting page is just for "showing" the calender with that day as the start of the week and it has nothing to do with the Start date of the week type Period associated to that FY? 
  2. The Start date of the week type "Period" associated to that FY would always be "Saturdays", and is it a system standard ? 
  3. (or does it depend on our custom week start day of the very first FY)? 

 

I am not so clear about the above points, please help me to understand about the FY setting functionality around that... 

 

Thanks in advance,

Krishna

 

Hi,

I have a Account-Contact Console UI setup in my environement. I have a functionality where in I need to redirect the user to this console view with a default account opened. So is there a way to pass the Account Id to the console view so that it opens while loading?

 

Another reqirement is to pass a search string and the console should show the serach result while landing on the console page.

URL to the console : https://tapp0.salesforce.com/ui/desktop/DesktopPage

 

(It seems like the Console window is made completely on Ajax!..)

Anybody have any idea for the 2 requirements stated above...

 

Thanks,

Krishna

 

Experts,

 

We have an integration where in we have the SFDC record GUID stored in that application and also we have the fresh SFDC session id as well in that application. We need to provide the UI functionality by which,  by clicking a link on that Application, a browser should be opened showing the detail page of the particular record . So please help in framing the URL to the SFDC detail page from the below info:

 

 

  1. SFDC Session Id
  2. SFDC Record GUID
> Do I need server URL as well? If yes, can I use generic URLs like "login.salesforce"  for Production and "test.salesforce" for sandbox? (means, without instance prefixes like na5, cs0, tapp0.)

 

 

List out of any other info I must have for this. 

 

Thanks for your help

KP

Hi,

 

I have few s-control and one Apex class where I have hardcoded the 15 char Production org Id in it. Intention for hardcoding the Prod Org Id can be found from the below logic.

 

 

IF (currentOrgId = Environments.PROD_ORG_ID){
    //handle it seriously
ELSE
   //handle it casually ;)

Now the problem is, each time when the sandboxes are refreshed, the Production org id stored in the public static variable PROD_ORG_ID will be overwritten with the org Id of that particular sandbox!!.Why!

 

WHY SFDC overwrites these values in the code ?And that too "without permission"!?

Sandbox org Id is readily available by UserInfo.getOrganizationId() call, then why the variables are updated.

I  couldn't find any document which mention about this Org Id update.

 

Any solution for masking the hardcoded orgId from being overwritten on sandbox refresh? please help me on this

 

Thanks,

Krishna

Hi,
 
I have made a Visualforce page and custom controller for mass adding Sales Team Members for  Opportunities.
I used a newly created list of 5 OpportunityTeamMember records(to be inserted) for iteratively dispalying 5 input sets as in the standard Add Sales Team Page.
 
I wish to have a validation rule which, when the "Save" button is clicked, should add an error message near the TeamRole field of the if it is null.
I tried by the code

Code:
<apex:pageBlockTable value="{!OpportunityTeamMemberList}" var="TeamMember">
..........................
<apex:column headerValue="Team Role">                                           
   <apex:inputField id="inputTeamRole" value="{!TeamMember.TeamMemberRole}" />
</apex:column>
............................
 </apex:pageBlockTable>

 
Code:
if(MyTeamMemberList[index].TeamMemberRole==null)
  
  {     
        
        MyTeamMemberList[index].TeamMemberRole.addError('You must enter a value'); 
        .........       
  }


Problem with this code is that, if the user skips the TeamRole for the second or third input row, the message shows near the Team Role input field in the FIRST input row.
 
How can I add an Error message near theTeam Role inputField of the REQUIRED input row?
Can I use ApexPages.addMessage to input component of the SPECIFIC input row?
 
Thanks in advance
Krishna
Hi All,
I have a trigger on Opportunity with "before Insert and Before Update"   trigger_events.
The code snippet is given below.

for(Opportunity myOpp : trigger.new)
           {
                  if((Trigger.isUpdate)&&(someother condition))
                            //statements_1
                else if(Trigger.isInsert)
                            //statements_2                                            
          }

In most of the cases,Opportunities are inserted/updated in Bulk using Apex DataLoader.    
  1. If I use UPSERT opertion using DataLoader, will that cause my records to escape from both the IF statements  ??  
  2. Does each record has seperate value for "Trigger.isUpdate" and "Trigger.isInsert" implicit variables??
  3. While UPSERTing using DataLoader, if my first set of values causes an UPDATE and the second causes an INSERT, what would be the values of  Trigger.isUpdate and Trigger.isInsert ??
Please help me to clarify these doubts..

Thanks in Advance,
Krishna
Hi all,
I would like to automate the attachment of files(to opportunites) in SF.
since I have almost  300 files to be attached to different opportunities on a monthly basis.
  • The files(in zip format) are residing my client system(PC).
  • I need to attach these files to required opportunities.
Kindly share your ideas, suggestions and code snippets on this.
 
Thanks in advance,
Krishna
 
Hi All,
I have a before insert trigger on opportunity.
I have a new requirement :
       When user clones an opportunity I need to get some field values from the parent opp, and after some calculation on these values, the result has to be set  to a field in the opportunity being inserted. Also some fields have to be copied from the parent opp to the new child opp.
       Problem is that, almost all these fields are not in the layout. So clonning doesnt copy those fields to the child opp. So these fields have to be queried  from the parent opp using SOQL. 
 
       Inserting parent opp ID into any of the input field on edit mode is not preferred!!(like  https://na9.salesforce.com/<parentID>/e?clone=1&retURL=<retURL>&<fieldname>=<parentID>)
 
 
***  How can I get the ID of the parent opportunity in the trigger ??????  ****
 
Kindly provide me a solution..
Thanks in advance,
Krishna
Hi,

I have a 'before insert trigger' on Opportunity. The trigger contains an SOQL select query which returns(may or may not) one record and assigns to an Opportunity variable.
The query statement is:
"Opportunity Opp_variable = [SELECT id,Counter__c,AccountId FROM Opportunity where (AccountId=:New_record.AccountId AND Counter__c!=null) ORDER BY Counter__c DESC LIMIT 1];"

After this statement I have "if(Opp_variable!=NULL)..statements",
But I get the Error message:
"System.QueryException: List has no rows for assignment to SObject"
This is caused because there is no record satisfying my query conditions.. But it should have returned NULL.. ?

Why Am I getting this error..!! SOQL query cannot return null value??

How can I sove this issue..? Please help me

Thanks in Advance..
Krishna
Hi all,

Can we have a field which is invisible in edit mode and visible in detail-page(view) mode?

If yes,I could safely populate automated values which is calculated based on user inputs(input form contains related check boxes and fields require lot of validation) using s-control  and   save that object without the  fear of user intervention on that field.

Please provide me a solution....

Thanks in advance,
Krishna
I recently started using the AJAX  'Explorer' for querying the SObjects.
But I do not get the result for "SELECT count() FROM <SObject>" statement !!.
I tried it for almost all my SObjects. But the output window shows nothing !!
 
Please provide  me a solution,
Thanks in advance
Krishna
Unable to install the Apex Toll kit for my Eclipse Version: 3.3.1
 
I did it as per the step by step procedure provided in the salesforce ADN page on eclipse toolkit..
But I get the following error message:
 
"Network connection problems encountered during search.
  Unable to access "
http://www.adnsandbox.com/eclipsetoolkit/10.0/".
    Error parsing site stream. [Premature end of file.]
    Premature end of file."
    
 
Also I get a message:
 
"No features found on the selected sites. choose a different site or site catogory"
 
Could you please provide me a solution....
Thanks in advance,
Krishna
 
 
 

Guys, I need to open a web based application from Salesforce. I wanted the application to call back to SFDC to get some data. So I was thinking of passing SFDC session ID and server URL as query string parameters to the destination page. Is it safe to expose the Session ID in URL query string parameters? I am curious on whether the query string parameters in the URL be visible over the network even though the end point is an  "https" URL..? Strangely when you right click a code in Eclipse-Force.com-IDE and select "Force.com>>Show in Salesforce web" it automatically opens up SFDC page by passing the session ID in the URL.However I am curious about how secure sending session ID through URL.? Please let me know your thoughts on it.

 

Thanks,

Krishna

Experts,

 

We have an integration where in we have the SFDC record GUID stored in that application and also we have the fresh SFDC session id as well in that application. We need to provide the UI functionality by which,  by clicking a link on that Application, a browser should be opened showing the detail page of the particular record . So please help in framing the URL to the SFDC detail page from the below info:

 

 

  1. SFDC Session Id
  2. SFDC Record GUID
> Do I need server URL as well? If yes, can I use generic URLs like "login.salesforce"  for Production and "test.salesforce" for sandbox? (means, without instance prefixes like na5, cs0, tapp0.)

 

 

List out of any other info I must have for this. 

 

Thanks for your help

KP

I have written the following code and I am getting the error  "You have uncommitted work pending. Please commit or rollback before calling out". I am new to salesforce, so am unable to understand what the error is for. Kindly help

 

 

authSuccessBool=false;
        String token = ApexPages.currentPage().getParameters().get('oauth_token');
        System.debug('CompleteAuth Token===================================='+ApexPages.currentPage().getParameters().get('oauth_token'));
        if(token!=null)
        {
            String verifier = ApexPages.currentPage().getParameters().get('oauth_verifier');
            System.debug('CompleteAuth Verifier================================================='+ApexPages.currentPage().getParameters().get('oauth_verifier'));
            OAuth oa = new OAuth();
            authSuccess = oa.completeAuthorization(token,verifier);
              
            if(authSuccess!=null||authSuccess!=' ')
            {
                authSuccessBool=true;
            }
            this.message = oa.message;
        }
        else {
            message = 'Invalid request. Missing parameter oauth_token';
        }
        
        
         //--------------------------------------------------------
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            HttpResponse  res = new HttpResponse();
            String endpoint='https://docs.google.com/feeds/download/documents/Export?id=1ok94msdl7FDfo51R9cCSVqdRY6yRVO16byfv-GpvDOs&exportFormat=html';
            req.setMethod('GET');
            req.setEndpoint(endpoint);
            res=h.send(req);
            System.debug('====================='+res.getBody());
         //--------------------------------------------------------
        
        return null;
    }

I am trying to invoke system.schedule method. The first parameter is name of the schedule, second is the schedule string and third is the instance of the apex class that implements Schedulable interface.

 

The schedule string is the following

 

'58 0 20 12 5 ? 2010'

 

I get an exception saying System.Exception: trigger must be associated with a job detail

 

Has anyone encountered this exception before? Any idea where i could be missing? Any help would be appreciated.

 

3:0:57.407|METHOD_ENTRY|[109,32]|system.schedule(String, String, scheduleActiveQChecker)
3:0:57.450|EXCEPTION_THROWN|[109,32]|System.Exception: trigger must be associated with a job detail
3:0:57.450|METHOD_EXIT|[109,32]|schedule(String, String, APEX_OBJECT)

Is there any way to change or delete a Scheduled Job ?  I am able to create one easily enough, but once it is made I can only look at the values in the CronTrigger object, but not update them.  Also, it seems I cannot delete them.  I also looked at the System.AbortJob method, but that seems to only stop a job that is already running - I get an error if I try it on a Queued job.

 

The reason I am doing this is to try to create a 'sliding' job.  So, when a trigger is fired the job will run in 5 minutes.  But if the trigger is fired again before that 5 minutes is up, it will find the old job and either delete it and make a new one for 5 minutes out, or update the old one so the next scheduled time is in 5 minutes.

 

Any ideas are welcome!

 

Jason

 

 

I am building a workflow that will send out an email everytime an Account is created.  I would like the email template to include a link to the newly created account record although I do not see if this is possible.  Has anybody done anything like this?
Hi,
 
I have made a Visualforce page and custom controller for mass adding Sales Team Members for  Opportunities.
I used a newly created list of 5 OpportunityTeamMember records(to be inserted) for iteratively dispalying 5 input sets as in the standard Add Sales Team Page.
 
I wish to have a validation rule which, when the "Save" button is clicked, should add an error message near the TeamRole field of the if it is null.
I tried by the code

Code:
<apex:pageBlockTable value="{!OpportunityTeamMemberList}" var="TeamMember">
..........................
<apex:column headerValue="Team Role">                                           
   <apex:inputField id="inputTeamRole" value="{!TeamMember.TeamMemberRole}" />
</apex:column>
............................
 </apex:pageBlockTable>

 
Code:
if(MyTeamMemberList[index].TeamMemberRole==null)
  
  {     
        
        MyTeamMemberList[index].TeamMemberRole.addError('You must enter a value'); 
        .........       
  }


Problem with this code is that, if the user skips the TeamRole for the second or third input row, the message shows near the Team Role input field in the FIRST input row.
 
How can I add an Error message near theTeam Role inputField of the REQUIRED input row?
Can I use ApexPages.addMessage to input component of the SPECIFIC input row?
 
Thanks in advance
Krishna
Is there a way to have the Data Loader (9.0) export records that have been marked for deletion (moved to the recycle bin)?
I am currently an administrator for an Enterprise Edition salesforce instance.  I am excited about the possibilities with VisualForce, however, from what I have read you can only use VisualForce inside a developer account?
 
Is this the case, or can you create the VisualForce pages inside a developer account & then move them over to your live instance?
 
If not, then what is everyone doing working with VisualForce - getting ready for the release?  Is a general availability scheduled?
Hi,

I have a 'before insert trigger' on Opportunity. The trigger contains an SOQL select query which returns(may or may not) one record and assigns to an Opportunity variable.
The query statement is:
"Opportunity Opp_variable = [SELECT id,Counter__c,AccountId FROM Opportunity where (AccountId=:New_record.AccountId AND Counter__c!=null) ORDER BY Counter__c DESC LIMIT 1];"

After this statement I have "if(Opp_variable!=NULL)..statements",
But I get the Error message:
"System.QueryException: List has no rows for assignment to SObject"
This is caused because there is no record satisfying my query conditions.. But it should have returned NULL.. ?

Why Am I getting this error..!! SOQL query cannot return null value??

How can I sove this issue..? Please help me

Thanks in Advance..
Krishna
Hi all,

Can we have a field which is invisible in edit mode and visible in detail-page(view) mode?

If yes,I could safely populate automated values which is calculated based on user inputs(input form contains related check boxes and fields require lot of validation) using s-control  and   save that object without the  fear of user intervention on that field.

Please provide me a solution....

Thanks in advance,
Krishna
I recently started using the AJAX  'Explorer' for querying the SObjects.
But I do not get the result for "SELECT count() FROM <SObject>" statement !!.
I tried it for almost all my SObjects. But the output window shows nothing !!
 
Please provide  me a solution,
Thanks in advance
Krishna
Hi,
 
I have an Scontrol which is written to populate a custom field on my Contacts object page.The requirement is that whenever a contact is associated to an account(by using the look up help),my Scontrol should be triggered to populate the custom field.
Can anyone provide me some guidelines ?
 
Thanks & Regards,
VN
  • October 15, 2007
  • Like
  • 0
Unable to install the Apex Toll kit for my Eclipse Version: 3.3.1
 
I did it as per the step by step procedure provided in the salesforce ADN page on eclipse toolkit..
But I get the following error message:
 
"Network connection problems encountered during search.
  Unable to access "
http://www.adnsandbox.com/eclipsetoolkit/10.0/".
    Error parsing site stream. [Premature end of file.]
    Premature end of file."
    
 
Also I get a message:
 
"No features found on the selected sites. choose a different site or site catogory"
 
Could you please provide me a solution....
Thanks in advance,
Krishna
 
 
 
I'm trying to get Visualforce enabled in my develop edition account.  I'm not clear on who to contact to request this, so I'm posting it here.  Sorry if this should be a direct-to-salesforce-email, but I imagine others are wondering the same thing.

The Force cookbook states:

Note:  As of September 2007, Visualforce is available as a Developer Preview only.

The product/functionality matrix on p.30 of the cookbook shows the "Visualforce Developer Preview" as being available to Developer Edition accounts.

I'm writing this post because it's not available in my dev. edition account, and I'm unsure how to get it enabled.   Neither the Setup > Build > Pages nor Setup > My Personal Information > Personal Information > Developer Mode options are available to me, so I assume it's the org itself that needs enabling.

Do I have to sign up for a new developer edition account?  That would be somewhat painful, as I have a fair amount of custom objects & Apex Code in my current dev. edition account that I want to use with Visualforce.
  • September 18, 2007
  • Like
  • 0
Hi,
 
We are exploring the possibility of connecting to salesforce.com database from Microstrategy.
Can Microstrategy connect to salesforce.com database and query from SFDC objects? Will SOQL be an issue here?
 
Thanks and regards,
Ambili
 
 
  • April 26, 2007
  • Like
  • 0