• Shirin
  • NEWBIE
  • 0 Points
  • Member since 2011

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


We are building an app on Force.com. We would like to override the standard UI, for this we are trying to reuse the global search. Is there a way we can do this? Has somebody tried this?


  • November 30, 2012
  • Like
  • 0

We have a released package, for some reason we have created multiple versions (upto 1.8). Today we are using only one version  1.3. I have deprecated 1.4 to 1.6. Now can I delete these versions. No customer has installed this package. I want the next version to be 1.4 or atleast 1.5. Is this possible?

  • October 18, 2012
  • Like
  • 0

We have developed a Force.com application. This is completely on Force.com with no integration with other applications. We are using vf pages, java script and Jquery for developing a different UI. When we run the checkmarx scanner we did not have any errors but during security review SFDC team responded to us with few FLS errors.

 

Our team has fixed this but does anybody know how to identify these errors by using a specific scanner or otherwise so that we can check if there are any more FLS errors.

 

Thanks. Looking forward to your reply.

I have installed chatter graph and works well for accounts, opportunities, cases,leads. I need to extend this to custom objects. Currently, I have no idea how to do this. There is no help on this too. Has anybody worked on this before and can help me on this?

  • March 22, 2012
  • Like
  • 0

Hi,

 

We have developed a vf page for the chatter. We do not want to view systems messages like "User A created this decision". Is there a way to filter these messages so that we can display only those feeds that are useful. I want to filter out messages that contain the word created. Is this possible? If yes, how i can i go about it?

 

Will be of great help if you can suggest. Thanks.

  • March 09, 2012
  • Like
  • 0

I have used jquery UI tabs.

 

In the tabs i have defined the 4 output panels that reflects the respective data onclick of the label.

My problem is that when i'm in outpanel2 and after that i refresh  the page. it redirects to outpanel1 which is not right.(should diaplat the same page)

 

Can somebody help me with this?

  • February 21, 2012
  • Like
  • 0

Hi ,

 

I have written a code below to copy data from opportunity line item schedule to a custom object 'Forecast'. The code is as below, Can anybody help me write the test class. I have also copied the test class here. The coverage is only 30%.

 

 

trigger RevenueForecastInsertFinal on OpportunityLineItem (After Insert) {
 For (OpportunityLineItem OppLi : Trigger.New)
    {
list <OpportunityLineItemSchedule> schedule = [select Id, ScheduleDate,Revenue from 
                                               OpportunityLineItemSchedule where
                                               OpportunityLineItemId = :OppLi.Id ];

List <Forecast__c> F = New List<Forecast__c> ();
For( Integer i=0; i< (schedule.size()) ;i++)
{
             F.add(New Forecast__c (Amount__c = schedule[i].Revenue, 
                               Record_Id_BE__c = OppLi.Id, 
                               Date__c = schedule[i].ScheduleDate,
                               Status__c = OppLi.Status_Category__c,
                               Status_Category__c = OppLi.Status__c,
                               Forecast_Owner__c = OppLi.Opportunity_Owner_Id__c,
                               Business_Unit_Head__c = OppLi.Business_Unit_Head_Id__c,
                               Business_Unit__c = OppLi.Resource_Business_Unit__c,
                               Opportunity_Type__c = 'T&M',
                               Related_Account__c = OppLi.Account_Id__c,
                               Owner_Region__c = OppLi.Owner_Region__c,
                               Related_Opportunity__c = OppLi.Opportunity_IdNumber__c));

}
    
    if(schedule.size()!=0) 
    insert F;
}
}

 

 

 

Test Class:

@IsTest
private class TestRevenueForecastInsertFinal {

static testmethod void TestRevenueForecastInsertFinal(){

        Opportunity o = new Opportunity(
            name='test',
            stageName='Open',
            currencyisocode = 'INR',
            Number_of_Resources__c = 4,
            CloseDate=Date.newInstance(2006,10,10));
        insert o;
        
Pricebookentry pbe = [select Id from Pricebookentry where currencyisocode=:o.currencyisocode];  

OpportunityLineItem OppLi = new OpportunityLineItem(From_Date__c = date.today(),
                   Quantity = 1,UnitPrice = 1000, opportunityid=o.id,pricebookentryid=pbe.id);

Insert OppLi;

OpportunityLineItemSchedule OppLis = new OpportunityLineItemSchedule(OpportunityLineItemId = OppLi.Id,
                                    Type = 'Revenue',ScheduleDate = date.today(), Revenue = 1000);
Insert OppLis;



Forecast__c F = new Forecast__c(Date__c = date.today(),Status__c = 'Closed',Status_Category__c = 'Resume Identified',
                Business_Unit__c = 'Communication',
                Opportunity_Type__c = 'T&M',Owner_Region__c = 'India',Amount__c = 1000);
                
                
Insert F;
}
}

H, I have written a code to insert records in a custom object from opportunitylineitemschedule. Can anybody help me write the update trigger for the same. My code is as seen below:

 

 

trigger RevenueForecastInsert on OpportunityLineItem (After Insert) {
 For (OpportunityLineItem OppLi : Trigger.New)
    {
list <OpportunityLineItemSchedule> schedule = [select Id, ScheduleDate,Revenue from 
                                               OpportunityLineItemSchedule where
                                               OpportunityLineItemId = :OppLi.Id ];
For( Integer i=0; i< (schedule.size()) ;i++)
{
 Forecast__c F = New Forecast__c (Amount__c = schedule[i].Revenue, 
                               Record_Id_BE__c = schedule[i].Id, 
                               Date__c = schedule[i].ScheduleDate,
                               Status__c = 'Pipeline',
                               Forecast_Owner__c = OppLi.Opportunity_Owner_Id__c,
                               Business_Unit_Head__c = OppLi.Business_Unit_Head_Id__c,
                               Business_Unit__c = OppLi.Resource_Business_Unit__c,
                               Opportunity_Type__c = 'T&M',
                               Related_Opportunity__c = OppLi.Opportunity_IdNumber__c);
Insert F;
}

}
}

 

I am new to Apex , actually just started some work. I have opportunities with products and schedules. I have another customer object called milestones. I have a third object called Forecast. I need the revenue and the scheduledate fields to be populated in the Forecast record. I am unable to access the revenue & schedule date at all from the opportunity line item schedule.

 

I am trying to wrtie a trigger like the one below, but just not successful. I know I must be missing out something or I am wrong. Please help on the same.

 

trigger RevInsert on OpportunityLineItem (After Insert) {

For(OpportunityLineItem OLi:Trigger.New){
For( OpportunityLineItemSchedule OLis:Trigger.New){
Forecast__c F = New Forecast__c(Date__c = OLis.ScheduleDate);

Insert F;
}

}

Hi,

I am new to salesforce.com apex. I have enabled product scheduling for opportunities. I have created another object where I want to populate the schedule amount and the date.

 

Can anyone please tell me how can I do this. I have a date field & amount filed on the new object [ Revenue Schedule] . All i want to do is write the revenue schedule amount to amount  & Schedule date to date.

 

PLease suggest.

 

Thanks.

Hi,

 

Being new to SFDC development , I am trying to write a apex trigger. On the opportunity page we have a field called number of resources. When the user enters the number, those many opportunity product records need to be created. I have written the code but i have been successful only when the number of resources is upto 15, if the number is above 15 , i get the following error. I have also added the code. I hope somebody can help me.

 

Thanks.

 

trigger OppportunityProductInsert on Opportunity (after Insert, after Update )
{
    Product2 Prod = [select Id from Product2 limit 1 ];
    Pricebook2 PB = [select Id from Pricebook2 where IsActive=True  limit 1 ];
    PricebookEntry P = [select Id from PricebookEntry where Pricebook2Id=:PB.Id limit 1 ];
    List<Opportunity> lstOpportunity = new List<Opportunity>();
    Integer Num = 1;
    For (Integer I = 0; I < Num; I++)
    {
        For (Opportunity a : Trigger.new)
        {
            if (a.RecordTypeId=='01290000000UUr2' && (a.Number_of_Resources__c-a.Total_Number_of_Opportunity_Products__c)>0 && a.CurrencyIsoCode == P.CurrencyIsoCode)
            {
                OpportunityLineItem OppLI = new OpportunityLineItem (OpportunityId=a.id, UnitPrice=0, Quantity =1, PricebookEntryId=P.Id);
                lstOpportunity.add(OppLI);
            }
        }
    }
    if(!lstOpportunityisEmpty())
        update lstOpportunity;
}

 

 

The error:

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger OppportunityProductInsert caused an unexpected exception, contact your administrator: OppportunityProductInsert: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OppportunityProductInsert: maximum trigger depth exceeded Opportunity trigger event AfterInsert for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO] Opportunity trigger event AfterUpdate for [006N0000001qzQO]: []: Trigger.OppportunityProductInsert: line 12, column 1

 

 


