PencilBlue - Custom Object Id's - node.js

I'm working with PencilBlue, and I'm having trouble with the custom objects Id's. The "name" field is used as an Id, but I would like it to be just a regular field and have an "id" field as identifier.
How could I achieve this?

PencilBlue cofounder here. Each custom object will have a unique id field supplied from the MongoDB database. You can also create another form field for a non-unique name and use the name field for UID.

Related

How to get id field with group by in Django

I am trying to fetch group by data in Django. I`m using postgres database
How I Can write Django query like this SQL query:-
SELECT id FROM table_name WHERE name=%s GROUP BY name"
I am trying with Model.objects.filter().values('id').annotate(count=Count('name')).order_by('name') but not get unique name`s id in QuerySet
and also try
Product.objects.filter(id__in=RawSQL(f"SELECT id FROM product_product WHERE name=%s GROUP BY name", (key,)))
but got error
"column \"product_product.id\" must appear in the GROUP BY clause or be used in an aggregate function\nLINE 1: ..._product\" WHERE \"product_product\".\"id\" IN (SELECT id FROM pr...
model.objects.filter(user=id).values('name').annotate(dcount=Count('name')).order_by()
You need to specify a filter value when u want to filter data from the model.
The value field takes in the value you want not the id
Then you annotate it.
For more information you can read the django documentation: here

Netsuite. Saved Search, how to join another table

I'm trying to make Saved Search which has Transaction fields that I want to join any other type's fields.
When I make Criteria, Result in Saved Search, I realized there is limitation to bring certain field.
I know the Type & Internal ID, so I used formula(numeric) and insert custom_item.realamount(This is actually what I want to know). But this wasn't show a value.
How can I make these two types to join each other?
There is no field in Netsuite called custom_item If you are trying to join a custom item field on a transaction search formula field then you'd be looking at a join like
{item.custitem_uniquepart_}
Where _uniquepart_ is either an integer if the custom field was created without a custom id value or it's the value entered for the id field of the custom field.

Make default primary required field into a lookup

When creating a new entity, a new form is automatically created for you where it automatically is given 2 fields, name and owner. For the name field, it is possible to make that into a lookup?
No, the primary field can only be of the type Single Line of Text.
When creating a new entity, you cannot select other types:
This does not stop you from changing the requirement level of the primary field to None and creating your lookup field.

How to get items in a custom list using SuiteTalk

I want to set the value of a custom customer field. The field type is List/Record and the value must be from a custom list.
I believe I have to set the value to the internal ID value of the custom list item. The items look like this:
Am I right that I have to use the ID value? Instead could I set the customer field to the Value value?
Assuming that I have to set the customer field to the ID value, I want to load all the items into memory and then look up the ID by the Value, like this:
The problem is that I cannot work out how to download the items using SuiteTalk. I can use CustomListSearchBasic to get the custom list record:
But I can't seem to get the items in the custom list.
Please can you help? Also, I'd be delighted to know how to work this out for myself. The schema browser didn't help.
I worked it out. I needed to set searchPreferences.bodyFieldsOnly = false

How to Compute a Field in a Form from another Form or View in a Lotus DB

I have form "A" which there is a field that I need be computed after composed from Form "B". The forms are in the same database. I am not sure if it would be better to have the Form "A" field compute after composed from a "View" that uses the Form "B" or what would be the best way to get the field populated.
I have tried to do a #DBlookup, with no success.
Thank you!
Forms do not contain information, only documents do. Forms just represent information stored in documents.
Assume you have a view with name: "viewName" and it displays a set of documents.
The first sorted column of this view contains key values.
We want to get value of field someField by key from this view.
Create a new form, create a "Computed when composed" field and set the following formula as value:
#DbLookup("":"NoCache"; #DbName; "viewName"; "keyValue"; "someField");
It will access view "viewName" in the current database, get a document by "keyValue" and return value of field with name "someField"
I have tried to do a #DBlookup, with no success.
Well, what went wrong? Why didn't this work? When do you a #DbLookup call, you need to provide a view, a "key" and the field or view column you want to pull back from the matching document. Assuming you have a key with which you can link document A and document B, the look-up should be pretty straightforward.

Resources