Language in API REST - acumatica

I would like to systematically use the French traduction for the item.
So in The connexion, I add the line locale
{
"name": "name",
"password": "password",
"company": "DEMO",
"locale":"fr-FR"
}
And In the screen SO301000, I update the attribute linedescription with
[PXDefault(typeof(Search<InventoryItem.descr, Where<InventoryItem.inventoryID, Equal<Current<SOLine.inventoryID>>>>))]
when I enter manually, everything works.
When I use REST API, the descriptionline is english (:

Related

How to get the user information using the user lookup ID from fields property when accessing items from a share-point list using Ms Graph API

I am accessing a Share-point list using the MS graph API endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields
I am getting the list items just fine, but I also want to get the user information attached in each field. The data item returned looks like this:
{
...other properties,
"fields": {
"#odata.etag": "\"eTag,1\"",
"id": "1",
"ContentType": "Item",
"Title": "<Some Title>",
"Modified": "<modified dateTime>",
"Created": "<created dateTime>",
"AuthorLookupId": "12",
"EditorLookupId": "12",
"_UIVersionString": "1.0",
"Attachments": false,
"Edit": "",
"LinkTitleNoMenu": "<num>",
"LinkTitle": "<num>",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "",
"_ComplianceTag": "",
"_ComplianceTagWrittenTime": "",
"_ComplianceTagUserId": "",
"Status_Name": "<status_name>",
"Title0": "<some_title>",
"Dept": "Dept A",
"Emp_LeadLookupId": "200", //This is the user whose details I need(email-id)
"Quality_Approver": "<some_user>"
}
}
How do I get the user's details as well and not just a LookupId, OR how can I use the look up ID to get the said user's information?
I searched above and beyond but didn't find anything relevant. Any help is greatly appreciated!
Currently Microsoft Graph is not support the function of finding users through the lookup column.

How to read nested API links within the JSON file

If my JSON file is coming out like this, what needs to happen is go to the API link within the u_parent and populate the values from that API link with sysparm_display_value=true into the df. Possible? I need to do this because this API link is giving me the same name and parent and only the link in u_parent will give me the correct parent details.
{
"u_name": "******",
"u_parent": {
"display_value": "*****",
"link": "https://*****.******.com/api/now/table/u_region_hierarchies/ed7f652f1b29341051380e93cc4bcbd7"
},
"sys_id": "159967df1b75601070bfdb9cbc4bcb35",
"sys_updated_by": "mlarcheveque",
"sys_created_on": "01/24/2021 17:31:26",
"sys_mod_count": "1",
"u_active": "true",
"u_region_id": "**********",
"sys_updated_on": "07/30/2021 14:13:33",
"sys_tags": "",
"sys_created_by": "admin"
},
The API link from that u_parent displays the following values and i want the display value from u_parent
{
"result": {
"u_name": "*****",
"u_parent": {
"display_value": "*****",
"link": "https://*****.*****.com/api/now/table/u_region_hierarchies/6d7f252f1b29341051380e93cc4bcbd7"
},
"sys_id": "217f652f1b29341051380e93cc4bcbd4",
"sys_updated_by": "mlarcheveque",
"u_id": "*****",
"sys_created_on": "07/30/2021 14:11:49",
"sys_mod_count": "0",
"sys_updated_on": "07/30/2021 14:11:49",
"sys_tags": "",
"sys_created_by": "mlarcheveque"
}
}
So i am thinking this would involve a do while loop that goes through each row and gets the value from the nested API link

Is it possible to change verbiage of listAuditEvents?

The current [Envelopes: listAuditEvents] creates the following verbiage for correction:
"eventFields": [
{
"name": "logTime",
"value": "2018-09-18T19:09:01.3603686Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Staging"
},
{
"name": "UserId",
"value": "8c57af14-e46a-4965-ae8b-42bb0c29b706"
},
{
"name": "Action",
"value": "Correction Initiated"
},
{
"name": "Message",
"value": "Staging initiated correction"
},
{
"name": "EnvelopeStatus",
"value": "correct"
},
I would like to modify the Message values. I have gone through Docusigns API but I have not found any indication that this is possible.
Has anyone had the same need? and if so were you able to add custom message verbiage for certain events/actions?
Thanks.
It's not possible for you to configure the contents of the API response for the listAuditEvents operation. However, you could (in your code) include logic to parse the API response and based on certain values in the response, substitute values (for purposes in your app) with the verbiage you prefer.
For example, let's say that you have a page in your app that displays the various events that have occurred for an Envelope, but you don't want to display the verbiage "[UserName] initiated correction" as the text in your UI when a user initiates an envelope correction -- instead you want to display the text "[UserName] changed envelope settings." The logic in your code could do something like this psuedo code shows (where auditEvent represents an object within the API response body for the listAuditEvents operation):
if (auditEvent.ActionInitiated == "Correction Initiated") {
displayMessageInUI(auditEvent.UserName + " changed envelope settings.");
}

How to take Multi-value from one sentence using API.AI?

I'm new to Api.ai , i read the doc. but i didn't understand how Api.ai works better with many parameters.
I'll try to explain by an example :
I have a Management software which manages the members/actions/projects , where i can get the actions of any member at any project using the normal interface.
let's replace this with a smart bot where the chat will run as i expected below,
USER : i want to see my actions for ANY PROJECT NAME HERE
bot : your action is XXXXXX.
OR
USER: give me all the members of the project ANY PROJECT NAME
Bot: Members are "1-2-3-4-5-...."
i think you got what i mean , if you need more i can explain more.How can i let Api.ai understands this ?
For API.ai to 'remember' values (ie store and retrieve information such as the names of projects, actions and team members) you will need to connect API.ai to a webhook/database of your own, there isn't anyway for API.ai to do this on its own.
Once you connect API.ai to a custom webhook/database you can use the variables that API.ai will parse for you to run your query. You simply need to build the intents corresponding to the search and parameters involved
Here's how the process would flow:
User asks "I want to see my actions for [ANY PROJECT NAME HERE]"
API ai logic recognizes this as the intent 'search-action' for $project_name, you having set this up in API.ai like this
Your custom webhook receives JSON response from API.ai that in this case would look like this:
{
"id": "REDACTED",
"timestamp": "2017-04-19T03:18:18.028Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "I want to see my actions for project Unicorn",
"action": "search-action",
"actionIncomplete": false,
"parameters": {
"project_name": "project Unicorn"
},
"contexts": [],
"metadata": {
"intentId": "REDACTED",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "Search - Actions"
},
"fulfillment": {
"speech": "",
"messages": [
{
"type": 0,
"speech": ""
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "REDACTED"
}
So, your webhook has logic that recognizes when result.action is 'search-action' is should run a database search for actions in project result.parameters.project_name
Your webhook fulfills the API.ai request, or alternatively, sends message to message platform directly (ie Facebook messenger)

Drupal 7 Search Autocomplete module never loads "suggestions"

I am attempting to use the module Search Autocomplete 7.x-4.0-alpha2.
I have added a form in the "search_autocomplete" configuration section.
It is enabled.
I created a view that returns taxonomy in json format.
Here is an example of the json output from the json view
[{
"value": "aquaculture",
"fields": {
"name_i18n": "aquaculture"
},
"group": {
"group_id": "aquaculture",
"group_name": "aquaculture"
}
}, {
"value": "climate change",
"fields": {
"name_i18n": "climate change"
},
"group": {
"group_id": "climatechange",
"group_name": "climate change"
}
}, {
"value": "coastal development",
"fields": {
"name_i18n": "coastal development"
},
"group": {
"group_id": "coastaldevelopment",
"group_name": "coastal development"
}
}, {
"value": "deforestation",
"fields": {
"name_i18n": "deforestation"
},
"group": {
"group_id": "deforestation",
"group_name": "deforestation"
}
}, {
"value": "extinction",
"fields": {
"name_i18n": "extinction"
},
"group": {
"group_id": "extinction",
"group_name": "extinction"
}
}]
I set the Suggestion Source to be the view. I used the autocomplete feature of it so I know that my "search autocomplete" suggestion source is configured right. The id selector of a form in a different view (not the json taxonomy one) is used. The permissions for the module are correct.
Now, when I load my view that has the search api form I see a little blue circle icon that is circling to the right of the search api form field. It is circling the whole time and no suggestions are ever populated in the search text box.
I know I have the right form configured because if I set a different form id for the "searchautocomplete" configuration and reload the view page, the circling blue circle is missing.
Does anyone have any idea what might be wrong?
UPDATE: I was going to my modules page and saw this error (i wasn't changing anything on the modules page, just going there) and saw the error on the top of the modules page regarding the Search Autocomplete module
Update: I changed the Search Autocomplete configuration section to not point to my json view but point to an outside url, http://google.com. Of course this is not a valid json endpoint, but I wanted to see if I could see it at least attempt to get it's json data from google.com. Watching through firebug has shown that it doesn't even attempt to go to google.com for it's json data. I think something similar is happening with my json views (it's just not even going there for the data).
That was probably due to a bug in the alpha-version? When you configure the JSON Endpoint by using the Views UI, you should see a list of items in the "preview"-section underneath. The items that are listed there should be the ones that appear as suggestions in the search.

Resources