• khushbu
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies

Hello , 

 

 I am having one custome object Inventory.

 I am having two fields. ID and Name.

 

Now I have created one datatable which is having these two fields and one save button.

 

  I have created one dynamic trigger for updating record.

 I have created trigger for (before update) event.

 

Now what I want to get is: 

 

          I want to know the  unique record ID of updated record to fire the trigger.

    Please guide me as soon as possible

Hello , 

 

 I want to create trigger dynamically.

Basically my requirement is :

 

  I am creating custome objects dynamically throgh metadata services.

 Now whenever my new CO done, my trigger should also be created dynamically.

 

Please help me out

Hello friends.

 

I am having one custom object .

I am using metadataService library.

I want  to create trigger for that object.

What I want is :

 

When I create object it should create trigger also by using metadataService library.

 

Can anyone guide me?

Hello all salesforce team,

 

   I am new for salesforce.

 

  I am having one issue .I want to autorefresh my datatable on any event when  DML operation (insert,update,delete )occur.

I have tried actionpollar . but it wont work.

 

Please direct me.

 

Thanks

 

Khushbu Shah

Hello , 

 

 I am having one custome object Inventory.

 I am having two fields. ID and Name.

 

Now I have created one datatable which is having these two fields and one save button.

 

  I have created one dynamic trigger for updating record.

 I have created trigger for (before update) event.

 

Now what I want to get is: 

 

          I want to know the  unique record ID of updated record to fire the trigger.

    Please guide me as soon as possible

Hello , 

 

 I want to create trigger dynamically.

Basically my requirement is :

 

  I am creating custome objects dynamically throgh metadata services.

 Now whenever my new CO done, my trigger should also be created dynamically.

 

Please help me out





please help me how to write test class for this trigger

 

trigger UpdateProductRecordType on OpportunityLineItem (after insert)
{
    Set<String> oppLineItemIds = new Set<String>();
    
     for(OpportunityLineItem oppLineItem : Trigger.new)
     {
         oppLineItemIds.add(oppLineItem.Id);
     }
     List<OpportunityLineItem> oppLineItems = new List<OpportunityLineItem>();
     
     for(OpportunityLineItem oppLineItem : [select Opportunity.RecordType.Name, record_type_c__c from OpportunityLineItem where Id in :oppLineItemIds])
     {
          oppLineItem.record_type_c__c = oppLineItem.Opportunity.RecordType.Name;
          oppLineItems.add(oppLineItem);
     }
     if(oppLineItems.size() > 0)
     {
          update oppLineItems;
   }

}

 

the below test class is not covering my trigger 

test class:

 

@isTest
Private class UpdateProductRecordType_test
{
static testMethod void testUpdateProductRecordType()
{
RecordType rt = [select id,Name from RecordType where SobjectType='opportunity' and Name='A' Limit 1];
Opportunity o = new Opportunity(Name = 'Test' , StageName ='Closed Won' , CloseDate = Date.today());
insert o;

Product2 p = new Product2(Name = 'productname');
insert p;

Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
insert pb;
Product2 prod = new Product2(Name = 'productname', Family = 'Best Practices' , IsActive = true);
insert prod;

PricebookEntry standardPrice = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
insert standardPrice;


OpportunityLineItem ol = new OpportunityLineItem(OpportunityId = o.id , record_type_c__c ='oppotunity b',
PricebookEntryId = standardPrice.id);
insert ol;
}

 

 

 

 

regards

sri

 

 

Hello all salesforce team,

 

   I am new for salesforce.

 

  I am having one issue .I want to autorefresh my datatable on any event when  DML operation (insert,update,delete )occur.

I have tried actionpollar . but it wont work.

 

Please direct me.

 

Thanks

 

Khushbu Shah

Hello. 

 

I had been seeing strange behavior on a page - and narrowed down the cause of thisodd behavior to the use of an ActionPoller.  After doing some research, it seems that using an ActionPoller with a dataTable causes problems.

 

Below is my code.  Does anyone have any suggestions how to refresh this table - but avoid known problems with ActionPoller & DataTable?

 

Any thoughts would be appreciated.  Thanks in advance.

 

<apex:pageBlock title="Customer Overview"> 
<apex:dataTable value="{!Customers}" var="cust" id="CustList" width="100%" > 
 <apex:column > 
  <apex:facet name="header"><b>Customer Name</b></apex:facet> 
  <apex:commandLink action="{!invokeService}"
                    value="{!cust.CustName__c}" rerender="blockA, blockB">
    <apex:param name="xxx" value="{!cust.id}"/>
  </apex:commandLink>
 </apex:column> 
</apex:dataTable> 
<apex:actionPoller rerender="CustList" interval="5"/>
</apex:pageBlock>