NetSuite API - Adding "Item Group" under a Sales Order - api

I am trying to integrate with NetSuite API to create Sales Orders. It works fine when I add Non-inventory items. However, when I add Item groups through the API, it fails with the error "Please enter a value for amount".
What I tried so far:
-> Added the Item Group Header Item
-> Added all the line items under the Item group
-> Added the "end of group" line item (item id = '0')
->I have set quantity and rate for all the lines
Yet it fails with the above error. What is the right way to add an item group to a Sales Order Line in NetSuite?
Thanks in advance!

I am not sure, but see if you are using the "custom" price level.
Use custom price levels and set the amount too.

Related

How do I validate a Form input field with a Table row value in microsoft access?

I am having issues with setting a Validation rule in Access.
I have a database with the tables Clients, TypeClient, Sales, SalesList, Items.
I have a form for Sales, with a sub-form SalesList inside which has a relationship with Items in order for me to put several stock items in Sales instead of only one item.
Inside Sales table is ID, Date Sold, ID Client.
Inside SalesList is ID_List(referenced to ID in Sales), ID_Item(referenced to ID in Items), Quantity.
Inside Items is ID, Name, Stock(how much we have in stock), Price
The issue is that I am trying to validate the data I enter in the sub-form Quantity field to be higher than 0, but no higher than the available stock.
The issue is that I have tried using the expression builder to get the value from a calculated query that has 2 fields - the ID and the value for that id, with criteria that is for the ID to get it from the main form, the sub-form, the combo box input and the query works.
But when trying to get it like this:
It shows an error "The expression [Query bla] you entered in the form control's ValidationRule property contains the error The object doesn't contain the Automation object 'Query bla'".
I tried using directly the table Value(but it won't work anyway as it doesn't know for which field to get the stock value from), still the same error. I guess it can't reference to anything else? Normal validation rules work, but I want to validate it not to exceed the value of the available stock for the item I am selling now.
Nowhere on the internet there is a tutorial how to do it with expression builder. How do people validate their fields then?
It doesn't stop me in this case to sell 200 items when I currently have stock of only 2 of them, for example.
Note: I have tried DlookUp in expression builder, straight up tells me No.
Sample wrong validation rule expression builder code:
<=[Query bla]![Stock]
<=[Items]![Stock]
I am currently using VBA and fetch the record I need(the current stock) with one of the following and my unbound text is changing on every subform to the same, it shouldn't happen like that. What can I use to populate a field for each record uniquely:
Private Sub ID_Product_IZBOR_Click()
'Me.Stock_ValueField = DLookup("[Nalichnost]", "Stoka", "[ID]=" & Me.ID_Product_IZBOR)
Me.Stock_ValueField = Me.ID_Product_IZBOR.Column(2)
End Sub
Partial solution: I created a new Dim as Integer and fetched the records based on the ID provided by the field in the form and used BeforeUpdate to validate the current stock. Unfortunately the only way to see the current stock level is to click on the combo box where you choose your product and check the column for that one, it doesn't show anywhere else :(
Don't use the expression builder (I NEVER do) - just type the needed expression in property.
>0 AND <=DLookup("Stock", "Items", "ID=" & [ID_Item])
Another approach is to return Stock in textbox ControlSource then ValidationRule references that textbox. Also, user can then see the quantity limit. Methods of pulling the Stock value from Items table:
include Stock field in Items combobox RowSource - textbox then references column by its index (index begins with 0): =[cbxItems].Column(2); VBA may be needed to Requery combobox after record entry/edit is committed to table.
include Items table in form RecordSource - bind textbox to Stock field (Locked yes and TabStop no)
DLookup() expression in textbox ControlSource
Use ValidationText property to give users a custom message.
However, ValidationRule will not prevent user not entering any value if they skip the control. If you want to make sure a value is entered, either set field as required in table or use form BeforeUpdate event to validate record data.

How to remove recordselectionformula in crystal reports using vb.net

