Create calculated field on custom record in NetSuite - netsuite

I'm looking for a way to create "calculated" field that would populate a value to a field.
At minimum I need to display a value in a numeric field on VIEW and EDIT user event.
Pseudocode:
if (record_in_view || record_in_edit)
execute saved search;
calculate value based on saved search;
display value in a field;
At best I would like that field to display a value just like "built" field does on a Transaction > Work Order record does. It displays a value on VIEW user event but is also available as a value in Saved Search both as a filter and as a column.
So far I can only achieve it on EDIT user event but when I try to do it on VIEW I get no value populated.

you can use the record.submitFields to achieve in view mode in your beforeLoad UE

Related

Power Apps SharePoint date field not updating on button click

I have a button for the user to submit a SharePoint list item for review. On the click even a variable is set which updates the text status field in the SharePoint list. Here's how the status field is updated, it checks if the value is blank and sets it to draft status, if that fails then it checks the variable status update field for blanks, if nothing in the variable then it uses what is stored, otherwise it takes the value from the variable:
If(IsBlank(Parent.Default),"Draft",If(IsBlank(varStatusUpdate), Parent.Default,Text(varStatusUpdate)))
For the date field, I'm also checking for nothing on the SharePoint list, then I'm checking the same status update variable. When blank, use what is stored in the list. If the value is "pending approval" then it should get current date.
If(IsBlank(Parent.Default),Blank(),If(IsBlank(varStatusUpdate), Parent.Default, If(varStatusUpdate="Pending Approval", Now(),Parent.Default)))
When testing the updated Now() value appears on the screen but it isn't saved to the list. When published to SharePoint the value is never saved or updated.
Any ideas?
One way of updating the logic and the value from a Datacard in your form to a datasource is to change the Update property for a specific Datacard
Example -
Originally:
Changing the Update values:
or
Where DataCardValue2_6.Text is the text input for the column.
Only way I could get this to work was to use the patch command like below:
Patch('LTRequest', ThisItem,{
SubmitDate: Now(),Status:Text("Pending Approval")});
Back();

Is it possible to type new Value in PXSelector

I'm using already the [ValidateValue =false] in PXselector attribute, it works when typing new Value on the selector, but it does not selects to null value if I remove the value in the Selector.
the highlighted field is the field that can perform Selecting and Typing new Value. However this behavior is approachable using Autonumber Setup and use Manual Input, but that is not what I wanted.
Thanks.
I would look at the Purchase Receipts (PR000803, POReceiptEntry) screen. You can add a Location dynamically in the grid by typing in the new location name and hitting save. This is accomplished through the field LocationID with Attribute IN.LocationAttribute.

Netsuite custom field does not display data in search results

I'm new to Netsuite, so please bear with me. I have created a saved item search that is working fine with one exception; one of the result columns I have chosen is not displaying data in the returned rows. This is a custom field created by our old Netsuite Administrator and it does display data on an item record, just not in search results. I've done some searching and thought I found the problem when I read another post that said that "Global Search" and "Show In List" needed to be checked on the custom field. I did that, but the search results still do not display any data for that column.
The field is a custom item field of the type decimal number. Store value, show in list and global search is checked. The field is applied to inventory items, non-inventory items, kit/package and assembly/bill of materials. What am I missing? TIA
I suspect the field has field level access permissions. Go to the field definition and click the 'Access' tab. The 'Default Level or Searching/Reporting' should be at least 'Run'.
Global Search on a field makes it so if you enter a value in the Global Search bar that matches the field's value for an item then that item will be shown as a possible match. It has nothing to do with your issue. Neither does Show in List.

Getting data from a datasource with Filter by Column Value?

I have a list box where I am trying to get the datafrom the people view in names.nsf.
The first column of the people view is computed and shows Last Name , First Name.
The code below works fine for my list box values but it does not take into consideration the value in the Filter By Column Value. Basiclly the code below acts like the Filter By Column value property does not exist. I know the Filter by Column value property is working because I replaced a repeat control on the page with a computed field and the repeat control is displaying the value excepected but the list box is displaying values from the first document in the view.
Thoughts I had to fix this are:
Use getAllDocumentsByKey to just search the people view but when I do that I lose the column values and I would need to recompute the value, something that I would like to avoid if possible incase the column formula changes.
Use FTSearch but what I really need to do is search that first column only and I am not aware of search operator that searchs a column only. Is there such a thing?
Another thought would be to somehow use the values of a repeat control, as the values for my list box, but I am guessing that this is not possible. I sort of thinking something with a scope varibale but I have not worked that out yet.
A repeat control works. How can I get my code to loop through the doeuments the same way a repeat control does?
And as a side question, is there anyway to tie a pager to a datasource as oppsed to a repeat control.
BTW What I currently do is to build a list box using a few computed fields and a repeat control but what I really want to do is to use a regular xpages list box control.
Here is the code:
var doc:NotesDocument = view1.getFirstDocument();
while (doc != null && count<10)
{
var tmpDoc:NotesDocument = view1.getNextDocument(doc)
ret.push(doc.getColumnValues()[1]);
doc.recycle();
count++;
doc = tmpDoc;
}
Try to use getAllEntriesByKey. This will give You access to column values (through ColumnValue property of view entry).

Sharepoint calculated field's formula for created by

i have a sharepoint list
with 2 users for examole (user A and user B)
i need a calculated field in the list items such that if user "A" created the item the field vaule will be "X" and if user "B" created the item fields value would be "Y"
but i couldnt use [created by] in the furmiula of the calculated field !! why is that ?!! and is there another way to do what i need to do ?!
If using Sharepoint Designer is an option you can create a workflow for that list. Set it to start when a new item is created -or- edited, use a condition of "If Created_By equals ..." and an action of "Set yourfield to yourvalue", then add an Else If branch and repeat. This will always override anything a user enters in "yourfield". Takes about 2 minutes to do all of this.
I believe you can create a text field that has the default value set to [Me] which should then be usable in a calculated field.
For more complicated formulae (i.e. anything with conditional logic), try creating an event handler for the content type (or doc library). This will allow you full control to set the fields to what you desire.
The field can be hidden from the user inside the edit screens.
Make sure use the STSDev from codeplex to setup the solution for deployment.

Resources