Is there a way to reference the Attach Company sublist in a custom field in NetSuite? - admin

In our Contact records in NetSuite, you can go to the Relationships subtab and attach multiple companies, or customers, to one Contact, because we have one Contact associated with multiple Companies, shown in the picture.
Attach Company
However, on our Sales Order form, we have a custom Contact field and I would like to populate the field with the Contact based on which Customer the Invoice is for. To do this, I wanted to source the field from the list of attached companies, which will then populate the correct Contact's name.
Is it possible to do this with any sort of customization? Currently, we have been making a duplicate contact for each customer they are associated with, but we are trying to avoid that. Any help would be appreciated, thank you.

Related

Preparing data for a form view (django, drf, axios, vuejs)

I'm building a web application with Django, DRF, Axios and Vuejs.
It works but I'm wondering what are best practices for handling such a case.
Considering the form below :
I want to create an Item for which I can assign a Company and a Contact.
The Company is a model in its own as well as the Contact. The Contact field shows only contacts for the selected Company.
How should I query the datas to be the most RESTful possible ?
Query all the companies, query all the contacts, and make a computed property that shows only contacts of the currently selected company ?
Query all the companies, and each time I select a company I query related Contacts only ?
Other solution ?
Both have pros and cons and I wonder what is the best way to handle this kind of situation. Also, if there are standard ways to design this.
Call the GET API for all the 'Companies', then when the user selects a company, call the GET API for the 'Contacts'. That is how its usually done in enterprise applications, for e.g: when you select a country and then a city.
But you have to weigh the pros and cons of each method. Think about the distant future of your application. If you scale/expand, will the number of companies and the related contacts increase? Then it will be efficient to fetch the contacts only when the user selects a company. If not, and you know the maximum number of companies and their subsequent contacts, and you know that the number is small enough to load beforehand, than go with loading everything as soon as the form loads.

Drupal 8 Contextual Filter Based Upon Current User

Somehow I am not getting it.
I have created a Taxonomy of Organizations. I have then added a custom required field to my User accounts call "Organization". I would like to create a view where the currently logged in user can only see a list of people that belongs to the same Organization as the currently logged in user and no others.
I have created the view just fine, and the list of users appears fine, but I cannot get the filtering and relationships to only show me the only the users that belong to the same Organization as the currently logged in user.
I could do this in SQL in like 2 seconds, but for some reason I am not getting how to do it in the Drupal interface.
I am running Drupal 8.
Add a contextual filter User ID (to get the current user)
Add a relationship Taxonomy term referenced from field_organization (to get the taxonomy term referenced by current user)
Add a relationship User using field_organization (to get the users referencing to the Organization taxonomy at step 2)
Change the relationship of all fields to field_organization
If you want to exclude the current user from the results, add another contextual filter User ID with field_organization relationship
Remember to scroll down and check the Exclude

Access to other contacts groups information

From Google Contacts web interface you can edit a contact and include her in several groups/tags. Then if you decide to "Hide from contacts", the contact will not be in My contacts anymore, but she still exists in Other contacts, and also you can open her and see the groups.
However, People API don't let to know the groups of Other contacts, since you can only retrieve names , emailsAddresses and phoneNumbers.
Is there any workaround for this?
Ok, I figured out that Other contacts have the resourceName in the form otherContacts/<contact-id>, but if you change it to people/<contact-id> (keeping the same contact-id) you can retrieve all the other contact fields with People.People.get()

Using Search Specification to Filter records on a Pick Applet in Siebel

I have a requirement to Filter records on the SR Contact Pick Applet,
The pick applet should only display records related to its Account.
Have tried using the search specification on the applet.
[contact id]=[account id].
The main aim :
When raising a Service Request from the account screen the last name field which uses the SR Contact Pick Applet which displays all contact record(all contacts on the system).
I want it to only display contacts of the account. i.e. Contacts Created under the accounts alone.
Any other suggestions aside search specification will be welcomed.
But am most likely sure its search specification.
Simplest configuration (non-scripted) solution would be to use a picklist constrain on the BC level.
On the Service Request bc, for the the field [Contact Last Name], under pickmap, check the Constrain field for Account Id.
This will filter the contacts to only show the contact of the account.

How can I implement adding multiple objects with Django form?

How I can go about adding multiple objects from a single form with Django?
For example: if I have a sales form which stores sold products' register.
Imagine the form:
datetime: [_____________]
customer: [_____________]
product: [______________] ---> How should I implement adding multiple products
in the same form?
cost: [_________________]
Save (button)
Hint: it is just a question, if you have some ideas tell me please because I don't know how to do it.
thanks
One way is to use a Formset. Formsets you may have seen, for example, in Django admin for displaying multiple related objects as inlines.
Another way could involve AJAX, example solution:
“Added products” is a simple <ul> list with products added to order
“Search product” is a plain text field, where user enters product name or SKU
User input is sent via AJAX to the server, which returns a list of relevant products
These product suggestions are displayed to user
When user clicks on a product name, another AJAX request is made to associate given product with the order
After request completes, the “Added products” list is refreshed via AJAX, and newly added product appears there
This would require that you first create a temporary order to which you could later attach products via separate requests. Formsets don't have this requirement, but personally I haven't used them a lot, they look a bit cumbersome.