• shan876
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 123
    Questions
  • 141
    Replies

I need to write a validation rule that would on the Opportunity ...

If the Probability is greater then 10% then the user must add an OpportunityLineItem (product)...

Could this be done through Validation?

If so how?

Thanks

Hi:

  I know how to call SF webservice .. but can I call a vendor's web service and populate fields based on the fields selected on the page in salesforce.com???

If yes, please guide me to to the right material to learn or post example up...

Thanks

Shan

Hi:

   I have been working as a Salesforce.com Developer/Admin for my workplace and have help many clients out with there orgs.

I am looking for more work on a part-time basis, rates are reasonable and I do have a very fast turn around.

 

Please email me at

 

strictlyit@yahoo.com 

 

for my resume.

 

Meanwhile check out my blogs:

 


 

Can we use len() in VisualForce...

If yes anyone have an example cause I keep getting:

 Error: Incorrect parameter for function len(). Expected Text, received Number

 

Hi:

   I have a soql query 

Select unitprice from opportunitylineitem

 

the unit price in VF brings back 1000.0

My boss wants it as 1,000.00...

 

So I tried the following:

public string unitprc{get;set;}

 

        unitprc = ql.Unit_Price__c.setScale(2).format();

 

This bought back 1,000 no decimal????

 

I thought this was suppose to bring back decimal..

Can someone suggest please...

Thanks

 

Hi :

I am trying to modify what I wrote due to what the users want to see...

Which is:

Weekending          Monday    Tuesday    Wednesday ...

     Date               Draw Net  Draw Net   Draw Net

So I tried colspan=2 when it gets to Monday but it is not working correctly:

<apex:page standardcontroller="SFDCFEED__c" extensions="SalesByAccountTableController" id="thePage" tabStyle="Account"> <apex:pageblock > <apex:pageBlockSection title="Sales Detail Information" collapsible="false" columns="1"> <apex:pageBlockTable value="{!fed}" var="account" border="1" cellspacing="0" cellpadding="0" style="font-size:11px; font-family:garamond;"> <apex:column headerValue="Weekending Date"><apex:outputField value="{!account.SIS_DATE__c}"/></apex:column> <apex:column headerValue="Monday"colspan="2">Draw <apex:outputField value="{!account.SIS_MON_DRAW__c}"/> <apex:outputField value="{!account.SIS_MON_NET__c}"/></apex:column> <apex:column > <apex:facet name="header">Tuesday<br/>Draw</apex:facet> <apex:outputText value="{!account.SIS_TUE_DRAW__c}"/> </apex:column>

Thank you for helping

Shan

I have the following:

 

