Skip to main content

Is it possible to write a snippet to retrieve quote line items from a quote? The page contains
only Quote Model and a related task table. I would like to copy all quote line item details into a new task description field?

Guys, I figured this out and was able to accomplish this using the ChildRelationship tutorial.
I am yet to see what Skuid cannot accomplish. Great work guys.

I am attaching the code just for others help.

var field = arguments[0],
        value = argumentsg1];

    var quoteId = skuid.page.params.QuoteId;
    var quoteModel = skuid.model.getModel(‘QuoteData’);
    var quote = quoteModel.getRowById(quoteId);
   
    var dt = field.metadata.displaytype;
    if (field.mode != ‘edit’) {
        skuid.ui.fieldRenderers/dt]field.mode;
    } else {
        skuid.ui.fieldRenderersedt].edit(field,value);
    }
   
    var tmpDesc = ‘’;
    for(i=0;i<quote.QuoteLineItems.totalSize;i++)
    {
        var qli = quote.QuoteLineItems.records+i];
        tmpDesc = tmpDesc + qli.Description + ’

’ + qli.Quantity + ’

’ + qli.UnitPrice + ’

’ + qli.TotalPrice + ’


';
    }
    if(value==null){
      field.model.updateRow(field.row,‘Description’,tmpDesc);
     
      if(field.mode==‘edit’)
      field.element.find(‘input’).val(tmpDesc);
    }


Glad we were able to help.   I was also going to point you to a tutorial where we mass create statements for every contact on an account.  This pulls all the contacts (Children of the account) and creates new statements records for each one.   Lots of concepts are the same:  http://help.skuidify.com/s/tutorials/m/components/l/109496-mass-create-records

Here is shameless request.  We’d love it if you’d copy your second line above as a  review on the app exchange…  Here is the link: https://appexchange.salesforce.com/listingDetail?listingId=a0N30000009wyDjEAI 

Thanks again!


Will definitely post a review as soon as we complete few more pending items in our list
and purchase Skuid Licenses :-)  The only other support of this kind is Rackspace’s Fanatic Support,


Reply