Suitescript 2.0: insert line into sublist if current line meets criteria - suitescript2.0

The record is a invoice or sales order.
An item and a quantity for the item is entered on the standard Netsuite sublist 'Item'.
If the item is on back order (which you can tell once the quantity is entered and you tab out of the line), then I want the original line's quantity to be adjusted so that it equals quantity available and the newly inserted line to be for the quantity on back order.
Is possible?
I am thinking it would be a client script to insert additional lines on the sublist.
I'm not sure if a script has the functionality to adjust the original line though since it hasn't been committed to the database yet.
Thanks

Not sure if this is still relevant but why not just do it on "validate line" instead. Meaning let them add the line and right after the user clicks add adjust the quantity if need be and create the new line with the remaining backordered quantity?

Related

Can't Save Customer Number From Form Text Field to Table

So in an Access database I have a Customer table with a “CustomerNum” field which is a text field with the format ‘00001’ for example. This is a database that I inherited and previously had no autonumber field in the Customer table, I have since added “CustomerID”. However, all the coding in existing forms, queries, etc. is based on the CustomerNum field.
So my issue is, when adding a new Customer on a form, I’ve been trying to add the next sequential CustomerNum via vba code to a text box, but when I do so it is not saved to the Customer table. The only way I’ve been able to get the record to save is to enter the CustomerNum manually. I’ve set up a message on the form using the DMax function to inform users of the correct CustomerNum to enter, but this is less than ideal for obvious reasons.
I tried setting the CustomerNum text field using the DLookup function (=(DLookUp("[MaxOfCustomerNum]","[tblCustomer]"))+1) which does enter the correct CustomerNum in the text field on the form. But when I try to save the record, I get an error message that the CustomerNum needs to be entered into the table.
I’ve also tried using a recordset:
rec(“CustomerNum”) = me.CustomerNum
rec.Update
which appears to work, but strangely enough it restarts the autonumbering of the CustomerID field and wipes out pre-existing records (sets the newest added record to CustomerID = 1, and wipes out the previous record with CustomerID =1). Weird.

Display an ALV based on a condition from another table

I would like to ask how can I display only certain rows of a table based on a condition from another table. In other words I want to relate the tables.
More concrete, I have a table with header data. I created a hotspot for the field "Purchase Order No". I want to display the line items for a particular purchase order by clicking on the some purchase order number in the header table. The issue is the following: When I click on some purchase order number in the header table, I open the table with all line items accross all orders. How can I get only the line items for the particular order and not the whole table?
How can I do this using the class CL_SALV_TABLE? Thank you in advance and sorry for the silly question.
I believe you are displaying the Header data as ALV list with Hotspot set on Purchase Order Field. If so, in the event handler method of Hotspot_click, just get the selected purchase order number with the help import parameters and filter the item data based on it and call factory method of SALV class.

SAP - See all table entries in SE16 for table with numeric key

I'm trying to inspect the data of a table via transaction code SE16(n) on a development system. I'd like to see all of the table's records. In other words, I don't want there to be any selection criteria. But the table has a numeric key that I have to specify. Is there a wildcard-like value that I can enter so any record matches the key?
Thanks in advance,
Joshua
In transaction codes SE16 and SE16N, by default all the lines of the selected table should be displayed up to the maximum defined in the selection screen (leave the field blank to display all).
If you click the button "Number of entries", you can see how many lines there are in the table (NB: it counts only the lines in the current client if the table is client-dependent).
Sometimes the selection may not work well if the selected table field has a "kind of defective" Conversion Exit (at Domain level in the ABAP Dictionary), but that happens rarely.

Inserting a blank line for a certain amount of columns only and aligning two sets of columns with diff amounts of row data correctly

Hi Everyone I am hoping someone to help me, it seems like a complicated one to me so lets see:
I have to compare two amounts of information for errors line by line for price differences. The excel document is 15000 rows long so hence why I need a macro! Columns A to I hold the the first document information, then K to Q has the second amount of document info. The comparison needs to happen between Column A and Q which have matching "shipper"numbers. Each shipper number has a certain number of part numbers below it which each contain the info I need to compare. The problem is one shipper may have more or less parts on document one compared to document two so I cant just run a insert line using vba as it will cut document 2 incorrect. Is it possbile 1.) insert a line after each shipper changes in document one by looking at column A (Shipper no) and running it until Col I and at the same time (or after) inserting a blank line for documents two looking at column Q AND is it possible to try match up each shipper so they start on the same line to compare properly without me going through and aligning them up manually??Please see link below for example of what I am saying. If it doesnt work, please let me know and I'll make a plan.
Thank you in advance!
1:

Linking index of two or more listboxes in VB.NET

I'm doing an project and there is an requirment that i haven't come up with the solution yet.
I'm asked to create a result storing system for a long jump competion. I have to create three listboxes to store attempt numbers, results (in metters) and the corresponding points to each results. However, i can only give them one textbox to enter the results, attempt numbers and points must be calculated automatically and each athlete must have 4 results.
There are two things i would like to ask you guys:
If the user has entered something wrong, he/she should be allowed to delete one or all results. And when a result is deleted, all attempt number and point related to that result should be deleted as well. Clearing all is fine with me but only delete one from the list is not really. So how can i solve this problem.
The listbox containing attempt numbers should be in order (1, 2, 3, and 4). I can make the listbox to generate those numbers if the user enters all results in numerical order. HOwever, the problem is that he/she can delete ramdomly selected item. If he/she deleted attempt number 3 for instance, the next result added should have the attempt 3 back instead of attempt 5. And the new added result should move to position between 2 and 4 rather staying at the bottom.
I hope you can understand what i'm trying to say. Sorry about my explaination, English is not my native language.
All of your ansers are appreciated
You could select the item to delete with the listbox, and then remove as Farhan Sabir has said. You could then force the user to re-enter the distance for the attempt they have just deleted as the next value.
If you only have one textbox to enter the results, you could use a label to indicate which attempt they are entering (set it to automatically change to the number of items in the list +1 after entering a ditance). This would Indicate to the user that they have to re-enter a deleted distance straight after they have deleted one. A messagebox could help prompt this as well.
I am not sure how you would change competitor, but you have not mentioned that at all within your question.
something like this ?
ListBox1.Items.Remove(ListBox1.SelectedItem)
I think when you got the index of the selected item (as Farhan Sabir suggestion above), you can delete the item of the other 2 listbox base on that index. Then you may try the listbox1.Items.Insert to insert the item to specific index of the listbox. however, i think you would have to ask the user the input of the attempt number along with the attempt result in order to add it back to the list with right order