We have a task object where tasks are assigned by managers to other users. We do not want the users to edit the due date. This field is not accessible in formula, validation or workflow rules. Does anybody know how to manage this? Can we write an apex trigger for the same.

 

Thanks

Hi,

I am new to apex coding & trigger. We have an opportunity and opportunity products record. There is a field called number of resources. When a user enters the number of resources ( for example: 5) the same number of opportunity products should be created (for example:5). I have written a trigger as below: but i can only enter 15 at a time. If the number of resources goes beyond 15, an error occurs. Can anybody help me on this?

trigger OppportunityProductInsert on Opportunity (after Insert, after Update ) {

Integer Num = 1;
For (Integer I = 0; I < Num; I++)
For (Opportunity a : Trigger.new)
if (a.RecordTypeId=='01290000000UUr2' && (a.Number_of_Resources__c-a.Total_Number_of_Opportunity_Products__c)>0)
{
Product2 Prod = [select Id from Product2 limit 1 ];
Pricebook2 PB = [select Id from Pricebook2 where IsActive=True  limit 1 ];
PricebookEntry P = [select Id from PricebookEntry where CurrencyIsoCode=:a.CurrencyIsoCode And Pricebook2Id=:PB.Id limit 1 ]; 
OpportunityLineItem OppLI = new OpportunityLineItem (OpportunityId=a.id, UnitPrice=0, Quantity =1, PricebookEntryId=P.Id);
Insert OppLI;
}
}
  • April 07, 2011
  • Like
  • 0

H, I have written a code to insert records in a custom object from opportunitylineitemschedule. Can anybody help me write the update trigger for the same. My code is as seen below:

 

 

trigger RevenueForecastInsert on OpportunityLineItem (After Insert) {
 For (OpportunityLineItem OppLi : Trigger.New)
    {
list <OpportunityLineItemSchedule> schedule = [select Id, ScheduleDate,Revenue from 
                                               OpportunityLineItemSchedule where
                                               OpportunityLineItemId = :OppLi.Id ];
For( Integer i=0; i< (schedule.size()) ;i++)
{
 Forecast__c F = New Forecast__c (Amount__c = schedule[i].Revenue, 
                               Record_Id_BE__c = schedule[i].Id, 
                               Date__c = schedule[i].ScheduleDate,
                               Status__c = 'Pipeline',
                               Forecast_Owner__c = OppLi.Opportunity_Owner_Id__c,
                               Business_Unit_Head__c = OppLi.Business_Unit_Head_Id__c,
                               Business_Unit__c = OppLi.Resource_Business_Unit__c,
                               Opportunity_Type__c = 'T&M',
                               Related_Opportunity__c = OppLi.Opportunity_IdNumber__c);
Insert F;
}

}
}

 

Hi,

I am new to salesforce.com apex. I have enabled product scheduling for opportunities. I have created another object where I want to populate the schedule amount and the date.

 

Can anyone please tell me how can I do this. I have a date field & amount filed on the new object [ Revenue Schedule] . All i want to do is write the revenue schedule amount to amount  & Schedule date to date.

 

PLease suggest.

 

Thanks.