Dynamic Field Structure in RTF Files

This appendix covers the following topics:

Overview

This appendix contains details, scenarios, and guidelines for dynamic field creation in RTF files.

Users can add multiple quotes to a proposal. Also, a single quote can have multiple lines. To represent this variance generically in the RTF file, Oracle Proposals seeds Structure Dynamic Fields. These dynamic fields are identified by the prefix PRPSTR in the dynamic field code.

The structure tokens enable users to indicate structure where multiple quotes, lines or other information is expected. Structure tokens are applicable only for designing quote related information in an RTF file.

While quote related dynamic fields can be used outside of control structures, doing so does not enable the parser to repeat the information for all the quotes associated with the proposal. Any quote related dynamic field placed outside the control structure is substituted using the first quote in the proposal.

RTF Representation of a Quote

A quote can be logically represented using the control structure in an RTF file in the following way:

Begin quote

End quote

This structure, when represented in the form of dynamic fields in an RTF file, should be:

<@PRPSTR001:Begin Quote@>

(Quote related dynamic fields are inserted here.)

<@PRPSTR002:End Quote@>

Example of a Quote in an RTF File

Consider the following example:

Proposal: Business Network Proposal. Quotes in the proposal equal 2.

Quote #1:

Quote #2:

Quote Related Dynamic Field Scenarios

Scenario 1: Quote Related Dynamic Field Without, or Outside of, the Control Structure

The following table outlines the RTF representation for a quote related dynamic field without, or outside of the control structure.

Scenario 1: Quote Related Field Without, or Outside Control Structure
Field Token
Quote: <@PRPQOT001:Quote Name@> Proposal: <PRP001:Proposal Name@>
<@PRPQOT044:Product Description@> $<@PRPQOT052:Line Total Selling Price@>

What to expect:

The following table outlines the output for the RTF representation listed earlier.

Scenario 1: Output
Output Data Output Data
Quote: Simple Solution Proposal: Business Network Proposal
Laptop $2500

Because there are no structure tokens, the parser does not know what section is a quote or what must be repeated. When the parser encounters a quote dynamic field it uses the values from the first quote (in this case Simple Solution) to substitute the quote name. For the product description and price, it selects the first line item from the quote.

Scenario 2: Quote Related Dynamic Fields Within the Quote Header Control Structure (But Without the Line Control Structure)

RTF representation:

<@PRPSTR001:Begin Quote@>

The following table outlines the RTF representation of quote related dynamic fields within the quote header control structure.

Scenario 2: Quote Related Fields Within the Header and Control Structure
Field Token
Quote: <@PRPQOT001:Quote Name@> Proposal: <PRP001:Proposal Name@>
<@PRPQOT044:Product Description@> $<@PRPQOT052:Line Total Selling Price@>

<@PRPSTR002:End Quote@>

Note the following changes between scenario 1 and 2: Scenario 1 did not have a begin and end quote header structure. So Oracle Proposals used the first quote information. In this case, the application knows that anything between PRPSTR001 and PRPSTR002 is a quote and must be repeated. Since there are two quotes on this proposal, this structure is repeated twice – once for each quote. But since the structure needed to repeat quote line is not there, Proposals uses the first line item for each quote while generating this RTF file.

The following table outlines the output for the RTF file structure outlined earlier.

Scenario 2: Output
Output Data Output Data
Quote: Simple Solution Proposal: Business Network Proposal
Laptop $2500
Quote: Custom Solution Proposal: Business Network Proposal
Custom Laptop $5000

Scenario 3: Quote Related Dynamic Fields Within the Quote Header and Line Control Structure

RTF representation:

<@PRPSTR001:Begin Quote@>

The following table outlines Scenario 3: Quote Related Dynamic Fields Within the Quote Header and Line Control Structure.

Scenario 3: Quote Related Fields Within the Header and Line Structure
Field Token
Quote: <@PRPQOT001:Quote Name@> Proposal: <PRP001:Proposal Name@> <PRPSTR003:Begin Quote Line@>
<@PRPQOT044:Product Description@> $<@PRPQOT052:Line Total Selling Price@> <PRPSTR004:End Quote Line@>

<@PRPSTR002:End Quote@>

Note the following changes between scenario 2 and 3: Scenario 2 did not have a begin and end quote line structure. So Oracle Proposals used the first quote line information for each quote. In this case, the application knows that anything between PRPSTR003 and PRPSTR004 is a quote line, and must be repeated for each line in the quote. Since there are two quote line for each quote on this proposal, this structure is repeated twice for each quote.

The following table outlines the output for the preceding RTF file.

Scenario 3: Output
Output Data Output Data
Quote: Simple Solution Proposal: Business Network Proposal
Laptop $2500
Desktop $2000
Quote: Custom Solution Proposal: Business Network Proposal
Custom Laptop $5000
Custom Desktop $3500

Control Structure Rules

The following rules must be followed:

Valid

All control structures for a quote should be within begin quote and end quote structure.

If a quote related dynamic field is placed outside of the control structure, the substituted value is used from the first quote.

Invalid

Control structure for quote line, promotional code, and/or contract placed outside of begin quote and end quote structure are invalid.

Valid

Every Begin structure should have its corresponding End structure.

Invalid

Control structures should not overlap. For example, the following is invalid:

There should not be duplicate control structure within an existing one. For example:

Valid

Quote related dynamic fields can be placed anywhere within the begin quote and end quote structure.

If a promotional code dynamic field is placed outside <begin promocode> and <end promocode> structure, the first promotional code of the quote returned by the database is used during generation.

Similarly if a pricing dynamic field is placed outside the <begin quote line> and <end quote line> structure, the first quote line of the quote returned by the database is used during generation.

Valid

<Begin Contract Article> and <End Contract Article> structure fields can be used only within <Begin Contract> and <End Contract> structure.

Example of RTF Document with Dynamic Fields

Following is sample text for an RTF document containing dynamic fields. For this example, a simple cover letter has been created using proposal seeded dynamic fields and two user defined dynamic fields. The user defined dynamic fields enable the user to provide personalized text in the body section and a date dynamic field to add even further personalization.

July XX, 200X

<@PRP007:Contact Name@>

<@PRP006:Customer Name@>

Dear <@PRP007:Contact Name@>,

<@UDF004:Cover Text@>

As a Vision Enterprises customer, you already use our desktops to increase productivity in critical areas of your business. I invite you to review the attachments enumerating some of the key benefits of upgrading your systems. I can be reached at <@PRP013:Sales Rep Phone Number@> or through email at <@PRP015:Sales Rep Email@>.

I would appreciate if we can do a follow-up call on <@UDF006: Follow-up Date@>.

Sincerely,

<@PRP012:Sales Rep Name@>

Account Manager

Vision Enterprises

Warnings

The following are not supported during the merging process and will result in errors. Please note the following:

Common Errors

Be aware of the following common errors: