• gv
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 41
    Questions
  • 64
    Replies

Hi,

 

I have a question about deploying config changes to production. Since my companys implementation is medium sized, we manually(I know tiring) move the config changes(custom object,fields,etc) from sandbox to production.

 

If I were to work in a big company what would be the best way to move config changes from sandbox to production

 

Thanks

 

  • October 08, 2010
  • Like
  • 0

Hi

I am going to have a link in my visualforce page 'A'. It willbe called from multiple places(for ex. from 4 other pages) .

 

So if I have a link called back in 'A' how would I code so that it takes me to the correct place from where it was called.

 

Thanks

  • September 03, 2010
  • Like
  • 0

 

Not sure what would be the best way to achieve this.

 

There is a custom button in account object. When clicked on that fields of a new custom object is displayed.

The page layout should match standard saleforce layout.

 

One of the field displayed on the new page is dependant on few fields on the account object.

 

How do I do this. I was thinking I would call a Visual force page from the custom button. Is that a good idea?

 

 

  • May 08, 2010
  • Like
  • 0

 

I have a SOQL query like the following
Select a.id,a.name,a.lastmodifiedby,(select id from related_accounts__r where main_account__c = '') from account where a.id = ''
Basically teh related_accounts__r is a child relationship for the account object.
I am not sure how would I access the inner id in my code?
I think I have done this in the past but don't remember how?
Thanks


I have a SOQL query like the following
Select a.id,a.name,a.lastmodifiedby,(select id from related_accounts__r where main_account__c = '') from account where a.id = ''
Basically teh related_accounts__r is a child relationship for the account object.
I am not sure how would I access the inner id in my code?
I think I have done this in the past but don't remember how?
Thanks

 

  • May 04, 2010
  • Like
  • 0

Hi

 

I am confused with the following scenario

 

I am trying to develop a VF page that would be called from a standard object. The VF page itself would be for a custom object

 

So I have a button from which the new VF Page needs to be called. The new VF page layout should match that of salesforce standard layout.

 

What type of controller should I used for the above. I am new to the salesforce world so pardon my very basic question.

 

Thanks for taking a look at this.

  • May 04, 2010
  • Like
  • 0

My requirement is as follows

 

There will be a button in Account object and when the user clicks on the link a new screen(page) is opened based on a few field values in the account object.

 

The new page is for a different object(basically different record types  based on the field values in account object)

 

Should I call a VF page from the button click on the account page to display different values?

 

TIA

  • May 04, 2010
  • Like
  • 0

Hi

 

I am constructing a search page with where condition and order by condition.  I have 5 conditions which are selected from the page and for the 6 condition, I always select 'Active' as the value.

 

For example :

 

if queryStr contains the query to be executed, this is how its going to be

 

queryStr= 'Select id, name from products where'

If(other == true)

queryStr+= 'or product_type <> null' etc with other conditions

 

but the last condition I want is status needs to be active(which is a text data type)

 

so I tried,

 

