This topic contains 6 replies, has 0 voices, and was last updated by matthewjiang 8 years ago.
-
AuthorPosts
-
October 24, 2016 at 2:05 pm #23484
matthewjiangI created a custom field for item search. How can I set value for this field. Thanks a lot.
Attached Files
This is a cached copy. Click here to see the original post. -
October 24, 2016 at 5:59 pm #23485
k_duncHi Matthew,
Is this a custom sublist you've created and populated by an Item search? If so, can't you access this Custom Field from your Saved Search?
matthewjiang replied on 10/25/2016, 10:02 AM: Thanks Kirk.
This is an item saved search result page. ‘PQTY’ field is applied to ‘Inventory Item’. I tried to ‘setFieldValue’ for this field of an item in ‘AfterRecordSubmit’ event in order to see the value here, but it seems the field value cannot be set. How can I set the field value?
-Matthew
-
October 25, 2016 at 8:53 am #23486
JCiroccoMatthew, You should just be able to use CSV import to initially populate (If I understand your question.)
matthewjiang replied on 10/25/2016, 10:09 AM: Thanks John,
Is it possible that I set the value for this custom field in an item record in the user event(after record submit), and later when I search item I can see this field value? Currently I am focus on using script instead of CSV importing.
-Matthew
-
October 25, 2016 at 9:12 am #23487
KCSF BudOr mass update, depending on the scenario. CSV import is remarkably efficient in NS, IMO so that's probably best.
matthewjiang replied on 10/25/2016, 10:45 AM: Thanks.
I believe that CSV import is a much better way. However I am new learner and don’t know much about CSV import. The value of this field is the result of calculation from fields of other record. Can I set value for this field by using script? I tried but seems doesn’t work.
-Matthew
-
October 25, 2016 at 11:02 am #23488
KCSF BudBased on you other post, it looks like you are trying to set a value on the item record based on what is entered on a PO? I am not an expert on how to most efficiently do this but if my first sentence is accurate then you would maybe create a beforeSubmit user event script and deploy it on purchase orders. The function would go through each item one by one (nlapiGetLineItemCount, nlapiGetLineItemValue, etc.), calculate the value, and then submit the value on the item record (nlapiSubmitField). Hope that helps, you'll have to do some research on those functions if you haven't used them before. All 1.0 API.
matthewjiang replied on 10/25/2016, 01:14 PM: Yes, I am trying to set value on each line item based on PO, Currently I go through each item and LoadRecord, setFeildValue, and SubmitRecord for each line item. But when I saw the item, the field that I set didn’t update. So I have two questions:
1) Is there something wrong in this way?
2) How Can I put this field(applied to inventory item) in the column of item subtab in PO so I can use nlapiSubmitField?
Thanks a lot.
-Matthew
-
October 25, 2016 at 1:38 pm #23489
KCSF BudI think loading and submitting the record should work fine. Obviously this could be a lot of work for the script to do if you are doing that for every item on every PO all the time, but it should work if the script is correct. Make sure your custom item field it set to store values (a checkbox on the item record). Should be able to use nlapiSubmitField independent of whether the field exists as a column field on your PO, it's still going to load the item and submit.
-
October 25, 2016 at 2:17 pm #23490
matthewjiangThanks Bud. I find the reason why set field value doesn't work is because Custom field>Access> Default AccessLevel >VIEW. It works when it turns to EDIT. Yes, it is a lot of work for script to do so. Using nlapiSubmitField is better since it may save some units. I will try to find some way to make it look nice. Thanks all.
-
AuthorPosts
You must be logged in to reply to this topic.