function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
darthzendarthzen 

Print Anything + Sales Quote with Product Line Items

I added the Sales Quote with Product Line Items (clean install) to my Salesforce instance, and decided to give the Print Anything module a try to get a more presentable format for sending quotes to potential customers.

I followed the instructions in the Excel spreadsheet; creating the package, queries, and the English template.

I then created the custom link and added it to the Quote layout.  When I attempt to run the Print Anything report, I get the following error:

Error : INVALID_TYPE: Didn't understand relationship 'Quote__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.



I'm extremely new to developing in Salesforce, so I'm not even sure where to go looking.  The failure is happening in the "Quote and Line Item" query that is first in the sequence. 

The actual query is:

Select
    s.Id, s.Name,
    s.Opportunity__c,
    s.Presented_Date__c,
    s.Quote_Amount__c,
    s.Valid_Until__c,
    (
        Select
            Ext_Net_Price__c,
            Ext_Price__c,
            Product2__c,
            Qty_Ordered__c,
            Sales_Discount__c,
            Unit_Net_Price__c,
            Unit_Price__c
        From
            Quote__r
    )

from
    SFDC_520_Quote__c s
where
    Id = '{Parameter.quoteId}'
BrianPBell68BrianPBell68
To fix this problem, you will need to go to the Quote Line custom Object, edit the Master/Detail relationship for
the Quote custom field and add "Quote" (no quotation marks) to Child Relationship Name field .... Save.  This should
fix the problem .... it fixed mine.
MikeWiresMikeWires
I was experiencing problems related to relationship queries that would run, but wouldn't display the child object information. The problem was exactly what BrianPBell addressed. The "Child Relationship Name" field needs to be properly populated within the Master Detail object relationship for child relationship queries to display the child results.
 
Thanks for your post Brian!


Mike
BogdanBogdan
Hi Brian,

Thank you for the details on how to fix it. I've actually followed the stepts .. but it seems to have gotten worse.

this is log I got:


Error : INVALID_FIELD: o.Contact.MailingPostalCode, o.Contact.MailingCountry, o.Contact.Preferred_Language__c ^ ERROR at Row:3:Column:128 No such column 'Preferred_Language__c' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
And the query is:

Debug Mode  Reload package  Reload template

loading package meta data

adding merge field - UserInfo.FullName = Bogdan Stefan

adding merge field - UserInfo.Email = email@email.com

adding merge field - UserInfo.OrganizationId = 00D200000001jk3

adding merge field - Parameter.lid = 01N50000000D2sG

adding merge field - Parameter.enc = UTF-8

adding merge field - Parameter.ic = 1

adding merge field - Parameter.debug = 1

adding merge field - Parameter.quoteId = a0V200000004LDg

adding merge field - Parameter.packageId = QuotePrinter

Meta data : 1 Package, 3 query(s), 1 template(s),

1. Select s.Id, s.Name, s.Opportunity__c, s.Presented_Date__c, s.Quote_Amount__c, s.Valid_Until__c, (Select Ext_Net_Price__c, Ext_Price__c, Product2__c, Qty_Ordered__c, Sales_Discount__c, Unit_Net_Price__c, Unit_Price__c From Quote__r) from SFDC_520_Quote__c s where Id = 'a0V200000004LDg'

Result : query response. Count : 1

adding merge field - SFDC_520_Quote__c1.Id = a0V200000004LDg

adding merge field - SFDC_520_Quote__c1.Name = Q-00010

adding merge field - SFDC_520_Quote__c1.Quote_Amount__c = 2000.0

adding merge field - SFDC_520_Quote__c1.Presented_Date__c = Wed Jan 09 2008 00:00:00 GMT+0200 (FLE Standard Time)

adding merge field - SFDC_520_Quote__c1.Opportunity__c = 00620000004JWcD

adding merge field - SFDC_520_Quote__c1.Quote__r.COUNT = 2

adding merge field - SFDC_520_Quote__c1.Quote__r.Ext_Net_Price__c.0 = 1200.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Product2__c.0 = 01t200000009wDx

adding merge field - SFDC_520_Quote__c1.Quote__r.Ext_Price__c.0 = 1200.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Qty_Ordered__c.0 = 2.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Unit_Net_Price__c.0 = 600.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Unit_Price__c.0 = 600.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Ext_Net_Price__c.1 = 800.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Product2__c.1 = 01t20000000EGSB

adding merge field - SFDC_520_Quote__c1.Quote__r.Ext_Price__c.1 = 800.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Qty_Ordered__c.1 = 2.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Unit_Net_Price__c.1 = 400.0

adding merge field - SFDC_520_Quote__c1.Quote__r.Unit_Price__c.1 = 400.0

2. retrieve multi row - Product2:01t200000009wDx

2. retrieve multi row - Product2:01t20000000EGSB

adding merge field - Product22.COUNT = 2

adding merge field - Product22.Id.0 = 01t200000009wDx

adding merge field - Product22.Name.0 = Initial Setup

adding merge field - Product22.ProductCode.0 = SE-IN

adding merge field - Product22.IsActive.0 = true

adding merge field - Product22.CreatedDate.0 = Tue Nov 21 2006 20:09:12 GMT+0200 (FLE Standard Time)

adding merge field - Product22.CreatedById.0 = 00520000000kAFn

adding merge field - Product22.LastModifiedDate.0 = Mon Jan 01 2007 07:21:06 GMT+0200 (FLE Standard Time)

adding merge field - Product22.LastModifiedById.0 = 00520000000kAXc

adding merge field - Product22.SystemModstamp.0 = Mon Jan 01 2007 07:21:06 GMT+0200 (FLE Standard Time)

adding merge field - Product22.Family.0 = Setup

adding merge field - Product22.IsDeleted.0 = false

adding merge field - Product22.Id.1 = 01t20000000EGSB

adding merge field - Product22.Name.1 = Salesforce Implementation (Variable Cost)

adding merge field - Product22.ProductCode.1 = IM-CV

adding merge field - Product22.Description.1 = Standard implementation services (variable cost)

adding merge field - Product22.IsActive.1 = true

adding merge field - Product22.CreatedDate.1 = Sun Dec 31 2006 18:26:54 GMT+0200 (FLE Standard Time)

adding merge field - Product22.CreatedById.1 = 00520000000kAXc

adding merge field - Product22.LastModifiedDate.1 = Mon Jan 01 2007 07:21:06 GMT+0200 (FLE Standard Time)

adding merge field - Product22.LastModifiedById.1 = 00520000000kAXc

adding merge field - Product22.SystemModstamp.1 = Mon Jan 01 2007 07:21:06 GMT+0200 (FLE Standard Time)

adding merge field - Product22.Family.1 = Implementation

adding merge field - Product22.IsDeleted.1 = false

3. Select o.ContactId, o.Contact.FirstName, o.Contact.Phone, o.Contact.Email, o.Contact.Fax, o.Contact.LastName, o.Contact.Title, o.Contact.MailingStreet, o.Contact.MailingCity, o.Contact.MailingState, o.Contact.MailingPostalCode, o.Contact.MailingCountry, o.Contact.Preferred_Language__c from OpportunityContactRole o where o.OpportunityId = '00620000004JWcD'

What should I do? There seems to be something woring, but i can't really understand what. thanks a lot.
travis05travis05
Just delete the o.Contact.Preferred_Language__c reference in the Contact Printer Package.
mlaviamlavia
Hi,

I am trying to follow the same issue here, and it works now, but no quote pops up to print?


Thanks!