In my application, user selects a customer from a list. I then use this selected customer (CustID is id of selected customer) to filter records in crystal report using recordselectionformula. However the user is allowed to view report without selecting a customer. In this case CustID is zero and there should be no recordselectionformula. My code is given below.
if CustID>0 then 'this part is working fine
crystalreport.recordselectionformula="{vSaleReport;1.CustomerID}=" & CustID
else
crystalreport.recordselectionformula="" 'this line is not working
endif
When user selects a customer (CustID>0), recordselectionformula is set and crystal report filters the records as expected. However when user does not select a customer (CustID=0), previously set recordselectionformula is not removed and report is not displayed for all customers. It still shows filtered data according to previously selected customer.
Can anyone guide me how to remove previously set recordselectionformula.
Thanks
When you are supplying the null it won't return any results instead pass the database field which will retrive all results
Here is the trick... try this:
if CustID>0 then 'this part is working fine
crystalreport.recordselectionformula="{vSaleReport;1.CustomerID}=" & CustID
else
crystalreport.recordselectionformula="{vSaleReport;1.CustomerID}=" & {vSaleReport;1.CustomerID}
endif
I am not sure about VB code check syntax once

Crystal Reports - Prompt for Total Page Count

I have a report that I'm using to create individual shipping labels for product delivery. Company Name, Address, additional fields are all straight forward and drag and drop into report, requiring little manipulation.
My issue comes about in trying to determine how I can prompt the user for the quantity of labels needed for print. This will change from shipment to shipment based on how many boxes are required to fulfill the order. Each box requires its own shipping label. I would simply have the user specify quantity at the "copies" section of the print screen but I also need a field on the label stating n of m so the customer knows total boxes shipped and has an identifier for each individual box. For this reason, I'm curious if and how I can prompt the user before print to provide "total page count", where I can then create the number of needed documents and increment per label using the "page number" field, creating a prompted n of m function.
"Total page count" and "page number" are special fields that I seem to have little access in manipulating so if you know how I can prompt a user for necessary label quantity "total page count" then increment per label with "page number",(to achieve an incrementing N of M function where M is defined by the user) in this manner or another let me know.
Thanks,
Travis

VB.NET ListView Problems

I have two list views, LVPRODUCTS & LVSUPPLIERS.
When I click a Productdata in LVPRODUCTS, LVSUPPLIERS will show the suppliers of the product and the Productdata will be inserted in a textbox which can be use to add another supplier for it.
QUESTION.
When I add a supplier to my product and save it . I want LVPRODUCTS to keep my chosen Productdata Clicked and LVSUPPLIERS will just refresh its data and show the new set of suppliers including the newley added supplier.
I would record the variable using listbox.selecteditem and then after refreshing setting the selected item back to the recorded one.
try something like this: (untested code)
dim item as string = LVPRODUCTS.selecteditem
'do your refresh
LVPRODUCTS.selecteditem = item
Below is a link to the property page.
http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.selecteditem.aspx#Y0

SharePoint 2010 Workflow Update Lookup Field on Item

I have a SharePoint Designer workflow in 2010. This workflow is associated with a list and when it is run, should copy the Current Item back into the list then update a field in that newly created item with a variable set at initiation of the workflow. Basically it duplicates an item then changes 1 value of the newly created item.
The field that I need to update is a lookup field into another list. For some reason SharePoint does not like this and errors out each time.
I have tried setting the value of the field to the following things, all of which fail when run.
ID of the lookup item
ID;#VALUE of the lookup item
VALUE of the lookup item
1;#201101 which is a hardcoded value I know is correct...just trying to test here
At this point, I am out of ideas. Can anyone help?
For more detail the workflow has 1 step with the following actions:
Copy item in Current Item to list at [Parameter:ListURL], Do no Overwrite existing items. Store resulting list item id in [Variable:DuplicateID].
then set [Variable:Reporting Month ID] to [Reporting Months:ID]. (this is a lookup into Reporting Months list using variable [Variable:Reporting Month] which is set at initiation of workflow).
then Update item in Current List (the item is determined by [Variable:DuplicateID] and I try to set the value of the Reporting Month field in Current List using various combinations [Variable:Reporting Month ID] and [Variable:Reporting Month]
The error I get when the worflow is run is below.
The workflow could not update the item, possibly because one or more columns for the item require a different type of information.
Have had now the same problem and it seems that this is an spd-bug. I also wanted to write back the "variable: create" with the id of the destination-item into the lookup-field in the target-list. I also got always the same error. have checked the value also by updating a comment-field with this value and it was an integer value. but I could not update the lookup-value.
My solution for it:
Create a second workflow in the destination list that "update list item" in the target-list (update the lookup-value with the id of the current item) and define that the workflow starts automaticly by creation.
That worked fine for me. It needed some seconds more till the lookup-value was visible but this was not a problem for me.