queryStr+=  'and status = 'Active''';

 

obviously this is not working and I can't figure out a way to do this. I tried assigning Active to a variable and use that in the string but that does not work either.

 

Pls. help . this is a production issue and I would have to add the active condition so search returns correct value.

 

I have very limited experience in VF, so this very basic question

 

Thanks 

 

  • March 16, 2010
  • Like
  • 0
Hi,

I am new to Visual force so this question may seem way too obvious. I have a Search page and I would like to write the SOQL to the screen to see how it is constructed. Not sure how to do it.

This is a customer portal page so that user (whom I logged in as) is not available in the debug logs user list.

I just want to write the SOQL after it is constructed.

For ex: I have this soqlQuery = 'Select id,name from products'

the above is a very basic example but how do I write to this to the screen so I can look at how the soql query with all the search conditions and order by conditions is constructed

Thanks
  • March 16, 2010
  • Like
  • 0

Hi,

 

A user uploads a excel file and parsing is done to populate certain fields. All these work well except the following

 

The excel has an account column and when parsing SOQL is generated based on the account name

 

for ex: Select id,name,account_type__c from account where name in ('test account')

 

Now, I would like to add the following condition to the where clause. Get the account with that particular account name and also a particular account type say type 1 like below

 

for ex: Select id,name,account_type__c from account where name in ('test account') and account_type__c in 'Type 1'

 

But the problem is there are few accounts which are of more than 1 types like 'Type 1; Type 2' etc.(basically its a multi select picklist)

 

How  would I get that account in my result

 

Pls. let me know if its not clear

 

Thanks

 

 

 

  • March 01, 2010
  • Like
  • 0
F

Hi,

 

When I try to modify a field in an object I get this error(which is actually in a trigger).

 

 Update failed. First exception on row 0 with id; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, : execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 2 with id; first error: FIELD_INTEGRITY_EXCEPTION, Value does not exist or does not match filter criteria. Click icon to select a value.: [] 

 

Pls. let me know how to solve this issue and also if you need more details

 

Message Edited by gv on 02-18-2010 08:42 AM
  • February 17, 2010
  • Like
  • 0

Hi,

 

I have a Sites website with two subsites. If the user navigates to the root, they receive an under construction error. 

 

 Say if my sites address is this: companyname.force.com/abc and i have one more subsite as companyname.force.com/def

 

If I type in the root, (companyname.force.com/) it gives me the following error

 

http://companyname.force.com/def/ is under construction

 

How to get rid of this. One suggestion is to build a VF page  which would get displayed at the root and have abc and def as two links

 

Pls. let me know what is a better option? 

  • January 23, 2010
  • Like
  • 0

I have the following scenario:

 

In a after update trigger, I need to find out if 2/3 fields are getting updated(basically getting new values)

only then proceed with trigger. It seems really simple, but I am not very sure how to go about it

 

Thanks 

  • November 19, 2009
  • Like
  • 0

Hi,

 

I have a general logic question that I am trying to use in my trigger. Seems simple but am stuck

 

I have a product and its got orders as a related list. There can be multiple orders but only the recent one can be made as active. All fine. But the problem is if there are multiple order at the same time two orders are marked as active. I want only one order to be active. 

 

Here is my logic now.

 

I take the order in the trigger.new and make it as active. I go theorugh the previous orders for that product and make everything inactive. In this process only the latest one will be active

 

But if there are 2 orders at the same time for the product , there are 2 active ones.  How would I solve that issue

 

this is a production issue

 

Thanks in advance

 

 

Set<Id> productIds = new Set<Id> (); for (Product_orders__c prod:Trigger.New){ if (prod.product__c!=null){ prod.active__c = true; productIds.add(prod.product__c);} } //this loop is to make the current one always active List<Product_orders__c> updateOrders = new List<Product_orders__c>(); // this list is to hold the orders that are to be updated List<Product_orders__c> OrdersList = ([Select e.product__c, e.Name,active__c from Product_orders__c e where e.product__r.Id in :productIds //the orderslist is to get the list of all the other orders and make them inactive so the previous active one will be inactive now ]); for(Product_orders__c ord : OrderList){ if (ord.active__c == true){ ord.active__c = false; updateShipments.add(ord); } }//for loop if (updateOrders .size() > 0) update updateOrders ; }

 


 

  • October 04, 2009
  • Like
  • 0

Hi,

 

I have a 2 text  fields which accepts numbers. I need to validate to make sure it does not anything other than the following:

 

1. 0-9

2. +,-

3 .(period)

 

Basically validate for a float value. I checked in the help topics. could not find any function. How or which function should I ue

 

Thanks in Advance

 

  • September 18, 2009
  • Like
  • 0

I have the following function call :

 

List<Contract__c> lstContracts = QueryContractRequests(); 

 

The QueryContractRequests is defined as:

 

private List<contract__c> QueryContractRequests(){

 

 return[select contract_id__c,contract_name__c,contract_class__c

    from contract__c

    where status__c = 'New'

and opportunity__c =  :this.currentOpportunity.Id

 

 

I kept getting the 'Attempt to de-reference a null object ' error in the line 'and opportunity__c =  :this.currentOpportunity.Id'.

So I thought checking for null before returning the value would be a better option and changed the method as below

 

private List<contract__c> QueryContractRequests(){

 

 

id opportunityid;

   opportunityid = this.currentOpportunity.Id;

    

   if (opportunityid <> null){ 

 return[select contract_id__c,contract_name__c,contract_class__c

    from contract__c

    where status__c = 'New'

and opportunity__c =  :this.currentOpportunity.Id

 

}} 

 

But now I keep getting the ''Non-Void method might not return a value' error in this line 'if (opportunityid <> null){ '

 

Where am I going wrong?

 

Thanks in Advance

 

  • September 18, 2009
  • Like
  • 0

our salesforce admin added a validation rule on opportunity object and because of which previously working test methods started failing. The validation rule checks if the account has HeadQuarters and its defined as

 

ISNULL( HQ_Account_Region__c)

 

 

When I am trying to move my trigger changes (on a different object), triggers related to opportunity fail because of the above validation rule.

 

here is the test method. can anyone say whats missing here. I have tried adding a HQ_ACCount_region but its a read only field, so I cannot assing any values to it.

 

 

pls.let me know where I am going wrong or how to avoid the error

 

 

testOpportunitySalesGoalSyncTime.testMethodOpportunitySalesGoal System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The account is missing primary billing address so this opportunity will not be routed properly.  To fix it, please go to the account record and add a primary billing address.: [AccountId]

 

This is the error message the above validatio rulehas

 

The account is missing primary billing address so this opportunity will not be routed properly.  To fix it, please go to the account record and add a primary billing address.: [AccountId]

 

Let me know if you have more questions in order to fix this issue

Download Apex
public class testOpportunitySalesGoalSyncTime {

public static testmethod void testMethodOpportunitySalesGoal() {

/* 09/03/08 changed test to create 4 unique Opportunity_Sales_Goal records */

Account acct = createAccount();

Opportunity newOpportunity1 = createOpportunity(acct);
Opportunity newOpportunity2 = createOpportunity(acct);
Opportunity newOpportunity3 = createOpportunity(acct);
Opportunity newOpportunity4 = createOpportunity(acct);

String salesGoalId1 = getSalesGoalId();
String salesGoalId2 = getSalesGoalId();
String salesGoalId3 = getSalesGoalId();
String salesGoalId4 = getSalesGoalId();

createOpportunitySaleGoal(newOpportunity1,salesGoalId1);
createOpportunitySaleGoal(newOpportunity2,salesGoalId2);
createOpportunitySaleGoal(newOpportunity3,salesGoalId3);
createOpportunitySaleGoal(newOpportunity4,salesGoalId4);

newOpportunity1.Name = 'AAA';
update newOpportunity1;

newOpportunity2.Name = 'BBB';
update newOpportunity2;

newOpportunity3.Name = 'CCC';
update newOpportunity3;

newOpportunity4.Name = 'DDD';
update newOpportunity4;


DateTime currentTime = System.now();
for(Opportunity_Sales_Goal__c opportunitySalesGoal:[Select Id,Last_Sync_To_Parent__c from
Opportunity_Sales_Goal__c where Opportunity__c = :newOpportunity1.Id
or Opportunity__c = :newOpportunity2.Id
or Opportunity__c = :newOpportunity3.Id
or Opportunity__c = :newOpportunity4.Id]) {
System.assertEquals(opportunitySalesGoal.Last_Sync_To_Parent__c.day(),currentTime.day());
System.assertEquals(opportunitySalesGoal.Last_Sync_To_Parent__c.month(),currentTime.month());
System.assertEquals(opportunitySalesGoal.Last_Sync_To_Parent__c.year(),currentTime.year());
System.assertEquals(opportunitySalesGoal.Last_Sync_To_Parent__c.hour(),currentTime.hour());
System.assertEquals(opportunitySalesGoal.Last_Sync_To_Parent__c.minute(),currentTime.minute());
}


}

private static void createOpportunitySaleGoal(Opportunity newOpportunity, String salesGoalId){

//for(Integer i=0; i<4 ; i++){
Opportunity_Sales_Goal__c opportunitySalesGoal = new Opportunity_Sales_Goal__c();
opportunitySalesGoal.Opportunity__c = newOpportunity.Id;
opportunitySalesGoal.Sales_Goal__c = salesGoalId;

DateTime dtTime = DateTime.newInstance(1980,1,1);
opportunitySalesGoal.Last_Sync_To_Parent__c = dtTime;
insert opportunitysalesgoal;
//}

}
private static Opportunity createOpportunity(Account acct){

Opportunity newOpportunity = new Opportunity();
newOpportunity.Name = 'Testing Values';
newOpportunity.Account = acct;
newOpportunity.StageName = 'Qualifying';
newOpportunity.CloseDate = Date.today();

insert newOpportunity;
return newOpportunity;

}
private static Account createAccount(){



Account account = [ Select a.Name from Account a
where a.HQ_Account_Region__c <> null
and A.billingCountry <> Null limit 1];





//Account account = new Account();
//account.Name = 'TestAccount';
//Account.BillingCountry = 'United States';

//insert account;
return account;
}

private static String getSalesGoalId(){

Sales_Goal__c newSalesGoal = new Sales_Goal__c();
newSalesGoal.Description__c = 'Testing Sales Goal';
newSalesGoal.no_Required__c=1;
insert newSalesGoal;
return newSalesGoal.Id;

}
 
}
public 

 

 

 

 

 

 

 

 

 

\

  • September 15, 2009
  • Like
  • 0

Hi 

I have a situation in which a @future method called by 2 trigger is called recursively and I get a ' @future cannot be called from a @future method'

 

Is there a way to avoid this. I learnt that static variables can be used but I dont know how to use it correctly  

 

Thanks

 

  • August 12, 2009
  • Like
  • 0

Hi,

 

I have a method which is marked as future which is being called from 2 triggers. But when executed in production I get the following error:

 

Failed to invoke future method 

 

caused by: System.AsyncException: Future method cannot be called from a future method:

 

 

Is this a case of recursion? I am not sure what the exact error is and how would I go about fixing this

 

Thanks

Gita 

 

  • August 11, 2009
  • Like
  • 0
Hi

In the opportunity object, I have a related list called Template. An template is passed to a database and converted to an Contract and sent back to salesforce. All the integration is done through informatica.

I have triggers on the Contract object both insert and update. So when the Contract is sent back  to  salesforce ideally the insert trigger should fire. But thats not happening.

But when I modify something on the Contract , the update trigger is getting triggered. Is the insert trigger is not firing because informatica integration is inserting the record?
  • August 07, 2009
  • Like
  • 0

Hi,

 

I made changes to 2 triggers and 2 classes. one is the test class and the other class has the method which the triggers call. The method is a @future method

 when I try to deploy through the IDE, in the validate step,

the triggers and the classes passed the validation.

 

But there were 2/3  unrelated classes which came with a  too many rows exception. Is there a way to get by this error?

 

Thanks

 

Message Edited by gv on 07-27-2009 12:27 AM
  • July 25, 2009
  • Like
  • 0

Hi,

 

I have a question about deploying config changes to production. Since my companys implementation is medium sized, we manually(I know tiring) move the config changes(custom object,fields,etc) from sandbox to production.

 

If I were to work in a big company what would be the best way to move config changes from sandbox to production

 

Thanks

 

  • October 08, 2010
  • Like
  • 0

 

Not sure what would be the best way to achieve this.

 

There is a custom button in account object. When clicked on that fields of a new custom object is displayed.

The page layout should match standard saleforce layout.

 

One of the field displayed on the new page is dependant on few fields on the account object.

 

How do I do this. I was thinking I would call a Visual force page from the custom button. Is that a good idea?

 

 

  • May 08, 2010
  • Like
  • 0

My requirement is as follows

 

There will be a button in Account object and when the user clicks on the link a new screen(page) is opened based on a few field values in the account object.

 

The new page is for a different object(basically different record types  based on the field values in account object)

 

Should I call a VF page from the button click on the account page to display different values?

 

TIA

  • May 04, 2010
  • Like
  • 0

Hi

 

I am constructing a search page with where condition and order by condition.  I have 5 conditions which are selected from the page and for the 6 condition, I always select 'Active' as the value.

 

For example :

 

if queryStr contains the query to be executed, this is how its going to be

 

queryStr= 'Select id, name from products where'

If(other == true)

queryStr+= 'or product_type <> null' etc with other conditions

 

but the last condition I want is status needs to be active(which is a text data type)

 

so I tried,

 

queryStr+=  'and status = 'Active''';

 

