I am having trouble with a shipstation "orderitem" -> salesforce "orderitem" task.
I have tried upsert, insert and update separately, but it appears there is currently no way to add orderitems from shipstation into salesforce. Is this correct?
The limitation appears to be that I can either access the "OrderId" information (the parent order that holds the orderitem) using relational mapping, or access the "lineItemKey" or "orderItemId" (which are the only pieces of unique info for the OrderItems, from the shipstation API:
orderItemId - number - The system generated identifier for the OrderItem. This is a read-only field.
lineItemKey - string - An identifier for the OrderItem in the originating system.
), but not both sets.
When using shipstation orderitems -> salesforce orderitem, (there is no option to load related that adds any additional fields) I have access to all the orderitem fields but no way to establish the "orderid" field; I have tried to do target or source lookups but this is not possible, because the only field available in Orders which would possibly reference the orderlineitem is the Items fields, which according to the shipstation API:
items - OrderItem - Array of purchased items.
But any comparisons of the orderitem fields to the items field in skyvia fails; in the case of the two most likely things to compare, comparing lineItemKey results in an error of:
"No record found in object 'Orders' for lookup by column 'Items' = '65485750620738'."
And comparison of the array to orderItemId is strictly disallowed as it is "invalid type." I realize the "items" array contains OrderItems, not lineItemKeys or orderItemIds, but as there is no way to directly reference OrderItem objects (only their fields), I had hoped that this part might have been abstracted to check for an OrderItems object in the array which has the same field values.
Using the "External ID" lookup option gives access to the external id of the Order object, but none of the fields available in the "Source Column" dropdown would correspond to the external ID, or even to the order at all.
When using shipstation orders -> salesforce orders, loading related on salesforce orderitems, and mapping the "order.orderitem" object I have access to the "OrderId" via relation mapping, but only access to the columns from the shipstation "order" object, not the "orderitem" object, so I cannot fill out any fields. Since there are no fields in the "order" object I can use to find the "orderitem" object, I cannot do target or source lookups to fill these fields. But I suspect that this is correct behavior. This doesn't allow me to do anything useful, as even if I were to insert these OrderItems, using constants for the fields I must fill but cannot currently, I would be unable to later update them to correct values since none of the fields I could give them would have values which would be unique to that particular OrderItem.
And so I cannot add any orderitems. I hope that I am incorrect and there is some way to do it, or that this functionality will be added soon.
I have attached pictures demonstrating what I have stated above.
I am also having two other minor issues; the first is that I cannot get the source/marketplace from shipstation; I have tried both using "Orders.AdvancedOptions_Source" (which results in a null value) and "Shipments.AdvancedOptions_Source where
Shipments.OrderNumber = (Column = OrderNumber)" lookup, which either results in the error "No record found in object 'Shipments' for lookup by column 'OrderNumber' = '111-6129908-0369864'." or a null value. I am able to view this field in shipstation, but for some reason none of the field options available will transfer this value.
The second is that when trying to use an expression to split up first and last names passed in a full name field, separated by a space character (" "), I get:
"An error occurred during computation of the expression. Column name: 'FirstName'.";"";"";"";"";"";"MI";"49866-1572";"US";"9062269658";"email@example.com";"";"firstname.lastname@example.org";"Amy";"";"1/5/2019 7:10:08 PM";"1/5/2019 7:10:08 PM"
for values where there are no space characters (" ").
(TOKENCOUNT(" ", Name) > 0)? REPLACENULL(SUBSTRING(Name,1,FINDSTRING(Name," ",1)-1),"") : " "
and also tried
(TOKENCOUNT(" ", Name) > 0)? REPLACENULL(SUBSTRING(Name,1,FINDSTRING(Name," ",1)-1),"") : Name
What I am trying to accomplish is splitting up a space separated full name into first and last name, but to have it check first if there are spaces and if not to skip trying to split up the name. It seems to fail on thing that do not contain any spaces. Is it still evaluating the first expression in the if statement even though its not being run?
Thank you so much for your time spent looking into this.