<apex:page standardController="SFDC_520_Quote__c" extensions="salesQuotes" showHeader="false" sidebar="false" tabStyle="SFDC_520_Quote__c" renderAs="PDF"> <script> function formatCurrency(num) { num = num.toString().replace(/ \|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '' + num + '.' + cents); } </script> <style> h2 {color: #dddddd; font-size: 24px; } .teststyle {color: #ff3300;} </style> <apex:pageBlock> <apex:stylesheet value="{!URLFOR($Resource.pdfresource, 'styles.css')}"/>

 I need to call it here: How do I call it around UnitPrice???

 

<apex:pageBlockTable value="{!SFDC_520_Quote__c.quote_lines__r}" var="item" border="1" cellspacing="0" cellpadding="0" style="font-size:10px; font-family:courier;"> <apex:column headerValue="Unit Price"> <apex:outputText value="{!item.Unit_Price__c}"/> </apex:column> </apex:column> </apex:pageBlockTable>

 

 

 

 

 

What is wrong with my statement:

  Also All I want to do is drop the CurrencyISO from the field:

<apex:outputField value="{!SUBSTITUTE(TEXT(ROUND(item.Unit_Price__c, 0)), "GBP", "," )}" />

 

 

Hi;

   I created a PDF and the currency field ends up looking like the following

GBP 65,000.00 (USD 45,454.55) ???

If I use the currency GBP then shouldn't it just display GBP not USD??

 

Anyone know how to fix it?

If I use <apex:outputField> it will state that above...

If I use <apex:outputText> It takes the commas away, anyone know how to format it then...

 

Ideally if anyone knows how to just have the correspondant currency there Please let me know...

Thanks

Shan

What is wrong with this:

Basically saying: If the partner is HP and Sales_Discount has been changed and it is greater then 40% then cause an error to occur.. if not then go to the next scenario and say if Partner is Geo, and so fourth...

 

IF(AND(Quote__r.Partner_Direct__c = 'HP' , AND(ISCHANGED(Sales_Discount__c),OR(Sales_Discount__c>0.40))), IF(AND(Quote__r.Partner_Direct__c = 'GeoBridge' , AND(ISCHANGED(Sales_Discount__c),OR(Sales_Discount__c>0.35))), true,null))

 

 

 

I have a save button and wrote the controller as so...

Basically the VF Page brings up all the quoteitems that want/need to be edited...

If any of those exceed the limit specified then they can not save it...

Here is my code:

 

public PageReference save() { integer i=0; for ( i=0; i< quoteLineItems.size(); i++ ) { SFDC_520_QuoteLine__c[] ql = [Select Sales_Discount__c from SFDC_520_Quoteline__c where id =:quoteLineItems[i].id]; if (ql[0].Sales_Discount__c > rsl[0].License__c && UserInfo.getProfileId() == '00e00000006olyLAAQ') { quoteLineItems[i].Sales_Discount__c.addError('The discount levels displayed in this quote exceed limitations. Please contact your administrator or manager if you believe that you have received this in error.'); } else{ upsert quoteLineItems; if ( todelete.size() > 0 ) { delete todelete; } queryQuoteLines(quote.id); return quotePR(); } } return null; }

 So then I tried to rearrange it and this works when all of them exceed but if one of the quoteline discounts does not exceed then it lets the user save it????

 

public PageReference save() { integer i=0; for(SFDC_520_QuoteLine__c ql : quoteLineItems){ if (ql.Sales_Discount__c > rsl[0].License__c && UserInfo.getProfileId() == '00e00000006olyLAAQ') { ql.Sales_Discount__c.addError('The discount levels displayed in this quote exceed limitations. Please contact your administrator or manager if you believe that you have received this in error.'); } else{ upsert quoteLineItems; if ( todelete.size() > 0 ) { delete todelete; } queryQuoteLines(quote.id); return quotePR(); } } return null; }

 

 

 

 

 

Hi all:

   I have the following trigger and class...

Basically, this works real well when an user creates a quote.. it copies everything from product line to quoteline automatically once the quote is created...

Now the situation I have is if the Partner__c value changes then the sales_discount off the quoteline must change accordingly...

I am totally at a lost to do that...

Here is my trigger:

 

trigger quoteTrigger on SFDC_520_quote__c (after insert) { for (SFDC_520_Quote__c q : Trigger.new) { if (Trigger.isInsert) util.copyLineItemsFromOpp(Trigger.new); } }

 My class:

 

global class util { // Class variables can be used for communication between triggers public static Boolean inQuoteTrigger; public static Set<Id> opportunityIds = new Set<Id>(); public static SFDC_520_Quote__c[] getOtherPrimaryQuotes(list<SFDC_520_Quote__c > qs) { // Retrieve the list of all opportunities referenced by the given quotes List<Id> ops = new List<Id>(); for(SFDC_520_quote__c q : qs) ops.add(q.opportunity__c); // Now retrieve all quotes that reference the opportunities, // excluding the given quotes SFDC_520_Quote__c[] others = [select id from SFDC_520_quote__c where opportunity__c in :ops and id not in :qs and primary__c = true]; return others; } // This method moves opportunity line items to the given quote q. public static void copyLineItemsFromOpp(List<SFDC_520_Quote__c> qs) { // We will modify and update the quotes with totals at the end, so we clone it // first since Trigger.new records cannot be modified in after triggers. Notice that // we use the deepClone method on the list as clone for sobjects creates a shallow // copy which is still read-only. List<SFDC_520_quote__c> quoteList = qs.deepClone(true); try { // By setting the inQuoteTrigger class variable, this method tells // the quoteLine trigger that it should disable itself during this // operation (the quoteLine trigger is described in Example 3) inQuoteTrigger = true; //Now the method creates an empty array of quote line items List<SFDC_520_QuoteLine__c> quoteItemList = new List<SFDC_520_QuoteLine__c>(); // Next get the opportunity line items for the respective Opportunities. // This demonstrates the aggregate relationship query pattern for getting // children correlated back to their parent. You could also query // OpportunityLineItem directly but would then have to correlate the items // back to their respective parents (opportunity) inside the code manually. // We are constructing a map so the respective opportunity // (with its line items) can be easily correlated back to quote as we process // them below. Map<Id, Opportunity> opportunityMap = new Map<Id, Opportunity>( [select Id,Partner__c, (Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id from opportunitylineitems order by createddate) from Opportunity where Id IN :getOpportunityIds(quoteList)]); // Iterate through the quotes in the bulk operation. for(SFDC_520_Quote__c quote:quoteList) { // Next, the method manually calculates the overall total for the quote // by iterating over an array of OpportunityLineItem records from the // preceeding SOQL query. The query selects the data from opportunity // line items that match the opportunity associated with the quote. Double tot = 0; // The running total Integer i = 0; // Number the line items // Get the respective opportunity and its line items from the map. Opportunity opp = opportunityMap.get(quote.opportunity__c); // If this quote is not associated to an opportunity then skip it. if(opp == null) continue; for (opportunitylineitem oppline : opp.OpportunityLineItems) { i++; // For each opportunity line item, the method // calculates the running total if (oppline.unitprice != null && oppline.quantity != null) tot += oppline.unitprice * oppline.quantity; // And then it adds a new quote line item to the quoteitems, // array, initializing it with values. Reseller__c[] r =[Select Name, License__c from Reseller__c where Name=:quote.Partner_Direct__c]; if(r.isEmpty()){ quoteItemList.add(new SFDC_520_quoteline__c( quote__c = quote.id, Sales_Discount__c = 0.0, Qty_Ordered__c = oppline.Quantity, Unit_Price__c = oppline.UnitPrice, Description__c = oppline.Description, ServiceDate__c = oppline.ServiceDate, Product2__c = oppline.PricebookEntry.Product2id));} if(!r.isEmpty()){ quoteItemList.add(new SFDC_520_quoteline__c( quote__c = quote.id, Sales_Discount__c = r[0].License__c, Qty_Ordered__c = oppline.Quantity, Unit_Price__c = oppline.UnitPrice, Description__c = oppline.Description, ServiceDate__c = oppline.ServiceDate, Product2__c = oppline.PricebookEntry.Product2id)); } } } //The method adds the whole array of quote line items //to the database with a single insert statement. insert quoteItemList; update quoteList; } finally { // To clean up the working variable, the method resets inQuoteTrigger to false; inQuoteTrigger = false; } } // Generate a unique set of opportunity IDs that represents all the // quotes in the argument list. private static Set<Id> getOpportunityIds(List<SFDC_520_Quote__c> quotes) { Set<Id> idSet = new Set<Id>(); for(SFDC_520_Quote__c quote:quotes) { if(quote.opportunity__c != null) idSet.add(quote.opportunity__c); } return idSet; } static testMethod void testQuoteApp() { // To begin, the sample application first creates the necessary records // to test OpportunityLineItems: Pricebook2, Product2, and PricebookEntry // First it creates a product with a standard price Product2 p = new product2(name='x'); insert p; Pricebook2 stdPb = [select Id from Pricebook2 where isStandard=true limit 1]; insert new PricebookEntry(pricebook2id = stdPb.id, product2id = p.id, unitprice=1.0, isActive=true); // Next, it creates a new pricebook with an entry for this product Pricebook2 pb = new pricebook2(name='test'); insert pb; PricebookEntry pbe = new PricebookEntry(pricebook2id=pb.id, product2id=p.id, unitprice=1.0, isActive=true); insert pbe; // To test the first example from the sample application, the test // method creates an opportunity line item using the pricebook entry, // and then asserts that the Color field was correctly copied from the // product after record insertion. Opportunity o = new Opportunity(name='test', pricebook2id=pb.id, stageName='Open', CloseDate=Date.newInstance(2006,10,10)); insert o; OpportunityLineItem oli = new OpportunityLineItem(opportunityid=o.id, pricebookentryid=pbe.id, unitprice=1.5, quantity=2); insert oli; /*System.assertEquals('c', [select color__c from opportunitylineitem where id = :oli.id].color__c);*/ // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. SFDC_520_Quote__c q = new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true); insert q; // Cannot mark it non-primary q.primary__c = false; try { update q; } catch (DmlException e) { System.assert(e.getMessage().contains('first error: FIELD_CUSTOM_VALIDATION_EXCEPTION,'+ ' Primary quote cannot be marked non-primary: [Primary__c]'), e.getMessage()); System.assertEquals('Primary quote cannot be marked non-primary', e.getDmlMessage(0)); System.assertEquals(SFDC_520_Quote__c.Primary__c, e.getDmlFields(0)[0]); } // To test the second and third examples from the sample application, the // test method asserts that the inserted quote has the proper quote line // data copied from the opportunity line item, and that the quote's total // value is properly calculated. System.assertEquals(1, [select count() from SFDC_520_quoteline__c where quote__c = :q.id]); //delete o; // delete q; // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. SFDC_520_Quote__c q2 = new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true); insert q2; // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. //System.assert(![select primary__c from SFDC_520_quote__c where id = :q.id].primary__c); // Can't have the same opportunity marked as primary for the same opportunity // in the same insert/update SFDC_520_Quote__c[] quotes = new SFDC_520_Quote__c[] { new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true), new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true)} ; insert quotes; // Finally, the test method performs DML operations on quote line // items to assert that the quote line item values are properly // recalculated when associated values change. SFDC_520_QuoteLine__c qLine = new SFDC_520_QuoteLine__c(quote__c = q.id, product2__c = p.id, unit_price__c = 2.0, Qty_Ordered__c = 2); SFDC_520_QuoteLine__c qLine1 = qLine.clone(); insert qLine; // qLine.unit_price__c = 3.0; // update qLine; delete qLine; // Bulk line item operation insert new SFDC_520_QuoteLine__C[]{qLine1, qLine1.clone()}; // Test that updating the product master color and then updating the quote colors works } }

 

 Any Help would be kindly appreciated...

 

 

 

 

Hi I place the following code in a VF page and the pdf borders break on the bottom due to this table.. So I was wondering if anyone knew how to go about and create a nice table in VF???using VF tags??

 

<table border="1" cellpadding="0" cellspacing="0" width="100%"> <tr> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Item #"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="SKU"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Description"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Qty"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Unit Price"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Extended Price"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Discount %"/></th> <th align="center" bgcolor="#c0c0c0"><apex:outputText value="Extended Net Price"/></th> </tr> <apex:repeat value="{!SFDC_520_Quote__c.quote_lines__r}" var="line"> <tr> <td><apex:outputText value="{!line.name}"/></td> <td><apex:outputText value="{!line.Product2__r.ProductCode}"/></td> <td width="35%"><apex:outputText value="{!line.Product2__r.Name}"/></td> <td align="center"><apex:outputField value="{!line.Qty_Ordered__c}"/></td> <td width="20%"><apex:outputField value="{!line.Unit_Price__c}"/></td> <td width="20%"><apex:outputField value="{!line.Ext_Price__c}"/></td> <td width="5%" align="center"><apex:outputField value="{!line.Sales_Discount__c}"/></td> <td width="20%"><apex:outputField value="{!line.Ext_Net_Price__c}"/></td> </tr> </apex:repeat> </table>

 


 

I downloaded the Quote Sale Line app from app excahnge written by salesforce.com. I have two scenarios:

  • where if the user is not the admin and sales_discount is more then 30% then they can not edit the sales discount.
  • Now if the reseller is on the reseller table and the discount follows through but if it is more then 30% that above rule applies and does not insert the record from the code below and it comes up with an error.

Here is the code I modified but do not know how to place in the correct parameters for a validation or a new trigger rule:

 

// copy lines from the oppportunity to this quote public void copyLineItemsFromOpptyToQuote() { // delete any existing quote lines OpportunityLineItem[] olist; olist = [Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id From OpportunityLineItem where OpportunityId = :quote.Opportunity__c ]; // create new quote lines SFDC_520_QuoteLine__c[] qlines = new list<SFDC_520_QuoteLine__c>(); for ( OpportunityLineItem oitem : olist) { Reseller__c[] r =[Select Name, License__c from Reseller__c where Name=:quote.Partner_Direct__c]; if(r.isEmpty()){ SFDC_520_QuoteLine__c ql = new SFDC_520_QuoteLine__c( Quote__c = quote.id, Sales_Discount__c = 0.0, Qty_Ordered__c = oitem.Quantity, Unit_Price__c = oitem.UnitPrice, Description__c = oitem.Description, ServiceDate__c = oitem.ServiceDate, Product2__c = oitem.PricebookEntry.Product2id ); qlines.add(ql); } if(!r.isEmpty()){ SFDC_520_QuoteLine__c ql = new SFDC_520_QuoteLine__c( Quote__c = quote.id, Sales_Discount__c =r[0].License__c, Qty_Ordered__c = oitem.Quantity, Unit_Price__c = oitem.UnitPrice, Description__c = oitem.Description, ServiceDate__c = oitem.ServiceDate, Product2__c = oitem.PricebookEntry.Product2id ); qlines.add(ql); } } delete quote.Quote_Lines__r; if ( qlines.size() > 0 ) { insert qlines; } }

 

 Any help would be truly appreciated....

Thanks

 

 

 

Hi:

  I have the following code, which when one creates a new quote then the Opportunity Products will insert into the quote lines... Here is the code:

I keep getting this error:

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger updatepartner caused an unexpected exception, contact your administrator: updatepartner: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = a0NR0000000KhDw) is currently in trigger updatepartner, therefore it cannot recursively update itself: Trigger.updatepartner: line 30, column 12

 

trigger updatepartner on SFDC_520_Quote__c (before update) { //apex/editQuoteLines?id={!SFDC_520_Quote__c.Id}&reloadQuote=1 for (SFDC_520_Quote__c quote: Trigger.new) { // delete any existing quote lines OpportunityLineItem[] olist; olist = [Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id From OpportunityLineItem where OpportunityId = :quote.Opportunity__c ]; // create new quote lines SFDC_520_QuoteLine__c[] qlines = new list<SFDC_520_QuoteLine__c>(); for ( OpportunityLineItem oitem : olist) { SFDC_520_QuoteLine__c ql = new SFDC_520_QuoteLine__c( Quote__c = quote.id, Sales_Discount__c = 0.0, Qty_Ordered__c = oitem.Quantity, Unit_Price__c = oitem.UnitPrice, Description__c = oitem.Description, ServiceDate__c = oitem.ServiceDate, Product2__c = oitem.PricebookEntry.Product2id ); qlines.add(ql); } delete quote.Quote_Lines__r; if ( qlines.size() > 0 ) { insert qlines; } } }

 This code use to be a link from the quote code from salesforce.com. But I need it to be done automatically instead of the user clicking the link from the quote screen after they create the quote...

See below:

 

public class salesQuotes { public SFDC_520_Quote__c quote { get; private set;} public SFDC_520_QuoteLine__c[] quoteLineItems { get; private set; } public Opportunity opp { get; private set; } public Boolean hasContact { get { return (opp.opportunityContactRoles.size() == 1);} } public Contact contact { get; private set; } public DateTime a3months{get;set;} private ApexPages.StandardController controller; // constructor, loads the quote and any opportunity lines void queryQuoteLines(id id) { quote = [ Select s.Opportunity__r.Pricebook2Id, Quote_Amount_rollup__c,LastmodifiedDate, (Select Unit_Price__c, Unit_Net_Price__c, ServiceDate__c, Sales_Discount__c, Quote__c, Qty_Ordered__c, Product2__c, Product2__r.Name, Name, Id, Ext_Price__c, Ext_Net_Price__c, Ext_Price_tmp__c, Description__c From Quote_Lines__r order by name ), s.Opportunity__r.HasOpportunityLineItem, s.Opportunity__r.Name, s.Name, s.Opportunity__r.Id, s.Opportunity__c From SFDC_520_Quote__c s where s.id = :id limit 1]; a3months = quote.lastmodifieddate; a3months = a3months.addMonths(3); quoteLineItems = quote.Quote_Lines__r; for ( SFDC_520_QuoteLine__c ql : quoteLineItems ) { ql.Ext_Price_tmp__c = ql.Ext_Net_Price__c; if ( ql.Sales_Discount__c == null ) ql.Sales_Discount__c = 0.0; } } public opportunity total { get { double amount = 0.0; for ( SFDC_520_QuoteLine__c ql : quoteLineItems ) { amount += ql.Unit_Price__c * ql.Qty_Ordered__c * (1-(ql.Sales_Discount__c/100)) ; } Opportunity ret = new Opportunity( amount= amount ); return ret; } } public pagereference CopyOperation() { // implement copy to and from opportunity given page parameters string reloadQuote = ApexPages.CurrentPage().getParameters().get('reloadQuote'); string reloadOpp = ApexPages.CurrentPage().getParameters().get('reloadOpp'); if ( reloadOpp != null ) { copyLineItemsFromQuoteToOppty(); return opportunityPR() ; } if ( reloadQuote != null ) { copyLineItemsFromOpptyToQuote( ); return quotePR(); } return null; } public pagereference recalc() { for ( SFDC_520_QuoteLine__c ql : quoteLineItems ) { ql.Ext_Price_tmp__c = ql.Unit_Price__c * ql.Qty_Ordered__c * (1-(ql.Sales_Discount__c/100)) ; // see if this is a new line, if so then, fill in a bit more info if ( ql.Product2__c != null && ql.product2__r == null ) { ql.product2__r = [ select id, name from Product2 where id = :ql.Product2__c limit 1]; //system.debug ( ql.product2__r ); } } return null; } id quoteid; public salesQuotes() { quoteid = ApexPages.CurrentPage().getParameters().get('id'); init(); } public salesQuotes(ApexPages.StandardController c) { controller = c; quoteid = c.getRecord().id; init(); } // load up quote lines, opportunity lines, opportunity details and contact info void init() { queryQuoteLines(quoteid); if ( quote.opportunity__c != null ) { /* Set the related opportunity with the result of the query that traverses to account for display of the name and down to get the primary contact role. */ opp = [select name, account.name, (select contact.name, contact.mailingStreet, contact.mailingcity, contact.mailingstate, contact.mailingpostalcode , contact.phone,contact.title,contact.fax,contact.email from opportunityContactRoles where isPrimary = true) from opportunity where id = :quote.opportunity__c]; if ( hasContact ) { contact = opp.opportunityContactRoles[0].contact; } } } /* The action method that will generate a PDF document from the QuotePDF page and attach it to the quote provided by the standard controller. Called by the action binding for the attachQuote page, this will do the work and take the user back to the quote detail page. */ public PageReference attachQuote() { /* Get the page definition */ PageReference pdfPage = new PageReference( '/apex/quotePDF' ); /* set the quote id on the page definition */ pdfPage.getParameters().put('id',quote.id); /* generate the pdf blob */ Blob pdfBlob = pdfPage.getContent(); /* create the attachment against the quote */ Attachment a = new Attachment(parentId = quote.id, name=quote.name + '.pdf', body = pdfBlob); /* insert the attachment */ insert a; /* send the user back to the quote detail page */ return controller.view(); } // copy lines from the oppportunity to this quote public void copyLineItemsFromOpptyToQuote() { // delete any existing quote lines OpportunityLineItem[] olist; olist = [Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id From OpportunityLineItem where OpportunityId = :quote.Opportunity__c ]; // create new quote lines SFDC_520_QuoteLine__c[] qlines = new list<SFDC_520_QuoteLine__c>(); for ( OpportunityLineItem oitem : olist) { SFDC_520_QuoteLine__c ql = new SFDC_520_QuoteLine__c( Quote__c = quote.id, Sales_Discount__c = 0.0, Qty_Ordered__c = oitem.Quantity, Unit_Price__c = oitem.UnitPrice, Description__c = oitem.Description, ServiceDate__c = oitem.ServiceDate, Product2__c = oitem.PricebookEntry.Product2id //a3months = oitem.lastmodifieddate.addMonths(3) //a3months.addMonths(3) ); qlines.add(ql); } delete quote.Quote_Lines__r; if ( qlines.size() > 0 ) { insert qlines; } } void makeQuotePrimary() { sobject[] allquotes = Database.query( 'Select s.Opportunity__c, S.ID, s.name '+ ' From SFDC_520_Quote__c s where s.Opportunity__c = \''+ quote.Opportunity__c + '\' ' ); for ( sobject so : allquotes) { if ( so.get('Id') == quote.id ) { so.put('Primary__c',true); } else { so.put('Primary__c',false); } } update allquotes; } public void copyLineItemsFromQuoteToOppty() { // find the appropriate pricebookentries for each product2 id List<ID> productIdList = new List<ID>(); for (SFDC_520_QuoteLine__c q : quoteLineItems) { productIdList.add((id) q.get('Product2__c')); } List<PricebookEntry> priceBookEntries = [Select id, Product2Id, Pricebook2Id From PricebookEntry where pricebook2id = :quote.Opportunity__r.Pricebook2Id and product2id in :productIdList]; Map<Id,Id> productIdToPricebookEntryIdMap = new Map<Id,Id>(); for(PricebookEntry p : pricebookEntries) { productIdToPricebookEntryIdMap.put(p.product2Id, p.id); } // clear out old opportunity line items id opptyId = quote.Opportunity__r.id; List<OpportunityLineItem> oldLineItems = [select id from OpportunityLineItem where opportunityId = :opptyId]; delete oldLineItems; // insert new ones List<OpportunityLineItem> newLineItems = new List<OpportunityLineItem>(); for ( SFDC_520_QuoteLine__c s: quoteLineItems){ newLineItems.add(New OpportunityLineItem(opportunityId = opptyId, quantity = (double) s.get('Qty_ordered__c'), unitPrice = (Double) s.get('Unit_Net_Price__c'), pricebookEntryId = productIdToPricebookEntryIdMap.get((id)s.get('Product2__c')), serviceDate = (date)s.get('serviceDate__c'), description = (string)s.get('Description__c') )); } system.debug(newLineItems); insert newLineItems; makeQuotePrimary(); // since we just overwrote the opp } PageReference opportunityPR() { return new pagereference('/'+quote.Opportunity__c); } PageReference quotePR() { return new pagereference('/'+quote.id); } public list<SFDC_520_QuoteLine__c> todelete = new list<SFDC_520_QuoteLine__c>(); public PageReference del() { string delname = ApexPages.CurrentPage().getParameters().get('delname'); system.assert( delname != null ); integer gone = -1; integer i = 0; for ( i=0; i< quoteLineItems.size(); i++ ) { if (quoteLineItems[i].Name == delname) { gone = i; } } if ( gone >= 0) { todelete.add( quoteLineItems.remove(gone) ); } return null; } public PageReference save() { try { upsert quoteLineItems; if ( todelete.size() > 0 ) { delete todelete; } queryQuoteLines(quote.id); } catch ( DmlException exc) { ApexPages.addMessages(exc); return null; } return quotePR(); } /* TODO * public PageReference add() { return null;} */ public PageReference add() { // insert a new line, after user selects a product? SFDC_520_QuoteLine__c q = new SFDC_520_QuoteLine__c( Quote__c = quote.id, Unit_price__c = 0.0, qty_ordered__c = 0.0, sales_discount__c = 0.0 ) ; quoteLineItems.add ( q ); return null; } public PageReference reset() { queryQuoteLines(quote.id); return null; }

 

 

 

 

 

How do I in SOQL set lastmodifieddate to 3 months out???
lastmodifieddate
Hi how do you get the left side border when you do a pageblock Tag? The right side comes out and the bottom breaks? Anyone plz help.. Thanks
<apex:pageBlock >

Hi all I have the following code:

How do I move it to next record when the SFD_WEEK_No__c changes...

Basically I have two recordsets of data performing the same thing twice.. but I needed to get totals by week..

This kind of works but it does not sum up the records if the week no is the same.. it just keeps it the same as the first record...

 

 

 

 

for(SFDCFEDFLE__c o:[Select SFD_WEEK_NO__c,SFD_MOFR_NET_AVG__c,True_Draw_MOFR__c,amount__c from SFDCFEDFLE__c where User__c ='00550000000mLBs']) { if(o.SFD_WEEK_NO__c != a.SFD_WEEK_NO__c) total.SFD_MOFR_NET_AVG__c+= o.SFD_MOFR_NET_AVG__c; tot.amount__c += o.True_Draw_MOFR__c;

 

 

 

where can I learn about customer portal?

Hi everyone:

   I am looking for work, very reasonable and very fast turn around...

Apex/VF/customization/setup I do it all...

 

Email me:

strictlyit@yahoo.com

 

Thanks

 

 

Hi,

 

I've been advised this is the best place to post this...

 

I've installed Quote Line Items (Version 0.7) from Appexchange and want to edit the page "Quote PDF" so that it looks similar to our existing quote template as we're looking to run our quote process through Salesforce.com.  The application is great and I've been given the go ahead to roll it out to everyone as long as the quote PDF can look more like our original version.  This is where I'm falling down - I've managed to add our logo to the template instead of the standard Visualforce one but can't get my head around adding a table and some standard text to the template. I know it's only a simple template and if it was HTML I'd be able to do it but I just can't figure out Visualforce.

 

Can anybody help with this at all please?  E.g. does anyone have a standard table I can copy & paste and then edit?  If I identify which fields need to be included, could someone guide me through how to enter them in to the table?  Is there a way of adding a standard header & footer to the page?

 

Thanks,

Cherie

This person will be responsible forassisting in the planning and implementation of our customer relationshipmanagement (CRM) solution through Salesforce.com. Responsibilities include, but are not limited to, cleaning up and user set-up,addressing reporting needs, monitoring and supporting the application andon-going maintenance activities, addressing application issues, and assistingwith updates to the application. In addition, this individual will assist project leads/managers in determining next phases of the system aswell as determining project goals that serve as benchmarks of overall project andoperational success. Also, they will assist in the development of testing, training development/support, and launch plans asrequired to aid in delivery of a quality product, designed for user acceptanceand adoption.  Inaddition to working directly with the Sales team, this person will also workwith other business partners and Hybrid Mom divisions to identify practicalsolutions through existing and/ornew business systems technology, and will be responsible for the administrationand ongoing support of the application in cooperation with the business.       

  • Maintain and develop user roles, security, profiles, workflow rules and other system configuration options.
  • Assists in the creation of uniform business practices for data entry into Salesforce.com
  • Gathers requirements by working with Sales in order to produce appropriate reports (and eventually a dashboard) that can be used to enhance the client relationship.
  • Manages data loads and data quality
  • Monitor the overall usage and ensure consistent updating is being performed by the Sales team
  • Works with the Sales training group in order to ensure the Sales team is provided the necessary information to ensure an effective and efficient rollout of Salesforce .com
  • Acts in the role of an advocate for Salesforce.com when interacting with users throughout the organization
  • Communicates and organizes organizational behavior with the business and IT.
  • Providing central point of contact for all changes requests and system alterations
  • Other duties as deemed necessary

 

  • Bachelor's degree preferred, extensive, directly-related experience may be considered in lieu of degree
  • 3-5+ years experience with Salesforce.com or other CRM solutions
  • 3-5+ years reporting experience in creating Salesforce.com or other CRM reports   
  • Strong project management skills
  • Ability to build and maintain credibility with internal and external contacts
  • Strong consulting, analytical, negotiating, decision making and problem solving skills
  • Demonstrated commitment to customer centric culture, excellence and continuous learning
  • Strong attention to detail and accuracy
  • Highly proficient in Microsoft Office including Outlook, PowerPoint, Word, and Excel

 

Ultimately would love for this person to work in our Smithtown, New York offices but would entertain a remote position.

 

About Our Company:

Hybrid Mom Consulting & Media Group, headquartered in Smithtown, New York, is dedicated to supporting and championing a new generation of moms-those who seek to redefine their roles and enhance the quality of how they work, play and live, without sacrificing their families.

The Hybrid Mom Consulting division, provides mom-owned businesses withaccess to highly qualified, career-trained mom consultants.  Our Moms-for-Profit program is wheremompreneurs participate in business service opportunities including: marketingplans, business identity packages, website development, product development andplacement, PR, et al. All of these services are provided by our momconsultants.  This unique partnershipenables moms to have the freedom and flexibility to enjoy their profession andexperience the rewards of family life.

The Hybrid Mom Media division is dedicated to today's Moms. These women areno longer choosing between a successful career or a successful family life, butrather integrating their many aspirations for the purpose of achieving abalanced life. Hybrid Mom print magazine and hybridmom.com’s editorial contentreflects a voice of friendship, rather than an expert and focuses on the "real world" of this new generationof Moms.  Hybrid Mom is publishedquarterly. www.hybridmom.com

 

Message Edited by HybridMom on 03-20-2009 01:54 PM

Here is a link to the post.  Maybe this setup will be useful to others.  Also, is there a more specific location to submit things like this (helpful articles or project summaries)?

 

Console 2 for Salesforce

I create a simple VF page and custom controller that I intend to deliver as a Home Page widget for the Ideas object.  The idea (no pun intended) is to better engage my users by putting the ideas functionality right in front of them when they log in.

 

My question is, once I use a controller to return a set of rows from the object, how can I further format these values to present to the user?

 

My controller is just this so far:

public class ideasController { public List<Idea> getNewIdeas(){ return [select id, title, createddate, CreatedBy.Alias, numcomments, votescore from idea where status = 'new']; } }

 

But I need to format the CreatedDate and VoteScore values to something more user appealing.  What would you recommend?

 

Side note, also, how can I control the style of the row/cell values?  They default to left-align, but I want some of them to center.

 

 

<apex:page controller="ideasController" title="Ideas" tabstyle="idea"> <apex:pageBlock > <apex:dataTable value="{!NewIdeas}" var="iIdea" width="100%" > <apex:column > <apex:facet name="header"><b>Title</b></apex:facet> <a href="/ideas/viewIdea.apexp?id={!iIdea.Id}">{!iIdea.Title}</a> </apex:column> <apex:column > <apex:facet name="header"><b>Created On</b></apex:facet> {!iIdea.CreatedDate} </apex:column> <apex:column > <apex:facet name="header"><b>Created By</b></apex:facet> {!iIdea.CreatedBy.Alias} </apex:column> <apex:column > <apex:facet name="header"><b>Score</b></apex:facet> {!iIdea.VoteScore} </apex:column> <apex:column > <apex:facet name="header"><b ><center>Comments</center></b></apex:facet> {!iIdea.NumComments} </apex:column> </apex:dataTable> </apex:pageBlock> </apex:page>

 

 

 

 

 

I'm trying to create a Google Maps International styled Visualforce app with Weather Information - perhaps the next 5 days of weather displayed as images?

 

Has anyone done this or have any suggestions on websites with this information that i could use?

 

 

  • March 20, 2009
  • Like
  • 0

The AP Yr 1, AP Yr2 and AP Yr3 are input Fields. I want to be reduce their size so that they take lesser column space. How can I do that? The size attribute is supported only for inputText

 

Product Name Line Type Product Family List Price Quantity AP Yr 1 EP Yr 1 AP Yr 2 EP Yr 2 AP Yr 3 EP Yr 3
RegistrationNew USD 245.005USD 1,225.00USD 1,225.00USD 1,225.00
UsersNew USD 245.005USD 1,225.00USD 1,225.00USD 1,225.00

 

Thanks for your help

 

 

Hi,

 

I am a newbie in the VisualForce Development. Please help me with a good example How to add and delete a row in a datatable.

 

Thanks in Advance!!

 

Hi :

I am trying to modify what I wrote due to what the users want to see...

Which is:

Weekending          Monday    Tuesday    Wednesday ...

     Date               Draw Net  Draw Net   Draw Net

So I tried colspan=2 when it gets to Monday but it is not working correctly:

<apex:page standardcontroller="SFDCFEED__c" extensions="SalesByAccountTableController" id="thePage" tabStyle="Account"> <apex:pageblock > <apex:pageBlockSection title="Sales Detail Information" collapsible="false" columns="1"> <apex:pageBlockTable value="{!fed}" var="account" border="1" cellspacing="0" cellpadding="0" style="font-size:11px; font-family:garamond;"> <apex:column headerValue="Weekending Date"><apex:outputField value="{!account.SIS_DATE__c}"/></apex:column> <apex:column headerValue="Monday"colspan="2">Draw <apex:outputField value="{!account.SIS_MON_DRAW__c}"/> <apex:outputField value="{!account.SIS_MON_NET__c}"/></apex:column> <apex:column > <apex:facet name="header">Tuesday<br/>Draw</apex:facet> <apex:outputText value="{!account.SIS_TUE_DRAW__c}"/> </apex:column>

Thank you for helping

Shan

What is wrong with my statement:

  Also All I want to do is drop the CurrencyISO from the field:

<apex:outputField value="{!SUBSTITUTE(TEXT(ROUND(item.Unit_Price__c, 0)), "GBP", "," )}" />

 

 

What is wrong with this:

Basically saying: If the partner is HP and Sales_Discount has been changed and it is greater then 40% then cause an error to occur.. if not then go to the next scenario and say if Partner is Geo, and so fourth...

 

IF(AND(Quote__r.Partner_Direct__c = 'HP' , AND(ISCHANGED(Sales_Discount__c),OR(Sales_Discount__c>0.40))), IF(AND(Quote__r.Partner_Direct__c = 'GeoBridge' , AND(ISCHANGED(Sales_Discount__c),OR(Sales_Discount__c>0.35))), true,null))

 

 

 

Hi all:

   I have the following trigger and class...

Basically, this works real well when an user creates a quote.. it copies everything from product line to quoteline automatically once the quote is created...

Now the situation I have is if the Partner__c value changes then the sales_discount off the quoteline must change accordingly...

I am totally at a lost to do that...

Here is my trigger:

 

trigger quoteTrigger on SFDC_520_quote__c (after insert) { for (SFDC_520_Quote__c q : Trigger.new) { if (Trigger.isInsert) util.copyLineItemsFromOpp(Trigger.new); } }

 My class:

 

global class util { // Class variables can be used for communication between triggers public static Boolean inQuoteTrigger; public static Set<Id> opportunityIds = new Set<Id>(); public static SFDC_520_Quote__c[] getOtherPrimaryQuotes(list<SFDC_520_Quote__c > qs) { // Retrieve the list of all opportunities referenced by the given quotes List<Id> ops = new List<Id>(); for(SFDC_520_quote__c q : qs) ops.add(q.opportunity__c); // Now retrieve all quotes that reference the opportunities, // excluding the given quotes SFDC_520_Quote__c[] others = [select id from SFDC_520_quote__c where opportunity__c in :ops and id not in :qs and primary__c = true]; return others; } // This method moves opportunity line items to the given quote q. public static void copyLineItemsFromOpp(List<SFDC_520_Quote__c> qs) { // We will modify and update the quotes with totals at the end, so we clone it // first since Trigger.new records cannot be modified in after triggers. Notice that // we use the deepClone method on the list as clone for sobjects creates a shallow // copy which is still read-only. List<SFDC_520_quote__c> quoteList = qs.deepClone(true); try { // By setting the inQuoteTrigger class variable, this method tells // the quoteLine trigger that it should disable itself during this // operation (the quoteLine trigger is described in Example 3) inQuoteTrigger = true; //Now the method creates an empty array of quote line items List<SFDC_520_QuoteLine__c> quoteItemList = new List<SFDC_520_QuoteLine__c>(); // Next get the opportunity line items for the respective Opportunities. // This demonstrates the aggregate relationship query pattern for getting // children correlated back to their parent. You could also query // OpportunityLineItem directly but would then have to correlate the items // back to their respective parents (opportunity) inside the code manually. // We are constructing a map so the respective opportunity // (with its line items) can be easily correlated back to quote as we process // them below. Map<Id, Opportunity> opportunityMap = new Map<Id, Opportunity>( [select Id,Partner__c, (Select Id, OpportunityId, SortOrder, PricebookEntryId, Quantity, TotalPrice, UnitPrice, ListPrice, ServiceDate, Description, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, IsDeleted , PricebookEntry.Name, PricebookEntry.Product2id from opportunitylineitems order by createddate) from Opportunity where Id IN :getOpportunityIds(quoteList)]); // Iterate through the quotes in the bulk operation. for(SFDC_520_Quote__c quote:quoteList) { // Next, the method manually calculates the overall total for the quote // by iterating over an array of OpportunityLineItem records from the // preceeding SOQL query. The query selects the data from opportunity // line items that match the opportunity associated with the quote. Double tot = 0; // The running total Integer i = 0; // Number the line items // Get the respective opportunity and its line items from the map. Opportunity opp = opportunityMap.get(quote.opportunity__c); // If this quote is not associated to an opportunity then skip it. if(opp == null) continue; for (opportunitylineitem oppline : opp.OpportunityLineItems) { i++; // For each opportunity line item, the method // calculates the running total if (oppline.unitprice != null && oppline.quantity != null) tot += oppline.unitprice * oppline.quantity; // And then it adds a new quote line item to the quoteitems, // array, initializing it with values. Reseller__c[] r =[Select Name, License__c from Reseller__c where Name=:quote.Partner_Direct__c]; if(r.isEmpty()){ quoteItemList.add(new SFDC_520_quoteline__c( quote__c = quote.id, Sales_Discount__c = 0.0, Qty_Ordered__c = oppline.Quantity, Unit_Price__c = oppline.UnitPrice, Description__c = oppline.Description, ServiceDate__c = oppline.ServiceDate, Product2__c = oppline.PricebookEntry.Product2id));} if(!r.isEmpty()){ quoteItemList.add(new SFDC_520_quoteline__c( quote__c = quote.id, Sales_Discount__c = r[0].License__c, Qty_Ordered__c = oppline.Quantity, Unit_Price__c = oppline.UnitPrice, Description__c = oppline.Description, ServiceDate__c = oppline.ServiceDate, Product2__c = oppline.PricebookEntry.Product2id)); } } } //The method adds the whole array of quote line items //to the database with a single insert statement. insert quoteItemList; update quoteList; } finally { // To clean up the working variable, the method resets inQuoteTrigger to false; inQuoteTrigger = false; } } // Generate a unique set of opportunity IDs that represents all the // quotes in the argument list. private static Set<Id> getOpportunityIds(List<SFDC_520_Quote__c> quotes) { Set<Id> idSet = new Set<Id>(); for(SFDC_520_Quote__c quote:quotes) { if(quote.opportunity__c != null) idSet.add(quote.opportunity__c); } return idSet; } static testMethod void testQuoteApp() { // To begin, the sample application first creates the necessary records // to test OpportunityLineItems: Pricebook2, Product2, and PricebookEntry // First it creates a product with a standard price Product2 p = new product2(name='x'); insert p; Pricebook2 stdPb = [select Id from Pricebook2 where isStandard=true limit 1]; insert new PricebookEntry(pricebook2id = stdPb.id, product2id = p.id, unitprice=1.0, isActive=true); // Next, it creates a new pricebook with an entry for this product Pricebook2 pb = new pricebook2(name='test'); insert pb; PricebookEntry pbe = new PricebookEntry(pricebook2id=pb.id, product2id=p.id, unitprice=1.0, isActive=true); insert pbe; // To test the first example from the sample application, the test // method creates an opportunity line item using the pricebook entry, // and then asserts that the Color field was correctly copied from the // product after record insertion. Opportunity o = new Opportunity(name='test', pricebook2id=pb.id, stageName='Open', CloseDate=Date.newInstance(2006,10,10)); insert o; OpportunityLineItem oli = new OpportunityLineItem(opportunityid=o.id, pricebookentryid=pbe.id, unitprice=1.5, quantity=2); insert oli; /*System.assertEquals('c', [select color__c from opportunitylineitem where id = :oli.id].color__c);*/ // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. SFDC_520_Quote__c q = new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true); insert q; // Cannot mark it non-primary q.primary__c = false; try { update q; } catch (DmlException e) { System.assert(e.getMessage().contains('first error: FIELD_CUSTOM_VALIDATION_EXCEPTION,'+ ' Primary quote cannot be marked non-primary: [Primary__c]'), e.getMessage()); System.assertEquals('Primary quote cannot be marked non-primary', e.getDmlMessage(0)); System.assertEquals(SFDC_520_Quote__c.Primary__c, e.getDmlFields(0)[0]); } // To test the second and third examples from the sample application, the // test method asserts that the inserted quote has the proper quote line // data copied from the opportunity line item, and that the quote's total // value is properly calculated. System.assertEquals(1, [select count() from SFDC_520_quoteline__c where quote__c = :q.id]); //delete o; // delete q; // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. SFDC_520_Quote__c q2 = new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true); insert q2; // To test the fifth example from the sample application, the test method // creates a primary quote and then asserts that its Primary field cannot // be deselected. The code uses the try...catch testing idiom to assert // that the error message is correct. //System.assert(![select primary__c from SFDC_520_quote__c where id = :q.id].primary__c); // Can't have the same opportunity marked as primary for the same opportunity // in the same insert/update SFDC_520_Quote__c[] quotes = new SFDC_520_Quote__c[] { new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true), new SFDC_520_Quote__c(opportunity__c = o.id, primary__c = true)} ; insert quotes; // Finally, the test method performs DML operations on quote line // items to assert that the quote line item values are properly // recalculated when associated values change. SFDC_520_QuoteLine__c qLine = new SFDC_520_QuoteLine__c(quote__c = q.id, product2__c = p.id, unit_price__c = 2.0, Qty_Ordered__c = 2); SFDC_520_QuoteLine__c qLine1 = qLine.clone(); insert qLine; // qLine.unit_price__c = 3.0; // update qLine; delete qLine; // Bulk line item operation insert new SFDC_520_QuoteLine__C[]{qLine1, qLine1.clone()}; // Test that updating the product master color and then updating the quote colors works } }

 

 Any Help would be kindly appreciated...