I want an advanced search when picking an item from many2one listbox. This feature is implemented for 'res.groups' object, for example. I cannot find this feature in /addons.
To be more exact, I define my object
class my_child(osv.osv):
_name = 'my.child'
_columns = {
'name': fields.char('Child name'),
}
my_children()
I define a parent which has many2one relation to child object and existing resource object
class my_parent(osv.osv):
_name = 'my.parent'
_columns = {
'name': fields.char('Parent name'),
'child': fields.many2one('my.child', 'Child'),
'res_group_id': fields.many2one('res.groups', 'Group'),
}
Then I add child and res_group_id to my_parent's xml form view
...
<field name="child"/>
<field name="res_group_id"/>
...
The res_group_id has "Search More..." option which opens search view but "child" does not.
Please, how do I add "Search More..." option to the child?
please add 5 or more records to your child model. then you will be able to see the 'search more.. '
Related
Good morning,
Im asking for your help, to advice me how to put a "Release or Release all" action in the mobile application.
I already added this Actions container (Screen AP503000 -Prepare Payments)
<s: complexType name = "Actions">
<s: sequence>
<s: element minOccurs = "0" maxOccurs = "1" name = "Cancel" type = "tns: Action" />
<s: element minOccurs = "0" maxOccurs = "1" name = "Process" type = "tns: Action" />
<s: element minOccurs = "0" maxOccurs = "1" name = "ProcessAll" type = "tns: Action" />
In the customization project/Mobile Application (Add Screen) I add this code:
add screen AP503000 {
add container "Actions" {
add field "Cancel"
add field "Process"
add field "ProcessAll"
}
add container "Selection"{
add field "PaymentMethod"
add field "CashAccount"
add field "PaymentDate"
add field "Currency"
add field "Vendor"
}
add container "DocumentsToPay"{
add field "Selected"
add field "DocumentType"
add field "ReferenceNbr"
add field "VendorID"
add field "VendorName"
add field "AmountPaid"
}
}
Attached the result in mobile device**
Selection Container
DocumentsToPay Container
The actions does not show in the mobile interface,any advices/ideas?
Thanks in advance!
Regards.
Try this.
add screen AP503000 {
add container "Selection"{
fieldsToShow = 5
listActionsToExpand = 1
containerActionsToExpand = 1
add field "PaymentMethod"
add field "CashAccount"
add field "PaymentDate"
add field "Currency"
add field "Vendor"
}
add container "DocumentsToPay" {
add field "DocumentType"
add field "ReferenceNbr"
add field "VendorID"
add field "VendorName"
add field "Description"
add field "Account"
add field "DueDate"
add field "Balance"
add listAction "Process" {
behavior = Void
syncLongOperation = True
}
add containerAction "EditDetail" {
behavior = Open
redirect = True
}
attachments {
}
}
}
I've created a custom record type called PALLET as parent and a custom record type COMPONENT as child lines because it is one to many relationship. In another words, one PALLET can have multiple COMPONENTS. I can access PALLET from suitescript as below
function beforeSubmit(context) {
var record = context.newRecord;
record.setValue('custrecord166', '8888');
}
However, I cannot access COMPONENT from PALLET using suitescrpt and it return -1
function beforeSubmit(context) {
var record = context.newRecord;
var lineCount = record1.getLineCount({sublistId:"recmachcustomrecord_pallet_component"});
}
Any suggestion is welcome
the sublist id when referenced from a parent account is recmach+ the field id of the custom field on the child record with is tagged to the parent.
ie.
parent record = customrecordparent123 (Named "My Parent Record")
child record = customrecordchild123
on your child record, you will have a custom field of type list/record of type "My Parent Record".
This field will have "record is parent" ticked. Say this field's id is custrecordmylinkedparent.
when you reference the child record as part of a sublist, it will be sublistId:'recmachcustrecordmylinkedparent', referencing the child record field.
!! Remember, the recmach is not the parent record, but the linking field on the child record.
I have a RAD data form in my nativescript-angular app. The form has two fields for ID type and ID number. The ID type field is a picker that displays data from a backend service. My source Object looks like:
this.mySourceObj = new User("Passport Id", "A2653JHSJ12");
I want my source object to store the value of the ID type as a string.
So I changed the editors using HTML markup, like:
<TKEntityProperty
tkDataFormProperty
name="idType"
displayName="Id Type"
index="1"
[valuesProvider]="idTypesProvider"
>
<TKPropertyEditor
tkEntityPropertyEditor
type="Picker"
></TKPropertyEditor>
</TKEntityProperty>
and in my ts file I register my valueproviders like:
this.idTypesProvider = {
key: "id",
label: "name",
items: [...idTypesArr]
};
With this set, my picker editor gets populated with the data but when I select one item, it does not reflect in my code so at the time of form submission the field is null.
I would like to get the value of the selected item as a complete object i.e. (id, name, ...).
I have tried using the property committed event to get the committed value but it is logs an index value of the item.
if (args.propertyName === "idType") {
const selectedIdType = this.mySourceObj.idType;
console.log(`the committed id type is :`, selectedIdType);
} else {
console.log("No property selected");
}
I have also come across the property convert that is attatched in the dom like:
<TKEntityProperty
tkDataFormProperty
name="idType"
displayName="Id Type"
index="1"
[converter]="valsConverter"
[valuesProvider]="idTypesProvider"
>
<TKPropertyEditor
tkEntityPropertyEditor
type="Picker"
></TKPropertyEditor>
</TKEntityProperty>
But I do not know how to implement the "Converter". Any help is highly appreciated.
I want a situation where when the user selects an ID type, my console can log The complete object of the selected Item.
Using ng-admin, I have a referenced_list defined as follows against my companies entity to display all the events registered for a company:
nga.field('companyevents', 'referenced_list') // display list of related profiles
.label('Company Events')
.targetEntity(companyEvents)
.targetReferenceField('companyid')
.targetFields([
nga.field('eventid')
])
.perPage(10)
.listActions(['edit']),
The target field 'eventid' is itself a reference to an event with an event name. Is there any way I can lookup the event name, rather than just showing the eventid which is pretty meaningless on its own? (E.g. some kind of lookup from a map() call?) When I'm displaying a list view, I can access the event name easily using a reference field:
nga.field('eventid', 'reference')
.label('Event')
.targetEntity(events)
.targetField(nga.field('eventname')),
Is this working?
nga.field('companyevents', 'referenced_list') // display list of related profiles
.label('Company Events')
.targetEntity(companyEvents)
.targetReferenceField('companyid')
.targetField(
nga.field('eventid').map(function (value, entry) {
return entry.eventname})
)
.perPage(10)
.listActions(['edit']),
I have a field on a custom record. The name of the field is reference_code.
I want to populate "reference_code" with my own dynamic list which would be presented as a drop down to the user.
How do I do this? I defined my field as Free-Text. Do I need to keep it hidden but then show it as a drop down before I load the form?
I thought this might do something:
nlapiInsertSelectOption('custrecord_rulereferencecode', code, code, false)
But I would need to convert the field to a select?
Typically, instead of creating the field as Free-Text, you would first create a Custom List (Customization > Lists/Records/Fields > Lists > New) with all of your dropdown options.
Then you would create your field as a List/Record field and select your new Custom List as the "List/Record Type", as depicted below.
This can be done by giving a source to your drop-down menu. The source field accepts an internal id of a list. This internal id can be an in-built(provided by netSuite) or a custom list created by a user. For Eg: I have a custom list with an internal id '23' which has some list items in it, these can be populated in the drop down menu by the following syntax.
var start = function(request, response)
{
var form = nlapiCreateForm('Custom Form');
form.addField('custpage_selectfield', 'select', 'select a color', '23');//here 23 is the internal id of my list
respnose.writePage(form);
}
or you could generate you own field's dynamically using the addSelectOption() function.
var start = function(request, response)
{
var form = nlapiCreateForm('Custom Form');
var myselectfield = form.addField('custpage_selectfield', 'select', 'select a color');
myselectfield.addSelectOption('1', 'Red');//Here 1, 2 and 3 are the id's
myselectfield.addSelectOption('2', 'Green');//which are returned when the
myselectfield.addSelectOption('3', 'Blue');//form is submitted
respnose.writePage(form);
}
I solved this by creating two fields. One is created in the RecordType and will store the info. I set this as hidden. The next field, with the custom dropdown is added in user event. I then process data for my custom dynamic select list and add that to my added user event field.
Then in my change event, I set the record type field to the value selected in my dynamically added field.
Userevent
function userEventBeforeLoad(type, form, request){
if(type == "edit"){
form.addField('custpage_referencecode','select','Reference Code',null, null)
}
}
In my Client Script:
function clientFieldChanged(type, name, linenum){
if(name == 'custpage_referencecode'){
//obtain the upper case value
var codetext = nlapiGetFieldValue(name)
//make sure it hasn't been set
if (codetext != nlapiGetFieldValue('custrecord_rulereferencecode'))
{
nlapiSetFieldValue('custrecord_rulereferencecode', codetext );
}
}
return true
}