Custom field in OTRS 5 Ticket - otrs

I want to add a field like Department name in OTRS 5 customer's ticket view.So when they create a new ticket they can select department name.

First of all you need to define new Dynamic Field (if you would like to have predefined options, you should use Dropdown). To do this you need to go to Admin->Dynamic Fields and than in Ticket section you need to choose appropriate type of DF.
Once you have your DF defined you need to go to Sysconfig->Ticket-> Frontend::Customer::Ticket::ViewNew and in Ticket::Frontend::CustomerTicketMessage###DynamicField hash you should add name of DF as key and 1 or 2 as value (setting 2 will make field required on the form).

Related

How to interact with Existing database with Model through template function in Django

I have an existing table called empname in my postgres database
(Projectid,empid,name,Location) as
(1,101,Raj,India),
(2,201,David,USA)
So in the app console it will have like the following
1)Projectid=Textbox
2)Ops =(view,insert,Edit)-Dropdown
Case1:
So if i write project id as 1 and select View Result:It will display all the records for Projectid =1(Here 1 record)
Case2:
If i write projectid as 3 and select insert it will ask for all the inputs like empid,name,address and based on that it will update the table .
Case3:
If i write projectid as 2 and select edit.Then it will show all the field for that id and user can edit any column and can save which will update the records in backend for the existing table
If there is not data found for the respective project id then it will display no records found
Please help me on this as I am stuck up with models
Once you have your models created, the next task should be the form models. I can identify atleast 3 form classes that you will need to create. One to display the information(case 1), another to collect information(case 2) and the last class to edit the information. Wire up the form to the views and add the urls.
A good reference could be a django a user registration form since it will have all the three cases taken care of.http://www.tangowithdjango.com/book17/chapters/login.html

Creating form with special fields

I have to make an exercise for my examination but I can not find the solution. We have to create the following form:
The solution:
wijngroep: with al the unique names of the table wijngroepen (select list)
WIJNEN: with the unique names of the table wijnen based on the previous field (select list)
Wijn: combination of the jaar and inhoud field bases on previous field (select list)
So this seems very easy but now:
1) Load al groups of the wine (I know that one)
2) If you select a group then the name (WIJNEN) is filled in automatically
3) If you select a name (WIJNEN) then the Wijn-field (that exists out of the 'jaar' and 'inhoud' field as you can see in the pictures bellow) is automatically filled in.
There is my problem, I don't know how to combine the fields into one field and my dynamic actions do not work. Can someone help me?
Table Wijnen:
Wijnid
Jaar
Naam
Omschrijving
GroepsID
Inhoud
...
Table Wijngroepen:
GroepsID
Groepsnaam
Images are available in following links:
solution
and
tables
I have made an workspace:
name workspace = EXEC
Username = de.geyter.steffen#gmail.com
Password = dummy
The tables are loaded into te application.
This should work to combine the fields
select distinct to_char(JAAR)||' '||NAAM as display_value, NAAM as return_value
from WIJNEN
order by 1
I had a look at the application - apart from creating form what is the purpose. Remember a form only works on one record at a time

Dropdown values customization in NetSuite

There is a custom record type configured in NS. It has a name and a free-form text field called full_name. Name is a standard field, full_name is a custom field. There is another record type which has a field of type List/Record with the previous type. On the form this field is present as drop-down. The drop-down show names of records. The goal is to show full names instead of names in the drop-down. Is it possible to mark somehow full_name field so it is available in the drop-down view instead of just name? Any ideas how to achieve this with NS?
Depending on your exact needs, it may make sense to add another custom field to the record containing your drop down. You can source this field from the full_name field on the custom record. This field does not need to store the value if it's only for display purposes.
Add a new field to the record containing the drop down
Set the type to be text
Name it appropriately
Under the 'Sourcing and Filtering' tab, set the source by field to the drop down
A field with type List/Record type can only show standard Name field. However, you can create a custom field dynamically on before record load of a user event script. Check the nlobjForm.addField. Please keep in mind that the value of it will not be saved. Saving the value is another story.

Create Template Custom Field Field in Sitecore

I want add a custom field in a Sitecore template.
Field will be a drop down of hours (1 -23) and used to show open and close time.
Ex: 8am to 7pm.
How can I add a custom field for that?
You can use a droplist field and set it's datasource to a folder that contains numbered items 1-23.
You could also just use a plain text field and optionally add a validator, or a date-time field if you actually want the time (+date) formatted.

How to insert foreign key value into table

I want to insert the product in the product table but the product table is also having a category Id which is the foreign key ,How will I insert the foreign key through code please tell me.
i have used this syntax
NewItemToInsert.tbl_PRODUCT_CATEGORY.category_id = Convert.ToInt32 (categoryId);
Categories are displayed in the dropdown list on the add product page and to bind that dropdown I have written a class.
Category Id which I want to insert already exists in the Category table and that Id I want to add into Product table
Please give me useful suggesstions
Thanks
Ritz
you need to have the category table in memory (or use a proper enum that is in sync with the values in the db), and set the right categoryid when you do the update / insert command.
if you post the code, we can see if there is any problem there.
CategoryId you want to insert in Product table, should already exist in ProductCategory table.