• @login.ax974
  • NEWBIE
  • 25 Points
  • Member since 2011
  • Architect

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 25
    Replies

Hi,

 

We need to provide salesforce for native french speaking users. Now i know we can do translation of all custom labels and picklist fields etc but i am not able to understand how should i go ahead and translate the products in the product2 tables? Do i have to maintain duplicate products in french language?

 

Thanks for any help in advance.

 

Regards.

Folks,

 

Need help in understanding if we can invoke an existing apex class created by consuming an external system WSDL  using outbound messages? So if i create a workflow to send an outbound message to a webservice on the same org and this webservice calls the other apex class that we created by consuming the WSDL, will it work?

 

Thanks for the help.

 

Regards.

Hi,

 

I have a very different sort of problem. Although the Opportunity in my org is has the OWD as Public Read Only, i have users complaining that they are not able to search opportunities created by other users. What could be the probable cause for such an issue? I told them to use Search All and also introduced them with the way Global Search works. But despite all these efforts and they using it functionality in a correct manner such issues are there. Does anybody know what should i do next in order to triage this issue?

 

Thanks so much.

Hi,

I am getting following exception on my configuration sandbox while trying to use sendEmail API to send single email message.

Can you please tell me why and if there is a workaround to this?

SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature.: []

Thanks.

Hello everyone,

 

I have overriden standard opportunity Edit feature. In order to provide inline edit i have to also override the view. The VF page used for the view is very simple and is as below. But now there is a problem. Another VF page which was embeded earlier as part of the opportunity page layout now comes as blank with this overriden view. I guess it is because of the detail tag - how can now i adjust that VF page with this functionality?

 

<apex:page standardcontroller="Opportunity">
    <apex:form >
        <apex:detail subject="{!opportunity.Id}" relatedlist="true" inlineedit="true"/>    </apex:form>
</apex:page>

Hi,

 

I am trying to develope a POC with CTI 4.01 but am not able to see Contracts as an object in my soft phone layout. Is there a reason for it? I have a phone field on the contract and want the system to check that as well for the incoming calls. Can someone please help me know if there is any other configuration to get this done.

 

Thanks so much.

Best Regards. 

Hi All,

 

Can someone please help me with some example - I need to implement typical Q&A - when user clicks on question(hyperlink) he is scrolled down to the answers section. From the answers section he clicks on Top (hyperlink next to that answer) and brought back to the question he clicked on.

 

In HTML we can do it using anchor tab but then the values for the names should be static. But here the questions and answers are taken from an sObject and it can have any number of values.

 

Really appreciate any help.

 

thanks.

Hi,

 

Is it possible to assign a different contextual user to the batch apex than the one who has submitted it? If yes, can someone please provide an example.

 

Thanks much.

Hi,

 I am trying to clone an opportunity with quote and its line items only if the quote is synced. But after the opportunity is created and if i go the new quote of the cloned opportunity it doesn't allows me to start the sync. It still holds the reference of the old opportunity and errors out. Has someone faced this type of situation and know the fix?

Thanks.

Hi,

 

 I am trying to get the content from a VF page and store it as an attachment. So i am doing below:

 

PageReference pg = new PageReference('/apex/myDoc?oppId=' + oppId);

pg.setRedirect(true);

 

Attachment att = new Attachment();

att.Body = pg.getContent(); <--- Here i get java.net.SocketException: Connection reset but it is intermittent and not reproducible.

 

Any idea why is this happening?

 

Thanks for the help!!

 

 

Hi,

 

I am invoking my batch class from a scheduler. In the scheduler i am calling the same batch class twice with different query and parameters one by one like below:-

 

A_Batch batch1 = new A_Batch('B1', query1);
Database.executeBatch(batch1, 200);
            
A_Batch batch2 = new A_Batch('B2', query2);
Database.executeBatch(batch2, 200);

 

Can i assume that my batch2 be called only after batch1 is processed or queue'd?

 

Thanks.

Hi,

 

 Can someone please help me here - i am getting this error 

