Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
HTML

<div id="main-content" class="wiki-content group">
	<h1 id="WidgetdeConsultaRápida-Objetivo">
		<span style="color: rgb(0, 51, 102);">Objective</span>
	</h1>
	<p style="line-height: 15.0pt;">
		<span style="font-size: 10.5pt; font-family: Arial, sans-serif;">The<span
			class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Quick Query Widget</span></strong><span
			class="apple-converted-space">&#160;</span>to be provided by<span
			class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Fluig</span></strong> will show the
			user data of<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;"></span>indicators</strong><span
			class="apple-converted-space">&#160;</span>to be defined by the
			business areas for each of the<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">ERPs</span></strong>. This widget
			will obtain information settings and business data through<span
			class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">REST</span></strong><span
			class="apple-converted-space">&#160;</span>services to be implemented
			by each of the segments. For the<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Datasul</span></strong><span
			class="apple-converted-space">&#160;</span> line, the<span
			class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">REST</span></strong><span
			class="apple-converted-space">&#160;</span>service will be provided
			by the<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Datasul Framework</span></strong>,
			which in turn will search the settings and data of each of the
			indicators of a particular<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">BO</span></strong><span
			class="apple-converted-space">&#160;</span>(Business Object
			Progress). These<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">BOs</span></strong><span
			class="apple-converted-space">&#160;</span>must be implemented by the
			business areas responsible for the indicators.
		</span>
	</p>
	<p style="line-height: 15.0pt;">
		<span style="font-size: 10.5pt; font-family: Arial, sans-serif;">The<span
			class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Quick Query Widget</span></strong><span
			class="apple-converted-space">&#160;</span>will be similar to the
			form in<span class="apple-converted-space">&#160;</span><strong><span
				style="font-family: Arial, sans-serif;">Figure 1</span></strong><span
			class="apple-converted-space">&#160;</span>below.
		</span>
	</p>
	<p>&#160;</p>
	<p style="line-height: 15.0pt;">
		<span style="font-size: 10.5pt; font-family: Arial, sans-serif;">You
			can access a prototype of the Quick Query widget screen through the
			link&#160;<a
			href="http://cassino:8180/integration/static/quicksearch/index.html?indicator=1"
			class="external-link" rel="nofollow">http://cassino:8180/integration/static/quicksearch/index.html?indicator=</a><a
			href="http://jvd009436:8280/totvs-monitor/quicksearch/index.html?indicator=1"
			class="external-link" rel="nofollow">X</a>XXX where XXXX must be the
			code of the registered indicator.
		</span>
	</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image"
			src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A44%3A27.png?version=1&modificationDate=1408056262000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A44%3A27.png?version=1&modificationDate=1408056262000&api=v2"><br /> <strong>Figure
			1</strong>
	</p>
	<h1 style="text-align: left;"
		id="WidgetdeConsultaRápida-Cadastrodeindicadores">
		<span style="color: rgb(0, 51, 102);">Indicator register</span>
	</h1>
	<p style="text-align: left;">
		<span
			style="font-size: 10.5pt; line-height: 107.0%; font-family: Arial, sans-serif;">The
			<strong>indicators</strong> must be registered in <strong>GOLD</strong>
			under the option<span><strong> “ENG20065 – Quick
					Query Indicator Register”</strong>&#160;</span>as shown in<span
			class="apple-converted-space">&#160;</span><span><strong>Figure
					2</strong>.</span>
		</span><span
			style="font-size: 10.5pt; line-height: 107.0%; font-family: Arial, sans-serif;">&#160;</span>
	</p>
	<p style="text-align: center;">
		<strong style="text-align: center;"><img
			class="confluence-embedded-image"
			src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A45%3A32.png?version=1&modificationDate=1408056327000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A45%3A32.png?version=1&modificationDate=1408056327000&api=v2"></strong>
	</p>
	<p style="text-align: center;">
		<strong style="text-align: center;">Figure 2</strong>
	</p>
	<p>
		Once the <strong>indicator</strong> register routine is accessed, <strong>GOLD
		</strong>will open the initial screen, as shown in <strong>Figure<strong>
				3.</strong></strong>
	</p>
	<p style="text-align: left;">.</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image"
			src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A45%3A55.png?version=1&modificationDate=1408056349000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A45%3A55.png?version=1&modificationDate=1408056349000&api=v2"><br /> <strong>Figure
			3</strong>
	</p>
	<p>
		<strong>Figure<strong> 3 </strong></strong><strong>shows the
			following actions:</strong>
	</p>
	<ul>
		<li><strong>Add: </strong>Enables the fields for the registration
			of a new <strong>indicator.</strong></li>
		<li><strong>Modify: </strong>Allows the<strong> </strong>editing<strong>
		</strong>of a <strong>previously selected </strong>indicator.</li>
		<li><strong>Copy Version:</strong> Creates a replica of an <strong></strong>&#160;indicator
			of <strong>Innovation</strong>(79) to <strong></strong>Supportability(69).</li>
		<li><strong>Delete:</strong> Removes the <strong>indicator.</strong></li>
		<li><strong>Search: </strong>Performs the search for <strong>indicators.</strong></li>
		<li><strong>First, Previous, Next, Last: </strong>Navigates
			between <strong>indicator</strong> records.</li>
		<li><strong>List:</strong> Opens a list screen with all<strong>
				indicators.</strong></li>
		<li><strong>Export: </strong>Exports <strong>indicators&#160;</strong>in
			a <strong>fluig_indic.d</strong> file.</li>
	</ul>
	<p>
		When choosing the option A<strong>dd</strong>, <strong>GOLD </strong>will
		enable the fields for addition as shown in <strong>Figure 4.</strong>
	</p>
	<p style="text-align: left;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A46%3A17.png?version=1&modificationDate=1408056372000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A46%3A17.png?version=1&modificationDate=1408056372000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 4</strong>
	</p>
	<p>
		As shown in <strong>Figure 4</strong>, the following fields are
		available for addition:
	</p>
	<ul>
		<li style="list-style-type: none; background-image: none;"><ul>
				<li><strong>Sub Product: </strong>Indicates for which
					sub-product the indicator will be issued</li>
				<li><strong>Package: </strong><strong>Indicates in
						which package the </strong><strong>indicator</strong> will be released</li>
				<li><strong>Indicator:&#160;</strong>Sequential field which
					will identify the indicator. (Generated automatically)</li>
				<li><strong>BO Name:</strong>&#160;The name of the BO
					(ex:&#160;<strong>fluig/qs/user.p</strong>) that will be
					responsible for providing the settings information and the records
					for the indicator at hand must be entered. Further in this document
					we will see the details for implementation of this BO.</li>
				<li><strong>Description of indicator:</strong>&#160;Description
					of indicator that will be used to display it in the <strong>Fluig</strong>
					<strong>Quick Query</strong> widget.</li>
				<li><p>
						<strong>Records per Page:</strong>&#160;Number of records that
						will be displayed in the <strong>Fluig</strong> <strong>Quick
							Query</strong> widget. </strong>The widget will perform the automatic page break
						according to the number of records to be displayed.
					</p></li>
				<li><p>
						<strong>Has cache:</strong>&#160;indicates whether the browse will
						cache the data.
					</p></li>
				<li><p>
						<strong>Time of data in memory:</strong>&#160;time, in seconds,
						that the browser will keep the cache.
					</p></li>
				<li><strong>Custom BO:</strong>&#160;If a customization is
					required, the custom BO name must be entered in this field. This BO
					must implement the same procedures as a default BO, as described
					below.</li>
				<li><strong>Autocomplete:</strong>&#160;checkbox indicating if
					autocomplete is enabled for this <strong>indicator</strong>.<br />
					<br /></li>
			</ul></li>
	</ul>
	<p>
		<span>For product 69, the current package is 60 – 12.1.1, which
			will already be recommended. The screen does not allow registration
			in a higher package. 
	</p>
	<p>
		<span>If the user registers in a package below the official
			one, the screen will display a message informing that a higher
			package is available, and that this record must also be registered in
			the official package.</span>
	</p>
	<p>
		<span>&#160;</span>
	</p>
	<p>
		<span>In the export option, the analyst must select for which
			subproduct and package the indicators should be exported, as shown in<span
			class="apple-converted-space">&#160;</span><strong><span>Figure
					5</span></strong>.
		</span>
	</p>
	<p>
		<span>After exporting, a fluig_indic.d file will be created,
			and a version of it copied to the TSF of the univdata folder
			($/FOUNDATION/Fontes_Doc/Sustentacao/V11/V11/progress/src/univdata)</span>
	</p>
	<p>
		<span><span style="color: red;">NOTE: The analyst is
				entirely responsible for this commit in the univdata folder</span></span><span>&#160;</span>
	</p>
	<p>&#160;</p>
	<p style="text-align: center;">
		<strong><img class="confluence-embedded-image"
			src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A47%3A40.png?version=1&modificationDate=1408056455000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-14%2019%3A47%3A40.png?version=1&modificationDate=1408056455000&api=v2"></strong>
	</p>
	<p style="text-align: center;">
		<strong>Figure 5</strong>
	</p>
	<p style="text-align: left;">&#160;</p>
	<h1 id="WidgetdeConsultaRápida-Importandoindicadores">
		<span style="color: rgb(0, 51, 102);">Importing indicators</span>
	</h1>
	<p>
		After the indicators are exported (fluig_indic.d), they must also be
		imported within <strong>Datasul</strong>. This procedure may be
		performed through the menu &#160;(Foundation --> Basic (NPS) --> Tasks
		--> Importing Quick Queries).
	</p>
	<p>
		When accessing this menu item,&#160;<strong>Datasul&#160;</strong>will
		open an import quick query screen, as shown in&#160;<strong>Figure
			6.</strong>
	</p>
	<p style="text-align: left;">
		<strong><strong style="text-align: center;"><img
				class="confluence-embedded-image image-center"
				src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-15%208%3A57%3A56.png?version=1&modificationDate=1408103870000&api=v2"
				data-image-src="http://tdn.totvs.com/download/attachments/107940104/image2014-8-15%208%3A57%3A56.png?version=1&modificationDate=1408103870000&api=v2"></strong></strong>
	</p>
	<p style="text-align: center;">
		<strong>Figure 6</strong>
	</p>
	<p style="text-align: left;">In this screen, simply enter the
		location of the fluig_indic.d file and import it.</p>
	<h2 style="text-align: left;"
		id="WidgetdeConsultaRápida-ServiçoRESTeBOsdeIndicadores">
		<strong>REST Service and BOs of Indicators</strong>
	</h2>
	<p style="text-align: left;">
		The <strong>Quick Query Widget </strong> will use a <strong>REST</strong>
		service available at <strong>Datasul</strong> to obtain the data
		required for the indicator. In turn, this <strong>REST</strong>
		service will obtain the information and data of each indicator through
		the indicator register and of a <strong>BO </strong>linked to the
		indicator.
	</p>
	<p style="text-align: left;">
		To assist in the process of developing the BO, the include&#160;<strong>i_fluig_indicator.i&#160;</strong>was
		created, and will contain all default temp-tables to be used in the
		procedures. In order to use this include, simply import it in the
		beginning of the BO by inserting the following line:
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<th class="confluenceTh">{include/i_fluig_indicator.i}</th>
				</tr>
			</tbody>
		</table>
	</div>
	<p style="text-align: left;">
		<span style="font-size: 10.0pt; line-height: 13.0pt;">Each </span><strong
			style="font-size: 10.0pt; line-height: 13.0pt;">BO</strong><span
			style="font-size: 10.0pt; line-height: 13.0pt;"> of an
			indicator must implement the </span><strong
			style="font-size: 10.0pt; line-height: 13.0pt;">procedures</strong><span
			style="font-size: 10.0pt; line-height: 13.0pt;"> described
			below:</span>
	</p>
	<p style="text-align: left;">
		<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
	</p>
	<h3
		id="WidgetdeConsultaRápida-NomedaProcedure:pi-obtem-campos-entidade-pai">
		<strong style="font-size: 10.0pt; line-height: 13.0pt;">Procedure
			Name:</strong><span style="font-size: 10.0pt; line-height: 13.0pt;">&#160;</span><span
			style="color: rgb(255, 0, 0);"><strong>pi-obtem-campos-entidade-pai</strong></span>
	</h3>
	<p>
		<strong>Description:</strong> returns the list of columns of the
		parent entity to populate the upper left combobox of the widget (<strong>Figure
			1</strong>).
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>ttParentFields:</strong> temp-table with the
			code/label list. Should contain only the items that the user is
			allowed to query (TEMP-TABLE – OUTPUT type)</li>
	</ul>
	<p style="margin-left: 30.0px;">&#160;&#160;&#160;&#160;&#160;&#160;
		TEMP-TABLE fields:</p>
	<ul style="list-style-type: square;">
		<li style="margin-left: 60.0px;">ccode: CHARACTER - field code</li>
		<li style="margin-left: 60.0px;">clabel: CHARACTER - field label</li>
	</ul>
	<div>
		<strong>Example of procedure:&#160;</strong>
	</div>
	<div>
		<p>&#160;</p>
		<div class="table-wrap">
			<table class="confluenceTable">
				<tbody>
					<tr>
						<td class="confluenceTd"><p>/* Procedure
								pi-obtem-campos-entidade-pai */</p>
							<p>PROCEDURE pi-obtem-campos-entidade-pai:</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								DEFINE INPUT PARAMETER user AS CHARACTER NO-UNDO.</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								DEFINE INPUT PARAMETER company AS CHARACTER NO-UNDO.</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								DEFINE OUTPUT PARAMETER TABLE FOR ttParentFields.</p>
							<p>&#160;</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								CREATE ttParentFields.</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ASSIGN ttParentFields.ccode = "des_grp_usuar"</p>
							<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ttParentFields.clabel = "Grupo".</p>
							<p>END PROCEDURE</p></td>
					</tr>
				</tbody>
			</table>
		</div>
		<p>&#160;</p>
	</div>
	<h3 id="WidgetdeConsultaRápida-NomedaProcedure:pi-obtem-colunas">
		<strong>Procedure Name: <span style="color: rgb(255, 0, 0);">pi-obtem-colunas</span></strong>
	</h3>
	<p>
		<strong>Description:</strong> returns a <strong>Column Model</strong>
		list of the columns to be displayed in the quick query widget grid.
		This information will be used by the service to assemble the <strong>colModel</strong>,
		comprising the response <strong>JSON</strong>.
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>ttColumnModel:</strong> temp-table with the settings
			data for the Grid columns. Should contain only the columns that the
			user is allowed to query (TEMP-TABLE – OUTPUT type)</li>
	</ul>
	<p style="margin-left: 30.0px;">&#160;&#160;&#160;&#160;&#160;&#160;
		TEMP-TABLE fields:</p>
	<ul>
		<li style="list-style-type: none;"><ul>
				<li>cname: CHARACTER - column name</li>
				<li>cindex: CHARACTER - column index</li>
				<li>clabel: CHARACTER - column name</li>
				<li>lsortable: LOGICAL - indicates whether the user can sort by
					column</li>
				<li>iwidth: INTEGER - column width, in pixels</li>
				<li>calign: CHARACTER - column alignment (left, center or
					rigth)</li>
				<li>csorttype: CHARACTER - sorting type (asc or dec)</li>
				<li>cformatter: CHARACTER - formatter type, e.g.: date</li>
				<li>cdatefmt: CHARACTER - date field format, e.g.: "d-M-Y"</li>
				<li>lshowOnGrid:LOGICAL - indicates whether this field should
					be displayed in grid (default option = true)</li>
				<li>cdefault-value: CHARACTER - default value for field.</li>
			</ul></li>
	</ul>
	<div>
		For further informations, please refer to the colModel component,
		cformatter of jqGrid, at:&#160;<a
			href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options"
			class="external-link" rel="nofollow">http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options</a>
	</div>
	<p>
		When opening a related action in a Progress program, include a column
		named <strong>rowid</strong> in the procedure return.&#160;
	</p>
	<p>
		<strong>Example of procedure:</strong>
	</p>
	<div class="table-wrap">
		<table class="MsoTableGrid confluenceTable">
			<tbody>
				<tr>
					<td
						style="width: 424.7pt; border: solid windowtext 1.0pt; padding: 0.0cm 5.4pt 0.0cm 5.4pt;"
						valign="top" width="566" class="confluenceTd"><p
							class="MsoNormal" style="line-height: normal;">/* Procedure
							pi-obtem-colunas */</p>
						<p class="MsoNormal" style="line-height: normal;">PROCEDURE
							pi-obtem-colunas:</p>
						<p class="MsoNormal" style="line-height: normal;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE INPUT PARAMETER cusuario AS CHARACTER NO-UNDO.</p>
						<p class="MsoNormal" style="line-height: normal;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE INPUT PARAMETER cempresa AS CHARACTER NO-UNDO.</p>
						<p class="MsoNormal" style="line-height: normal;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE OUTPUT PARAMETER TABLE FOR ttColumnModel.</p>
						<p class="MsoNormal" style="line-height: normal;">&#160;</p>
						<p class="MsoNormal" style="line-height: normal;">
							&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							<span>CREATE ttColumnModel.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ASSIGN ttColumnModel.cname = "cod_usuario"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.clabel = "Usuário"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.cindex = "cod_usuario"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.iwidth = 160</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.lsortable = TRUE.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								CREATE ttColumnModel.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ASSIGN ttColumnModel.cname = "nom_usuario"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.clabel = "Nome"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.cindex = "nom_usuario"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.iwidth = 250</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.lsortable = TRUE.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								CREATE ttColumnModel.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ASSIGN ttColumnModel.cname = "ind_tip_usuar"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.clabel = "Tipo"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.cindex = "ind_tip_usuar"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.iwidth = 160.</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								CREATE
								ttColumnModel.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								ASSIGN ttColumnModel.cname = "rowid"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.clabel = "Rowid"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; ttColumnModel.cindex = "rowid"</span>
						</p>
						<p class="MsoNormal" style="line-height: normal;">
							<span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
								&#160;&#160; </span>ttColumnModel.iwidth = 100.
						</p>
						<p class="MsoNormal" style="line-height: normal;">END
							PROCEDURE.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>
		<strong><br /></strong>
	</p>
	<h3 id="WidgetdeConsultaRápida-NomedaProcedure:pi-obtem-lista-selecao">
		<strong>Procedure Name: <span style="color: rgb(255, 0, 0);">pi-obtem-lista-selecao</span></strong>
	</h3>
	<p>
		<strong>Description:</strong> returns a list of items to comprise the
		selectionValues in the response JSON, which will be used to populate
		the upper right combobox of the widget (<strong>Figure 1</strong>).
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>ttSelectionValues:</strong> temp-table with the list
			of filters (selection values). Should contain only the items that the
			user is allowed to query (TEMP-TABLE – OUTPUT type)</li>
	</ul>
	<p style="margin-left: 30.0px;">&#160;&#160;&#160;&#160;&#160;&#160;
		TEMP-TABLE fields:</p>
	<ul>
		<li style="list-style-type: none;"><ul>
				<li>ccode: CHARACTER - field code</li>
				<li>clabel: CHARACTER - field label</li>
			</ul></li>
	</ul>
	<p>
		<strong>Example of procedure:</strong>
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>/* Procedure
							pi-obtem-lista-selecao */</p>
						<p>PROCEDURE pi-obtem-lista-selecao:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE INPUT PARAMETER user AS CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE INPUT PARAMETER company AS CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							DEFINE OUTPUT PARAMETER TABLE FOR ttSelectionValues.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							CREATE ttSelectionValues.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ASSIGN ttSelectionValues.ccode = "AUSR"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttSelectionValues.clabel = "Todos os usuários".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							CREATE ttSelectionValues.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ASSIGN ttSelectionValues.ccode = "OADM"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttSelectionValues.clabel = "Apenas Administradores".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							CREATE ttSelectionValues.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ASSIGN ttSelectionValues.ccode = "OSUP"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttSelectionValues.clabel = "Apenas Super".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							CREATE ttSelectionValues.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ASSIGN ttSelectionValues.ccode = "OCOM"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttSelectionValues.clabel = "Apenas Super".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							CREATE ttSelectionValues.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ASSIGN ttSelectionValues.ccode = "OSPV"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttSelectionValues.clabel = "Apenas Supervisores".</p>
						<p>END PROCEDURE.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>
		<strong><br /></strong>
	</p>
	<h1
		id="WidgetdeConsultaRápida-NomedaProcedure:pi-obtem-acoes-relacionadas">
		<strong style="font-size: 10.0pt; line-height: 13.0pt;">Procedure
			Name: <span style="color: rgb(255, 0, 0);">pi-obtem-acoes-relacionadas</span>
		</strong>
	</h1>
	<p>
		<strong>Description:</strong> returns a list of items to comprise
		relatedActions item in the response JSON, which will be used to
		populate the Related Actions combo (<strong>Figure 1</strong>).
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>ttRelatedActions:</strong> temp-table with the list
			of related indicators. Should contain only the items that the user is
			allowed to query (TEMP-TABLE – OUTPUT type)</li>
	</ul>
	<p style="margin-left: 30.0px;">&#160;&#160;&#160;&#160;&#160;&#160;
		TEMP-TABLE fields:</p>
	<ul>
		<ul>
			<li>clabel: CHARACTER - field label</li>
			<li>ctype: CHARACTER - type of form to be opened. Possible
				values (md, flex or progress)</li>
			<li>cmodule: CHARACTER - module to be opened</li>
			<li>cprogram: CHARACTER - program to be opened</li>
			<li>cviewtype: CHARACTER - type of screen format to be opened.
				Used for ctype=md or ctype=flex. Possible values (portlet,view and
				window)</li>
			<li>crowid: CHARACTER - should be used to inform the field that
				will represent the rowid to related entities.&#160;</li>
		</ul>
	</ul>
	<div>
		<span style="color: rgb(0, 0, 0);">If the application being
			opened is of Metadata type, the form must be registered in the
			application Menu.</span>
	</div>
	<p>With this information, the URLs will be assembled according to
		the formats below:</p>
	<p>
		<u>Progress:</u>
	</p>
	<p>
		<a
			href="http://10.80.5.40:8080/abl-external-call/execute?module=sec&amp;program=sec000aa.w&amp;user=13"
			class="external-link" rel="nofollow">http://10.80.5.40:8080/abl-external-call/execute?module=sec&amp;program=sec000aa.w&amp;user=framework</a>
	</p>
	<p>
		<u>Metadata:</u>
	</p>
	<p>
		<a
			href="http://10.80.5.40:8080/josso/signon/externalUserAuthentication.do?josso_cmd=external-login&amp;type=md&amp;fromFluig=true&amp;program=fnd.CRUDUsuarMestre&amp;viewtype=view&amp;userid=framework&amp;password=ZnJhbWV3b3Jr="
			class="external-link" rel="nofollow">http://10.80.5.40:8080/josso/signon/externalUserAuthentication.do?josso_cmd=external-login&amp;type=md&amp;fromFluig=true&amp;program=fnd.CRUDUsuarMestre&amp;viewtype=view&amp;userid=framework&amp;password=ZnJhbWV3b3Jr=</a>
	</p>
	<p>
		<u>Flex:</u>
	</p>
	<p>
		<a href="http://serverport" class="external-link" rel="nofollow">http://server:port/josso/signon/externalUserAuthentication.do?josso_cmd=external-login&amp;type=frwk&amp;module=fnd&amp;</a><a
			href="http://10.80.5.40:8080/josso/signon/externalUserAuthentication.do?josso_cmd=external-login&amp;type=md&amp;fromFluig=true&amp;program=fnd.CRUDUsuarMestre&amp;viewtype=view&amp;userid=framework&amp;password=ZnJhbWV3b3Jr="
			class="external-link" rel="nofollow">fromFluig=true</a><a
			href="http://serverport" class="external-link" rel="nofollow">&amp;program=datasul-calculatorportlet-flex&amp;viewtype=portlet&amp;userid=super&amp;password=c3N6a0AxMjM=</a>
	</p>
	<p>Details of how to assemble the URLs, query the document:</p>
	<p>
		<a href="81789202.html">Invoking Applications and Forms on Datasul
			through Fluig 
	</p>
	<p>
		<strong>Example of procedure:</strong>
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>/* Procedure
							pi-obtem-acoes-relacionadas */</p>
						<p>PROCEDURE pi-obtem-acoes-relacionadas:</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER user AS CHARACTER
							NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER company AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; DEFINE OUTPUT PARAMETER TABLE FOR
							ttRelatedActions.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; CREATE ttRelatedActions.</p>
						<p>&#160;&#160;&#160; ASSIGN ttRelatedActions.clabel =
							"Exemplo Progress"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.ctype = "progress"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cmodule = "sec"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cprogram = "sec000aa.w".</p>
						<p>&#160;&#160;&#160; CREATE ttRelatedActions.</p>
						<p>&#160;&#160;&#160; ASSIGN ttRelatedActions.clabel =
							"Exemplo Metadados"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.ctype = "md"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cprogram = "fnd.CRUDUsuarMestre"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cviewtype = "view".&#160;&#160;</p>
						<p>&#160;&#160;&#160; CREATE ttRelatedActions.</p>
						<p>&#160;&#160;&#160; ASSIGN ttRelatedActions.clabel =
							"Exemplo Flex"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.ctype = "flex"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cmodule = "fnd"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cprogram = "datasul-calculatorportlet-flex"</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							ttRelatedActions.cviewtype = "portlet".</p>
						<p>END PROCEDURE.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<h3 id="WidgetdeConsultaRápida-NomedaProcedure:pi-obtem-auto-complete">
		<strong>Procedure Name: <span style="color: rgb(255, 0, 0);">pi-obtem-auto-complete</span></strong>
	</h3>
	<p>
		<strong>Description:</strong> performs a search in the data bank to
		return a list of items that will be used to populate the combobox of
		the auto-complete in the Quick Query widget.
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>csearchfield:</strong> Identifier of the master table
			column to be used in the search (CHARACTER - INPUT type).</li>
		<li><strong>csearchvalue:</strong> Text for search (CHARACTER -
			INPUT type).</li>
		<li><strong>cselection:</strong>&#160;widget selection field
			(CHARACTER – INPUT type).</li>
		<li><strong>clist:</strong> string containing a list of values
			found, where each item must be separated by |||| (four pipes) -
			(LONGCHAR – OUTPUT type).</li>
	</ul>
	<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
		Example:&#160; “Fin. Administrator|||| TOTVS Administrator”.</p>
	<p>
		<strong>Example of procedure:</strong>
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>PROCEDURE
							pi-obtem-auto-complete:</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER user AS CHARACTER
							NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER company AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csearchfield AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csearchvalue AS
							CHARACTER NO-UNDO.</p>
						<p>
							<span> DEFINE INPUT PARAMETER cselection AS CHARACTER
								NO-UNDO.</span>
						</p>
						<p>&#160;&#160;&#160; DEFINE OUTPUT PARAMETER clist AS
							LONGCHAR NO-UNDO.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; IF csearchvalue = ? THEN</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ASSIGN
							csearchvalue = "".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hQuery&#160; AS
							HANDLE&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hbuffer AS HANDLE&#160;
							NO-UNDO.</p>
						<p>&#160;&#160;</p>
						<p>&#160;&#160;&#160; CREATE BUFFER hbuffer FOR TABLE
							"EMSFND.GRP_USUAR".</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; CREATE QUERY hQuery.</p>
						<p>&#160;&#160;&#160; hQuery:SET-BUFFERS(hbuffer).</p>
						<p>&#160;&#160;&#160; hQuery:QUERY-PREPARE("FOR EACH GRP_USUAR
							WHERE " + csearchfield +&#160; " MATCHES '*" + csearchvalue +
							"*'").</p>
						<p>&#160;&#160;&#160; hQuery:QUERY-OPEN.</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; HQUERY:GET-FIRST().</p>
						<p>&#160;&#160;&#160; REPEAT WHILE hbuffer:AVAIL:&#160;</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; IF&#160; clist =
							'' THEN</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							clist = hbuffer:BUFFER-FIELD(csearchfield):BUFFER-VALUE.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ELSE</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							clist = clist + '||||' +
							hbuffer:BUFFER-FIELD(csearchfield):BUFFER-VALUE.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							hQuery:GET-NEXT().&#160;</p>
						<p>&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; hQuery:QUERY-CLOSE().</p>
						<p>&#160;&#160;&#160; DELETE OBJECT hQuery.</p>
						<p>&#160;&#160;&#160; DELETE OBJECT hbuffer.</p>
						<p>&#160;&#160;&#160;</p>
						<p>END PROCEDURE.</p></td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">&#160;</td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>
		<strong><br /></strong>
	</p>
	<p>
		<strong>Procedure Name: <span style="color: rgb(255, 0, 0);">pi-obtem-dados</span></strong>
	</p>
	<p>
		<strong>Description:</strong> performs a search in the data bank to
		return the page of records requested by the widget.
	</p>
	<p>
		<strong>Parameters:</strong>
	</p>
	<ul>
		<li><strong>user:</strong> user identifier for ERP (CHARACTER -
			INPUT type)</li>
		<li><strong>company:</strong> company identifier for ERP
			(CHARACTER - INPUT type)</li>
		<li><strong>csortcol:</strong> name of column used for sorting
			records (CHARACTER - INPUT type).</li>
		<li><strong>csortorder:</strong> record sorting type: asc ou dec
			(CHARACTER - INPUT type).</li>
		<li><strong style="font-size: 10.0pt; line-height: 13.0pt;">csearchfield:</strong><span
			style="font-size: 10.0pt; line-height: 13.0pt;"> column to
				apply filter (CHARACTER - INPUT type).</span></li>
		<li><strong>csearchvalue:</strong> value to apply filter
			(CHARACTER - INPUT type).</li>
		<li><strong>cselection:</strong> widget selection field
			(CHARACTER – INPUT type).</li>
		<li><strong style="font-size: 10.0pt; line-height: 13.0pt;">cfields:</strong><span
			style="font-size: 10.0pt; line-height: 13.0pt;"> longchar that
				contains the columns of data that will be returned in <strong>ttData</strong>.(LONGCHAR
				– OUTPUT type)
		</span></li>
		<li><span style="font-size: 10.0pt; line-height: 13.0pt;"><strong>ttData</strong>:
				Temp-table that contains the search return data. (TEMP-TABLE -
				OUTPUT type)</span></li>
	</ul>
	<div>
		<p style="margin-left: 30.0px;">&#160; TEMP-TABLE fields:</p>
		<ul>
			<li style="list-style-type: none;"><ul>
					<li>crecords: CHARACTER - valus to be presented in the quick
						query widget grid. These values must be separated by "||||" and
						must follow the sequence of the columns defined in the field <strong>cfields</strong>.
					</li>
				</ul></li>
		</ul>
	</div>
	<p>
		<strong>Example of procedure:</strong>
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>/* Procedure pi-obtem-dados */</p>
						<p>PROCEDURE pi-obtem-dados:</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER user AS CHARACTER
							NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER company AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csortcol AS
							CHARACTER NO-UNDO.&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csortorder AS
							CHARACTER NO-UNDO.&#160;</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csearchfield AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER csearchvalue AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE INPUT PARAMETER cselection AS
							CHARACTER NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE OUTPUT PARAMETER cfields AS
							LONGCHAR NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE OUTPUT PARAMETER TABLE FOR
							ttData.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hbusuario&#160;&#160; AS
							HANDLE&#160;&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hbusuariogrpusuario AS
							HANDLE&#160;&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hbgrpusuario AS
							HANDLE&#160;&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE hqusuario&#160;&#160; AS
							HANDLE&#160;&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE
							cwhere&#160;&#160;&#160;&#160;&#160; AS CHARACTER&#160;&#160;
							NO-UNDO INITIAL " FOR EACH usuar_mestre ".</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE cadvwhere&#160;&#160; AS
							CHARACTER&#160;&#160; NO-UNDO INITIAL " FOR EACH grp_usuar WHERE
							grp_usuar.des_grp_usuar MATCHES '*&amp;1*', each usuar_grp_usuar
							WHERE usuar_grp_usuar.cod_grp_usuar = grp_usuar.cod_grp_usuar,
							each usuar_mestre WHERE usuar_mestre.cod_usuario =
							usuar_grp_usuar.cod_usuario ".</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE
							corderby&#160;&#160;&#160; AS CHARACTER&#160;&#160; NO-UNDO
							INITIAL " BY usuar_mestre.".</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE
							iaux&#160;&#160;&#160;&#160;&#160;&#160;&#160; AS
							INTEGER&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE ireposition AS
							INTEGER&#160;&#160;&#160;&#160; NO-UNDO.</p>
						<p>&#160;&#160;&#160; DEFINE VARIABLE ladvanced&#160;&#160; AS
							LOGICAL&#160;&#160;&#160;&#160; NO-UNDO INITIAL FALSE.</p>
						<p>&#160;</p>
						<p>&#160;</p>
						<p>&#160;&#160; /***************************** DEFINING FIELDS
							************************************/</p>
						<p>&#160;&#160;&#160; ASSIGN cfields = "cod_usuario" + "||||"
							+ "nom_usuario" + "||||" + "ind_tip_usuar" + "||||" + "rowid".</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; /* Sorting by column */</p>
						<p>&#160;&#160;&#160; ASSIGN corderby = corderby + csortcol.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; /* Checking the sorting type */</p>
						<p>&#160;&#160;&#160; CASE csortorder:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHEN "desc" THEN
							DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							corderby = corderby + " DESCENDING ".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160; END CASE.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; /* Performing matches for auto-complete
							*/</p>
						<p>&#160;&#160;&#160; IF csearchvalue &lt;> "null" THEN DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; cwhere =
							SUBSTITUTE(cadvwhere,csearchvalue).</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ladvanced =
							TRUE.</p>
						<p>&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; /* Assembling where by the combo column
							*/</p>
						<p>&#160;&#160;&#160; CASE cselection:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHEN "OADM" THEN
							DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							cwhere = cwhere + " &amp;1 usuar_mestre.ind_tip_usuar = 'Admin'
							".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHEN "OSUP" THEN
							DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							cwhere = cwhere + " &amp;1 usuar_mestre.ind_tip_usuar = 'Super'
							".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHEN "OCOM" THEN
							DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							cwhere = cwhere + " &amp;1 usuar_mestre.ind_tip_usuar = 'Comum'
							".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHEN "OSPV" THEN
							DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							cwhere = cwhere + " &amp;1 usuar_mestre.ind_tip_usuar =
							'Supervisor' ".</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160; END CASE.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; IF ladvanced THEN DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; cwhere =
							SUBSTITUTE(cwhere," AND ").</p>
						<p>&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160; ELSE DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; cwhere =
							SUBSTITUTE(cwhere," WHERE ").</p>
						<p>&#160;&#160;&#160; END.</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; /* Finishing assembling where */</p>
						<p>&#160;&#160;&#160; cwhere = cwhere + corderby.</p>
						<p>&#160;&#160;</p>
						<p>&#160;&#160;&#160; /* Assembling the query with dynamic
							buffer */</p>
						<p>&#160;&#160;&#160; CREATE BUFFER hbgrpusuario FOR TABLE
							"EMSFND.grp_usuar".</p>
						<p>&#160;&#160;&#160; CREATE BUFFER hbusuariogrpusuario FOR
							TABLE "EMSFND.usuar_grp_usuar".</p>
						<p>&#160;&#160;&#160; CREATE BUFFER hbusuario FOR TABLE
							"EMSFND.usuar_mestre".</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; CREATE QUERY hqusuario.</p>
						<p>&#160;&#160;&#160;&#160; IF ladvanced THEN DO:</p>
						<p>&#160;&#160;&#160;
							&#160;&#160;&#160;&#160;hqusuario:SET-BUFFERS(hbgrpusuario,hbusuariogrpusuario,
							hbusuario).</p>
						<p>&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;&#160; ELSE DO:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							hqusuario:SET-BUFFERS(hbusuario).</p>
						<p>&#160;&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							&#160;</p>
						<p>&#160;&#160;&#160; hqusuario:QUERY-PREPARE(cwhere).</p>
						<p>&#160;&#160;&#160; hqusuario:QUERY-OPEN().</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; hqusuario:GET-FIRST().</p>
						<p>&#160;</p>
						<p>&#160;&#160;&#160; REPEAT WHILE hbusuario:AVAILABLE:</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; CREATE ttData.</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ASSIGN
							ttData.crecords =
							hbusuario:BUFFER-FIELD("cod_usuario"):BUFFER-VALUE + "||||" +</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							hbusuario:BUFFER-FIELD("nom_usuario"):BUFFER-VALUE + "||||" +</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;hbusuario:BUFFER-FIELD("ind_tip_usuar"):BUFFER-VALUE
							+ "||||" +</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							STRING(hbusuario:ROWID).</p>
						<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;
							hqusuario:GET-NEXT().</p>
						<p>&#160;&#160;&#160; END.</p>
						<p>&#160;&#160;&#160;</p>
						<p>&#160;&#160;&#160; DELETE OBJECT hqusuario.</p>
						<p>&#160;&#160;&#160; DELETE OBJECT hbusuario.</p>
						<p>END PROCEDURE.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<h1 id="WidgetdeConsultaRápida-DetalhamentodeRegistros">
		<strong>Records Details</strong>
	</h1>
	<p>
		A program can be opened through the <strong>Related Actions</strong>
		combobox to display the details of a record selected on the grid. The
		program to be opened may be of Progress, Metadata or Flex type,
		defined according to the URL returned by the <strong>pi-obtem-acoes-relacionadas</strong>
		procedure. For Metadata forms of CRUDFreeform type, it is not
		necessary to make any changes in the form for it to be opened
		displaying the record selected in the widget grid. For Progress
		programs, Flex forms and Metadata of FreeForm type, some
		implementations are needed, as seen below:
	</p>
	<h3 id="WidgetdeConsultaRápida-FreeForm:">
		<strong><u>FreeForm:</u></strong>
	</h3>
	<p>
		<strong>FreeForm</strong> forms that represent indicators should have
		a script on the creationComplete event of its main container (usually
		a canvas). This script should provide a code similar to the following:
	</p>
	<pre>DEFINE VARIABLE&#160; mdProgram AS CHARACTER.</pre>
	<pre>DEFINE VARIABLE ttPreSelRecord AS TEMP-TABLE.</pre>
	<pre>mdProgram = GET-MD-PROGRAM().</pre>
	<pre>/* Checks if the selected record sent by Fluig (if any)</pre>
	<pre>&#160;&#160; corresponds to the current form */</pre>
	<pre>IF mdProgram = “crm1150.FFIndicadorX” THEN DO:</pre>
	<pre>&#160;&#160;&#160; ttPreSelRecord = GET-PRE-SEL-RECORD().</pre>
	<pre>&#160;&#160;&#160; /* Based on that, we have the record sent by Fluig available at</pre>
	<pre>&#160;&#160;&#160;&#160;&#160;&#160; temp-table ttPreSelRecord, where the field names correspond to the</pre>
	<pre>&#160;&#160;&#160;&#160;&#160;&#160; names defined in the colModel of the start service. The rest of the script <br />       should then prepare the presentation of the record.*/</pre>
	<pre>&#160;&#160;&#160; ...</pre>
	<pre>&#160;&#160;&#160; ...</pre>
	<pre>END.<br /><br />
					</pre>
	<h3 id="WidgetdeConsultaRápida-Flex:">
		<u><strong>Flex:</strong></u>
	</h3>
	<p>
		For the forms implemented in <strong>Flex</strong> that represent
		indicators, developers should make changes to check, when initializing
		the form, the variables <strong>Application.application.parameters.mdProgram</strong>
		and <strong>Application.application.parameters.fluigSelRecord</strong>.
		If these variables have valid values that correspond to the form at
		hand, a detail screen with the available record must be displayed in <strong>fluigSelRecord</strong>.
	</p>
	<p>Example:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>
							<strong>var</strong> fluigSelRecord:Object =
							Application.application.parameters.fluigSelRecord;
						</p>
						<p>
							Alert.show(<strong>"num_pedido:"</strong> +
							fluigSelRecord.num_pedido);
						</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<h3 id="WidgetdeConsultaRápida-Progress:">
		<u><strong>Progress:</strong></u>
	</h3>
	<h4 id="WidgetdeConsultaRápida-ThinTemplate:">Thin Template:</h4>
	<p>Register program:</p>
	<p>
		Definition of include <strong>ut-indicador-tabela.i</strong>:
	</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig1.png?version=1&modificationDate=1388403667000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig1.png?version=1&modificationDate=1388403667000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 3</strong>
	</p>
	<p style="text-align: center;">&#160;</p>
	<p>
		Insert the code below in the procedure <strong>afterDisplayFields</strong>
		to reposition the record selected:
	</p>
	<p>(adjust for the temp-table of the program)</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig2.png?version=1&modificationDate=1388403803000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig2.png?version=1&modificationDate=1388403803000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 4</strong>
	</p>
	<p>&#160;</p>
	<p>
		In the BO of the program, include a procedure that receives the <strong>ROWID</strong>
		of the table, by parameter, to reposition the record:
	</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig3.png?version=1&modificationDate=1388403899000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig3.png?version=1&modificationDate=1388403899000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 5</strong>
	</p>
	<p>&#160;</p>
	<p>
		Program, developed in <strong>Thin Template</strong>, opened with the
		record positioned:
	</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig4.png?version=1&modificationDate=1388403977000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig4.png?version=1&modificationDate=1388403977000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 6</strong>
	</p>
	<p>&#160;</p>
	<h4 id="WidgetdeConsultaRápida-SmartObjects:">SmartObjects:</h4>
	<p>Register program:</p>
	<p>
		Definition of include <strong>ut-indicador-tabela.i</strong>:
	</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig5.png?version=1&modificationDate=1388404130000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig5.png?version=1&modificationDate=1388404130000&api=v2"><strong>Figure
			7</strong>
	</p>
	<p>&#160;</p>
	<p>
		Insert the code below in the <strong> local-initialize</strong>
		procedure for repositioning of the selected record, after the line “<strong>run
			pi-after-initialize.</strong>”:
	</p>
	<pre>IF r-ind-tabela &lt;> ? THEN DO:</pre>
	<pre>&#160;&#160;&#160;&#160;&#160; RUN pi-reposiciona-query IN h_q01fn069 (INPUT r-ind-tabela).</pre>
	<pre>&#160;&#160;&#160;&#160;&#160; ASSIGN r-ind-tabela = ?.</pre>
	<pre>END.</pre>
	<p>&#160;</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig6.png?version=1&modificationDate=1388407827000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig6.png?version=1&modificationDate=1388407827000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 8</strong>
	</p>
	<p>Foundation program, developed in SmartObject, open with the
		record positioned:</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig7.png?version=1&modificationDate=1388407919000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig7.png?version=1&modificationDate=1388407919000&api=v2"><strong>Figure
			9</strong>
	</p>
	<p>&#160;</p>
	<h4 id="WidgetdeConsultaRápida-DWB:">DWB:</h4>
	<p>Register program (base program):</p>
	<p>
		<strong>Step 1:</strong>
	</p>
	<p>
		Make sure that the variable <strong>v_rec_nome_tabela</strong> is
		declared in the program, as shown in the figure below.
	</p>
	<p>
		&#160;<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig8.png?version=1&modificationDate=1388408107000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig8.png?version=1&modificationDate=1388408107000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>&#160;Figure 10</strong>
	</p>
	<p>&#160;</p>
	<p>
		<strong>Step 2:</strong>
	</p>
	<p>
		Use the initial include of the program on DWB, for example, the
		include “ix_p00_@&amp;(program))”, to declare the include of the
		foundation and attribute the following value for the <strong>RECID</strong>
		type variable of the program:
	</p>
	<p>
		&#160;<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig9.png?version=1&modificationDate=1388408216000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig9.png?version=1&modificationDate=1388408216000&api=v2">
	</p>
	<p style="text-align: center;">
		&#160;<strong>Figure 11</strong>
	</p>
	<p>&#160;</p>
	<p>
		To recover the <strong>RECID</strong> of the desired table, you must
		run a comparison of the <strong>ROWID</strong> of the same table with
		the value stored in the variable <strong>r-ind-tabela</strong>, as
		shown in the example below, with the <strong>plano_cta_ctbl</strong>
		table:
	</p>
	<pre>&#160;</pre>
	<pre>{utp/indicador-tabela.i}</pre>
	<pre>IF r-ind-tabela &lt;> ? THEN DO:</pre>
	<pre>&#160;&#160;&#160; FIND FIRST plano_cta_ctbl NO-LOCK</pre>
	<pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE ROWID(plano_cta_ctbl) = r-ind-tabela NO-ERROR.</pre>
	<pre>&#160;&#160;&#160; IF AVAIL plano_cta_ctbl THEN DO:</pre>
	<pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ASSIGN v_rec_plano_cta_ctbl = RECID(plano_cta_ctbl).</pre>
	<pre>&#160;&#160;&#160; END.</pre>
	<pre>&#160;&#160;&#160; ASSIGN r-ind-tabela = ?.</pre>
	<pre>END.</pre>
	<p>
		&#160;<strong><img
			class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig10.png?version=1&modificationDate=1388408349000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig10.png?version=1&modificationDate=1388408349000&api=v2"></strong>
	</p>
	<p style="text-align: center;">
		&#160;<strong>Figure 12</strong>
	</p>
	<p>&#160;</p>
	<p>
		<strong>Step 3:</strong>
	</p>
	<p>
		Since the main-block of the core program on DWB already features the
		search in the main table of the program by the <strong>RECID</strong>
		of the variable<strong> v_rec_nome_tabela</strong>, the developer will
		not have to perform the positioning.
	</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig11.png?version=1&modificationDate=1388408442000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig11.png?version=1&modificationDate=1388408442000&api=v2">&#160;
	</p>
	<p style="text-align: center;">
		&#160;<strong>Figure 13</strong>
	</p>
	<p>&#160;</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig12.png?version=1&modificationDate=1388408508000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig12.png?version=1&modificationDate=1388408508000&api=v2"><strong>Figure
			14</strong>
	</p>
	<p>&#160;</p>
	<p>EMS5 program, developed in DWB, opened with the selected record:</p>
	<p style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/107940104/fig13.png?version=1&modificationDate=1388408590000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/107940104/fig13.png?version=1&modificationDate=1388408590000&api=v2"><strong>Figure
			15</strong>
	</p>
	<p>&#160;</p>
	<h1 id="WidgetdeConsultaRápida-DicasdeDesenvolvimento:">Development
		tips:</h1>
	<p>
	<div class="office-container">
		<a
			href="/plugins/servlet/confluence/editinword/107940104/attachments/TratativasConsultaRapida.docx"
			class="confluence-button office-editable" data-use-path-auth="false">Edit
			Document</a>
		<div class="office-document">
			<div>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold; text-decoration: underline">Handling
						information in Quick Query</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">Initially,
						a quick query should bring the least information as possible,
						therefore the initial filter should be as restrictive as possible.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">The
						first filter of the list will be considered as the initial Search
						and initial Filter, therefore the first search should be one that
						you will use the most and the first filter should be the most
						restrictive. </span>
				</p>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<img src="http://tdn.totvs.com/plugins/servlet/benryanconversion?pageId=107940104&attachment=TratativasConsultaRapida.docx&name=152700088&val=/image-1.png" width="641"
						height="213" alt="" />
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">For
						greater security, the moment the search is made, some controls
						should be performed in relation to the parameters received. In
						addition, in order to facilitate debugging, log generation
						parameters should be included at the beginning of the event.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">In
						short, the beginning of the PI “pi-get-data” must be as seen
						below:</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">PROCEDURE
						pi-obtem-dados:</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER user&#160;&#160;&#160;&#160;&#160; AS
						CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER company&#160;&#160;&#160;&#160;&#160;
						AS CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER csortcol&#160;&#160;&#160;&#160; AS
						CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER csortorder&#160;&#160; AS CHARACTER
						NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER csearchfield AS CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE INPUT&#160; PARAMETER csearchvalue AS CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">DEFINE
						INPUT&#160; PARAMETER cselection&#160;&#160; AS CHARACTER NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE OUTPUT PARAMETER cfields&#160;&#160;&#160;&#160;&#160; AS
						LONGCHAR&#160; NO-UNDO.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						DEFINE OUTPUT PARAMETER TABLE FOR ttData.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						IF LOG-MANAGER:LOGGING-LEVEL > 2 THEN DO:</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("Requisição QuickSearch
						recebida.",&#160;&#160;&#160;&#160;&#160; "FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("usuario&#160;&#160;&#160;&#160; : " +
						STRING(user),&#160;&#160;&#160;&#160;&#160; "FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("empresa&#160;&#160;&#160;&#160; : " +
						STRING(company),&#160;&#160;&#160;&#160;&#160; "FLUIGQS")
						NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("empresa&#160;&#160;&#160;&#160; : " +
						STRING(company),&#160;&#160;&#160;&#160;&#160; "FLUIGQS")
						NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("csortorder&#160; : " +
						STRING(csortorder),&#160;&#160; "FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("csearchfield: " + STRING(csearchfield),
						"FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("csearchvalue: " + STRING(csearchvalue),
						"FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						LOG-MANAGER:WRITE-MESSAGE("cselection&#160; : " +
						STRING(cselection),&#160;&#160; "FLUIGQS") NO-ERROR.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						END.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						run pi-get-padrao (input-output csearchfield, input &lt;LISTA
						BUSCA>).</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">/*
						&lt;LISTA BUSCA> = List, separated by comma, of items created in
						the PI "pi-obtem-campos-entidade-pai"</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						Example = "cod_tit_ap,cod_espec_docto,cdn_fornecedor,nom_abrev" */</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">run
						pi-get-padrao (input-output cselection, input &lt;LISTA FILTRO>).</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">/*
						&lt;LISTA FILTRO> = List, separated by comma, of items created in
						the PI "pi-obtem-lista-selecao"</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
						Example = "VENCH,ABERT,ATRAS,ATRAS30,ATRAS15" */</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">if
						csearchvalue = ? or csearchvalue = "null" then</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;&#160;&#160;&#160;
					</span> <span style="font-family: 'Courier New'; font-size: 8pt">assign
						csearchvalue = "".</span>
				</p>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold">At
						the end of the program, the PI “pi-get-padrao” must be added, as
						shown below:</span>
				</p>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">PROCEDURE
						pi-get-padrao:</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						def input-output param p_cod_index as char no-undo.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						def input&#160;&#160;&#160;&#160;&#160;&#160;&#160; param
						p_lst_ops&#160;&#160; as char no-undo.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						if lookup(p_cod_index, p_lst_ops) > 0 then return.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">&#160;&#160;&#160;
						assign p_cod_index = entry(1, p_lst_ops).</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: 'Courier New'; font-size: 8pt">END
						PROCEDURE.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span
						style="font-family: Calibri; font-size: 11pt; font-weight: bold">Auto-Complete
					</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">Even if
						the Search field has no “auto-complete”, this method will always
						be executed when the user types something in the search field.
						Therefore, the implementation of the “pi-obtem-auto-complete”
						method is mandatory.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">For the
						fields that do not have “auto-complete”, the method must return an
						empty list.</span>
				</p>
				<p style="margin: 0pt">
					<span style="font-family: Calibri; font-size: 11pt">&#160;</span>
				</p>
			</div>
		</div>
	</div>
	</p>
	<p class="MsoNormal" style="line-height: normal;">&#160;</p>
</div>