[ic] mv_metadata question

Scott Andreas---Learning Services, Inc interchange-users@interchange.redhat.com
Tue Jan 15 12:45:01 2002


Hello list...

Here is the flow...

When the salesrep logs and the want to create a new contact the salesrep
will go to the create a new contact page where among the data to enter is a
"Combo Select" on the account_group. Is what I want to have listed are the
salesreps accounts only (not all salesreps entries)

For instance:
glenda might have East, West, North
david might have Oregon, California

the only data to show up if glenda is logged in is East, West, North in the
"Combo Select" (not East, West, North, Oregon, California)

Again, I'm using the widget "Combo Select" on the account_group from
mv_metadata

The important database colomns are:
code | salesrep | account_group

So far I have:

[calc]
	$CGI->{viewcontact}=1;
	$CGI->{noshow}=1;

	if($CGI->{contact}) {
		$CGI->{item_id} = $CGI->{contact};
	}
	if(! $CGI->{item_id} and $Session->{arg}) {
		$CGI->{item_id} = $CGI->{contact} = $Session->{arg};
	}
	$CGI->{contact} = $CGI->{item_id} if ! $CGI->{contact};
	return if ! $CGI->{item_id};
	if(! $CGI->{mv_data_table}) {
		$CGI->{ui_hide_key} = 1;
		$CGI->{mv_data_table} = 'contacts';
	}
	if(! $CGI->{ui_data_fields}) {
		$CGI->{ui_data_fields} = <<EOF;

code

=<center>Name</center>
name_title
fname
lname
suffix


=<center>Personal Data</center>
vip_code
budget_code
customer_no
title
department
district
school
phone_day
fax
email
weblinks


=<center>General/Shipping Address</center>
institut
address1
address2
city
state
zip
country

=<center>Billing Address <small>(if different than shipping
address)</small></center>
b_institut
b_fname
b_lname
b_address1
b_address2
b_city
b_state
b_zip
b_country
b_phone

=<center> Showcase Catalog Info.</center>
show_catalog
show_qty
show_recurring

=<center>Specialty  Catalog Info.</center>
catalogs
catalogqty

=<center>Catalog Verfication</center>
lastchecked
verifiedqtydate

=<center>Comment</center>
comment


=<center>User Input</center>
created
updated
createdby
sourcecode
inactive
accounts


EOF
	}

	if(! $CGI->{ui_return_to}){
		$CGI->{ui_return_to} = join "\0",
			'__UI_BASE__/contact_view',
			"contact=$CGI->{item_id}",
			;
	}

$Scratch->{id} = $CGI->{contact};
return;
[/calc]
[if !cgi item_id]
	[bounce page="__UI_BASE__/contact_view" form="customer=[cgi customer]"]
[/if]

[seti var_accounts][query list=1 sql="SELECT distinct salesrep,
account_group FROM contacts WHERE salesrep = '[data session username]'"]
				<option value="[sql-param accounts]">[sql-param accounts]
				[/query]
[/seti]


[set ui_class]Contacts[/set]
[seti page_title]Contact data -- [cgi item_id][/seti]
[seti page_banner]Contact data: <B>[page href="__UI_BASE__/contact_view"
form="customer=[cgi customer]"][cgi customer]</A></B>[/seti]
[set help_name]contact.edit[/set]
[set icon_name]icon_contact.gif[/set]

@_UI_STD_HEAD_@
<P>
[table-editor
	cgi=1
	ui_nextpage="__UI_BASE__/contact_view" form="customer=[cgi customer]"
	ui_return_to="__UI_BASE__/contact_view" form="customer=[cgi customer]"
	override.updated=`$Tag->date({%Y%B%d})`
	override.createdby=`$Session->{username}`
	override.account_group=`[scratch var_accounts]` <---Here is my problem!
	noexport=1
]

@_UI_STD_FOOTER_@
<!-- page: @@MV_PAGE@@-->

If it is possible to do this in MV_METADATA that would be I believe a
preferred method.


Any Help, Ideas or Suggestions would be appreciated

Thanks

J. Scott Andreas :)
IS/Programmer/WebDevelopement
Learning Services, Inc.
e-mail: sandreas@learningservicesinc.com
phone: 1-800-877-9378 ext. 146
fax: (541) 744-2056
      ---    __o
     ---   _-\<,_
      --- (_)/ (_)