obviously this is not working and I can't figure out a way to do this. I tried assigning Active to a variable and use that in the string but that does not work either.

 

Pls. help . this is a production issue and I would have to add the active condition so search returns correct value.

 

I have very limited experience in VF, so this very basic question

 

Thanks 

 

  • March 16, 2010
  • Like
  • 0
Hi,

I am new to Visual force so this question may seem way too obvious. I have a Search page and I would like to write the SOQL to the screen to see how it is constructed. Not sure how to do it.

This is a customer portal page so that user (whom I logged in as) is not available in the debug logs user list.

I just want to write the SOQL after it is constructed.

For ex: I have this soqlQuery = 'Select id,name from products'

the above is a very basic example but how do I write to this to the screen so I can look at how the soql query with all the search conditions and order by conditions is constructed

Thanks
  • March 16, 2010
  • Like
  • 0

Hi,

 

A user uploads a excel file and parsing is done to populate certain fields. All these work well except the following

 

The excel has an account column and when parsing SOQL is generated based on the account name

 

for ex: Select id,name,account_type__c from account where name in ('test account')

 

Now, I would like to add the following condition to the where clause. Get the account with that particular account name and also a particular account type say type 1 like below

 

for ex: Select id,name,account_type__c from account where name in ('test account') and account_type__c in 'Type 1'

 

But the problem is there are few accounts which are of more than 1 types like 'Type 1; Type 2' etc.(basically its a multi select picklist)

 

How  would I get that account in my result

 

Pls. let me know if its not clear

 

Thanks

 

 

 

  • March 01, 2010
  • Like
  • 0

Hi,

 

I have a Sites website with two subsites. If the user navigates to the root, they receive an under construction error. 

 

 Say if my sites address is this: companyname.force.com/abc and i have one more subsite as companyname.force.com/def

 

If I type in the root, (companyname.force.com/) it gives me the following error

 

http://companyname.force.com/def/ is under construction

 

How to get rid of this. One suggestion is to build a VF page  which would get displayed at the root and have abc and def as two links

 

Pls. let me know what is a better option? 

  • January 23, 2010
  • Like
  • 0

I have the following scenario:

 

In a after update trigger, I need to find out if 2/3 fields are getting updated(basically getting new values)

only then proceed with trigger. It seems really simple, but I am not very sure how to go about it

 

Thanks 

  • November 19, 2009
  • Like
  • 0

Hi,

 

I have a general logic question that I am trying to use in my trigger. Seems simple but am stuck

 

I have a product and its got orders as a related list. There can be multiple orders but only the recent one can be made as active. All fine. But the problem is if there are multiple order at the same time two orders are marked as active. I want only one order to be active. 

 

