GetNewStockItemFromDefaults - accountsIQ/API-Wiki GitHub Wiki

The GetNewStockItemFromDefaults returns a new item pre-populated with the stock item defaults values from the system.

The system maintains a set of default settings for each new stock item created in the system.

Important Note: The returned item has not yet been created in the system and needs to be saved back using the SaveStockItem method.

Declaration

C#

public WSResult2OfStockItem GetNewStockItemFromDefaults(string token, string stockItemID)

Visual Basic

Public Function GetNewStockItemFromDefaults(ByVal token As String, ByVal stockItemID As String) As WSResult2OfStockItem

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
stockItemID String The identifier that will be used inside the new item.

##Example

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
  WSResult2OfStockItem it = ws.GetNewStockItemFromDefaults(auth, "NEWSTOCKITEM");
  Assert.IsTrue(it.Result != null);
  Assert.IsTrue(it.Status == OperationStatus.Success);
}

Visual Basic

Dim ws As New Integration

Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not auth Is Nothing) Then
  Dim it As WSResult2OfStockItem = Me.ws.GetNewStockItemFromDefaults(Me.auth, "NEWSTOCKITEM")
  Assert.IsTrue((Not it.Result Is Nothing))
  Assert.IsTrue((it.Status = OperationStatus.Success))
End If

See Also

⚠️ **GitHub.com Fallback** ⚠️