line 7, column 27: Method does not exist or incorrect signature: accountContractMap.get(String)

 

Map<Id, List<Contract>> accoutContractMap = new Map<Id, List<Contract>>();
//Prepare the map of Account Id as key and the list of contracts associated with it
for(Contract c: [SELECT Id, AccountId, CreatedDate, Status from Contract Limit 100])
{
if(accoutContractMap.get(c.AccountId) != null)
{
System.debug(accountContractMap.get(c.Status));
accountContractMap.get(c.AccountId).add(c);
}
else
{
List<Contract> temp = new List<Contract>();
temp.add(c);
accountContractMap.put(c.AccountId, temp);
}
}
System.debug('Map of account id and the list of contracts is' + accoutContractMap);

 

thanks so much.

Hi,

 

 Is there a way to capture the fileName in the apex:inutFile after choosing the file and default it to the value in the apex:inputField? I am doing below (snippet) but i get the file name as undefined all the time - any idea why or any other better way of doing it?

 

<script>

 function defaultName()

{
   var fileName2 = document.getElementById("thePage:theForm:fileInput");
   var documentName = document.getElementById("thePage:theForm:docName");
   documentName.value = fileName2.value;  ------> I get undefined here?? How do i get the fileName???
   return true;
}

</script>

<apex:inputFile value="{!con}" contentType="{!type}" fileName="{!name}" id="fileInput" onchange="javascript&colon;defaultName()"/>

<apex:inputField value="{!docName}" id="docName"/>

 

thanks so much.

Hi,

 

 I want to ask one very basic question here - suppose my code is like this:

 

Set<Id> stAcctId = new Set<Id>();
for Account a : trigger.new)
{
   if (a.OwnerId != trigger.oldMap.get(a.id).OwnerId)
      {
         stAcctId.add(a.Id);
      }
}

List<Contact> lstContacts = [SELECT Id, Ownership_Changed__c FROM Contact WHERE AccountId IN :stAcctId AND Contact_Type__c = 'New User'];

 

Even if my collection stAcctId is empty, will the SOQL fire? If yes, will it be counted in the total number of SOQL queries?

Is checking before firing the query whether or not the collection is empty a good practise?

 

Thanks.

Hi,

 

Can someone please help me understand how to avoid the below error in the batch:

 

Aggregate query has too many rows for direct assignment, use FOR loop

 

The batch uses the below query:

 