Here is my logic now.

 

I take the order in the trigger.new and make it as active. I go theorugh the previous orders for that product and make everything inactive. In this process only the latest one will be active

 

But if there are 2 orders at the same time for the product , there are 2 active ones.  How would I solve that issue

 

this is a production issue

 

Thanks in advance

 

 

Set<Id> productIds = new Set<Id> (); for (Product_orders__c prod:Trigger.New){ if (prod.product__c!=null){ prod.active__c = true; productIds.add(prod.product__c);} } //this loop is to make the current one always active List<Product_orders__c> updateOrders = new List<Product_orders__c>(); // this list is to hold the orders that are to be updated List<Product_orders__c> OrdersList = ([Select e.product__c, e.Name,active__c from Product_orders__c e where e.product__r.Id in :productIds //the orderslist is to get the list of all the other orders and make them inactive so the previous active one will be inactive now ]); for(Product_orders__c ord : OrderList){ if (ord.active__c == true){ ord.active__c = false; updateShipments.add(ord); } }//for loop if (updateOrders .size() > 0) update updateOrders ; }

 


 

  • October 04, 2009
  • Like
  • 0

Hi,

 

I have a 2 text  fields which accepts numbers. I need to validate to make sure it does not anything other than the following:

 

1. 0-9

2. +,-

