1. Is there a way to populate XX custom mail merge Opportunity Fields with only ONE SQL Statement? Store the data needed in a RecordSet......and then go after this recordset in each FIELD call of SLX Mail Merge OnCustomFieldName .....but how do you know to fetch the new data? Right now I do a GETFIELD.....but this is XX number of connections (albeit pooled) and SELECT queries.....ouch.
2. Using oTable and oRange stuff to write a table to the word document..... a) does anyone how to use more custom formats....say Yellow for a header color instead of blue...
b) how do you do Nested Tables? Specifically I have a list of Sites for each Opp Product.... I'd like to print this out as a row of text (Opp Product) and then say 50 rows for the Sites.....the trouble is the next iteration of the Opp Product....I don't have a way to reset oTable, oRange in the same SLX Mail Merge OnCustomFieldName ????
Do I need to do all of this in the SDK?
Thanks! RJ Samp
'''This works, BTW, simply insert a new custom field in the Word Doc 'DE_Opp_ProductsGrid' and insert the code into the FieldName Case Structure of SLX Mail Merge OnCustomFieldName.
Case "DE_Opp_ProductsGrid" 'DNL oRange.InsertAfter "Quantity|Description|List Price|Discounted Price|Total" 'DNL oRange.InsertParagraphAfter If strOpportunityID > "" THEN SET opCN = NEW SLX_DB SET opRS = opCN.GetNewRecordSet oSQL="Select op.QUANTITY, op.LIST_PRICE, op.PRICE, op.EXTENDEDPRICE, p.NAME " & _ "From OPPORTUNITY_PRODUCT op " & _ "Inner Join PRODUCT p " & _ "On (op.PRODUCTID = p.PRODUCTID) " & _ "Where OPPORTUNITYID = '" & strOpportunityID & "' " & _ "Order By op.SORT" 'DNL opRS.OPEN oSQL, opcn.Connection
WHILE NOT(opRS.EOF) QTY = cSTR("" & opRS.Fields(0).VALUE) LIST = FormatCurrency("" & opRS.Fields(1).VALUE) PRICE = FormatCurrency("" & opRS.Fields(2).VALUE) TOTAL = FormatCurrency("" & opRS.Fields(3).VALUE) DESC = "" & opRS.Fields(4).VALUE Application.Debug.WriteLine "Mail Merge Opportunity Products: " & QTY & "|" & DESC & "|" & LIST & "|" & PRICE & "|" & TOTAL oRange.InsertAfter (QTY & "|" & DESC & "|" & LIST & "|" & PRICE & "|" & TOTAL ) oRange.InsertParagraphAfter opRS.MoveNext WEND
SET opRS = NOTHING SET opCN = Nothing '' expression.ConvertToTable(Separator, NumRows, NumColumns, InitialColumnWidth, Format, '' ApplyBorders, ApplyShading, ApplyFont, ApplyColor, ApplyHeadingRows, '' ApplyLastRow, ApplyFirstColumn, ApplyLastColumn, AutoFit, AutoFitBehavior, DefaultTableBehavior) END IF Set oTable = oRange.ConvertToTable("|", , , , wdTableFormat3DEffects1, True, True, FALSE, True, True, _ False, False, False, True, wdAutoFitContent, wdWord9TableBehavior)
|