SELECT Id, Type, Potential_Revenue__c, (SELECT Id, Total_Perm_Value__c, CreatedDate, Contract_Type__c, Status, Account_End_Date__c  from Agreements where status != \'Activated\') From Account';

 

And the error comes in at the below line of code:

 

global void execute(Database.BatchableContext BC, List<sObject> scope)
{
for(sobject s : scope)
{
Account a = (Account) s;
custIndicator = 0;
if(a.Agreements != null && a.Agreements.size() > 0) <--------- Error comes here.
{

 

thanks a lot!!

Hi,

 

 Is there a way to capture the fileName in the apex:inutFile after choosing the file and default it to the value in the apex:inputField? I am doing below (snippet) but i get the file name as undefined all the time - any idea why or any other better way of doing it?

 

<script>

 function defaultName()

{
   var fileName2 = document.getElementById("thePage:theForm:fileInput");
   var documentName = document.getElementById("thePage:theForm:docName");
   documentName.value = fileName2.value;  ------> I get undefined here?? How do i get the fileName???
   return true;
}

</script>

<apex:inputFile value="{!con}" contentType="{!type}" fileName="{!name}" id="fileInput" onchange="javascript&colon;defaultName()"/>

<apex:inputField value="{!docName}" id="docName"/>

 

thanks so much.

Is something like this possible? I have 3 objects. 2 are related via lookup. I'd like to compare the value of a field in 2 of the objects (unrelated) and if it matches, pull a field from 1 of those objects to update into a 3rd object (that's also not related to the one I'm getting the data from)

So it would be something like this: 
If Account.field = User.field then set ObjectC.field=User.field2. 
Account and ObjectC are related to each other via a lookup. The user would be unrelated to the account or ObjectC(not an owner, etc). 
 
  • April 22, 2015
  • Like
  • 0
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger VisitTriggers caused an unexpected exception, contact your administrator: VisitTriggers: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0Cf0000007rjNsEAI; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = a0Cf0000007rjNs) is currently in trigger VisitTriggers, therefore it cannot recursively update itself: []: Class.VisitTriggerHandler.OrderRaisedVisitUpdate: line 255, column 1

for this code

 Private void OrderRaisedVisitUpdate(Map<id,Visits__c> visitsMap)
    {
        Id visitid;
        List<Visits__c> visit = visitsMap.values();
         
        //public String visitId;
        //visitId=ApexPages.currentPage().getParameters().get(VisitList);
        //Visits__c visit=[select id,Order_Raised__c from Visits__c where id=:visitid];
        Visits__c vt=[select id,Order_Raised__c from Visits__c where id =: visit[0].id ];
        for(AggregateResult result :[select Visit__c,sum(Total_Amount__c) total from SFDC_Purchase_Order__c where Visit__c =:visit[0].id group by Visit__c]){
            tot=Double.valueOf(result.get('total'));
           }
          vt.Order_Raised__c =tot;
          update vt; // get error this update field
         }

I have create two object for visit and SFDC_supplier_purchase_Order. when purchase order raised in SFDC_supplier_purchase_Order at that time get total amount and add into the visit field purchase order raised. When purchase order rasie, repeatley do this.


 
We have an app that schedules a nightly job to run updates. For some orgs, we keep seeing exceptions like these:

Developer script exception from {company name}. : '<unknown>' : Inactive User, orgId: {orgId} userId: {userId}

Apex script unhandled exception by user/organization: {userId}/{orgId}
 
Failed to process batch for class '<unknown>' for job id '707C000001g2yQT'

I'm not really sure what to do on the develper side to make these go away. Thanks in advance for any tips!
 
I have a record type on the lead object that requires the email field to be hidden. Salesforce does not allow the email field to be hidden on the page layout of the lead object. I cannot use field level permissions to hide this field either, as the email field is used for other integrations. I just need the email to be hidden from users for this record type. I have a visualforce page that has everything I need. How can I have this page displayed when the lead is this particular record type?
Doing Callout ,
Whenever I try to send request to secured Gateway , it ends up giving me this error , Could you please help

Hello everyone,

 

I have overriden standard opportunity Edit feature. In order to provide inline edit i have to also override the view. The VF page used for the view is very simple and is as below. But now there is a problem. Another VF page which was embeded earlier as part of the opportunity page layout now comes as blank with this overriden view. I guess it is because of the detail tag - how can now i adjust that VF page with this functionality?

 

<apex:page standardcontroller="Opportunity">
    <apex:form >
        <apex:detail subject="{!opportunity.Id}" relatedlist="true" inlineedit="true"/>    </apex:form>
</apex:page>

Hi,

 

I am trying to develope a POC with CTI 4.01 but am not able to see Contracts as an object in my soft phone layout. Is there a reason for it? I have a phone field on the contract and want the system to check that as well for the incoming calls. Can someone please help me know if there is any other configuration to get this done.

 

Thanks so much.

Best Regards. 

Hi,

 I am trying to clone an opportunity with quote and its line items only if the quote is synced. But after the opportunity is created and if i go the new quote of the cloned opportunity it doesn't allows me to start the sync. It still holds the reference of the old opportunity and errors out. Has someone faced this type of situation and know the fix?

Thanks.

Hi,

 

 I am trying to get the content from a VF page and store it as an attachment. So i am doing below:

 

PageReference pg = new PageReference('/apex/myDoc?oppId=' + oppId);

pg.setRedirect(true);

 

Attachment att = new Attachment();

att.Body = pg.getContent(); <--- Here i get java.net.SocketException: Connection reset but it is intermittent and not reproducible.

 

Any idea why is this happening?

 

Thanks for the help!!

 

 

Hi,

 

I am invoking my batch class from a scheduler. In the scheduler i am calling the same batch class twice with different query and parameters one by one like below:-

 

A_Batch batch1 = new A_Batch('B1', query1);
Database.executeBatch(batch1, 200);
            
A_Batch batch2 = new A_Batch('B2', query2);
Database.executeBatch(batch2, 200);

 

Can i assume that my batch2 be called only after batch1 is processed or queue'd?

 

Thanks.

Hi,

 

 Can someone please help me here - i am getting this error 

line 7, column 27: Method does not exist or incorrect signature: accountContractMap.get(String)

 

Map<Id, List<Contract>> accoutContractMap = new Map<Id, List<Contract>>();
//Prepare the map of Account Id as key and the list of contracts associated with it
for(Contract c: [SELECT Id, AccountId, CreatedDate, Status from Contract Limit 100])
{
if(accoutContractMap.get(c.AccountId) != null)
{
System.debug(accountContractMap.get(c.Status));
accountContractMap.get(c.AccountId).add(c);
}
else
{
List<Contract> temp = new List<Contract>();
temp.add(c);
accountContractMap.put(c.AccountId, temp);
}
}
System.debug('Map of account id and the list of contracts is' + accoutContractMap);

 

thanks so much.

We have a number of problems with phone number entries, our contacts integrate with another system and we are having failures due to unseen characters being entered into phone numbers... these seem to happen when numbers are copy paste into salesforce.

 

The user cannot see them and is not aware, sometimes this can simply be a leading or trailing 'space'.. I want to add validation that will ensure numbers are added and cannot be saved with these present, Im wondering the best way to do it as there are so many different ways to enter a phone number, is there a REGEX for it? We mainly work on UK numbers but could have to add international. Thanks

Is there a guideline document for SOQL optimization.? How much should I worrry about performance issues due to sub query?

 

Thanks,

Dipu 

 

  • July 29, 2011
  • Like
  • 0

I have these number of records in the database for the following queries:

 

Total Parent__c records = 2800

Total Child__c records  = 77,800

 

On an average, each parent has around 30 childs.

 

When I run the following piece of code, I get a governor limit error (query row). Note that I get retrieving only 10 parent records! I still get this error. I  debug log says that only 177 records out of allowed 10,000 were retrieved.  Seems like there is some issue with Childs__r.size() statement. 

 

 

 

for (Parent__c p: [select Name,
(select Name from Childs__r)
from Parent__c limit 20] {
i++;
System.debug('i is ' + i);
System.debug('Name is ' +p.Name);
Double count =p.Childs__r.size();
System.debug('Child Count is ' + count);


}

 

System Log says:

 

 

12:44:31 ERROR - Evaluation error: System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop

 

Resource usage for namespace: (default)

Number of SOQL queries: 1 out of 100

Number of query rows: 177 out of 10000

Number of SOSL queries: 0 out of 20

Number of DML statements: 0 out of 100

Number of DML rows: 0 out of 10000

Number of script statements: 51 out of 200000 

 

 

When I write a differenr query where I get 1100 Parents, the query ran for 6 minutes and and I loop through every child of it,  I am able to go through 29678 records (i=29678).  The debug log says that that number of query rows is 1267...records...what's going on? 

 

 

for (Parent__c p: [select Name,
(select Name from Childs__r)
from Parent__c limit 1100] {

for (Child__c c:p.Childs__r) {

i++;
System.Debug(‘Child Name is ‘ + c.Name);
}

}

System.debug('i is ' + i);

 

 Debug Log:

 

Resource usage for namespace: (default)

Number of SOQL queries: 1 out of 100

Number of query rows: 1267 out of 10000

Number of SOSL queries: 0 out of 20

Number of DML statements: 0 out of 100

Number of DML rows: 0 out of 10000

Number of script statements: 59362 out of 200000

Maximum heap size: 938 out of 1000000 

 

 

 

 

Message Edited by GoForceGo on 03-02-2009 12:47 PM
Message Edited by GoForceGo on 03-02-2009 12:47 PM
Message Edited by GoForceGo on 03-02-2009 12:48 PM