3 .(period)

 

Basically validate for a float value. I checked in the help topics. could not find any function. How or which function should I ue

 

Thanks in Advance

 

  • September 18, 2009
  • Like
  • 0

I have the following function call :

 

List<Contract__c> lstContracts = QueryContractRequests(); 

 

The QueryContractRequests is defined as:

 

private List<contract__c> QueryContractRequests(){

 

 return[select contract_id__c,contract_name__c,contract_class__c

    from contract__c

    where status__c = 'New'

and opportunity__c =  :this.currentOpportunity.Id

 

 

I kept getting the 'Attempt to de-reference a null object ' error in the line 'and opportunity__c =  :this.currentOpportunity.Id'.

So I thought checking for null before returning the value would be a better option and changed the method as below

 

private List<contract__c> QueryContractRequests(){

 

 

id opportunityid;

   opportunityid = this.currentOpportunity.Id;

    

   if (opportunityid <> null){ 

 return[select contract_id__c,contract_name__c,contract_class__c

    from contract__c

    where status__c = 'New'

and opportunity__c =  :this.currentOpportunity.Id

 

}} 

 

But now I keep getting the ''Non-Void method might not return a value' error in this line 'if (opportunityid <> null){ '

 

Where am I going wrong?

 

Thanks in Advance

 

  • September 18, 2009
  • Like
  • 0
Hi

In the opportunity object, I have a related list called Template. An template is passed to a database and converted to an Contract and sent back to salesforce. All the integration is done through informatica.

I have triggers on the Contract object both insert and update. So when the Contract is sent back  to  salesforce ideally the insert trigger should fire. But thats not happening.

But when I modify something on the Contract , the update trigger is getting triggered. Is the insert trigger is not firing because informatica integration is inserting the record?
  • August 07, 2009
  • Like
  • 0
I had to change an existing method so that it would execute asynchoronously. Here is the original method
 

public class WorkflowTickler { public static void TickleOpportunitySalesGoal(Opportunity_Sales_Goal__c[] opportunitySalesGoalArr) { DateTime currentTime = System.Now(); for(Opportunity_Sales_Goal__c opportunitySalesGoal:opportunitySalesGoalArr) { opportunitySalesGoal.Last_Sync_To_Parent__c = currentTime; } update opportunitySalesGoalArr; }}

 

 

The trigger that calls the method is

 

 

trigger syncParentOpportunitySales on Sales_Goal__c (after update) { Opportunity_Sales_Goal__c[] lstOpportunitySalesGoal = [Select Id from Opportunity_Sales_Goal__c where Sales_Goal__c in :Trigger.newMap.keyset()]; WorkflowTickler.TickleOpportunitySalesGoal(lstOpportunitySalesGoal); }

 I ran into Too many rows issue when trying to update rows. So I am trying to use the @future to resolve the issue.

 

But when I try to use @future in the method it would not work since I keep getting this error

 

 

Save error: Unsupported parameter type LIST:SOBJECT:Service__c e

 

 The documentation says 

List, Array of SObject cannot be a parameter to an @future method.

How to solve this issue now. This is in production :(
 
Thanks
 

 

 

 

  • July 16, 2009
  • Like
  • 0