Hi, On fieldchanged of a checkbox, if true i am a...
# suitescript
r
Hi, On fieldchanged of a checkbox, if true i am adding items on line level but I am not able to set bin number fully. I am able to set the item when fieldchanged of checkbox is true but its bin number is setting and quickly getting unset. By that I mean, I am setting item and its related bin number through client script but bin number is unsetting on inventory count record by itself. I am able to set the same item and bin number through UI but CL it is not setting.
Copy code
var linecount = currentrecord.getLineCount({
        sublistId: "item"
      });
      
        currentrecord.selectLine({
          sublistId: "item",
          line: linecount
        });
        
           currentrecord.setCurrentSublistValue({
          sublistId: "item",
          fieldId: "item",
          value: searchResultItems[0].getValue({
            name: "internalid",
            join: "item",
            summary: "GROUP",
            label: "Internal ID"
          })
        });
        
         binNumber = searchResultItems[0].getValue({
          name: "binnumber",
          summary: "GROUP",
          label: "Bin Number"
        });
        
         currentrecord.setCurrentSublistValue({
          sublistId: "item",
          fieldId: "binnumber",
          value: binNumber
        });
        
          currentrecord.commitLine({
          sublistId: "item"
        });
b
r
it is a drop down
It is setting th evalue but again unsetting
I can set inventory detail through subrecord but drop down should set right?
b
is the account using
Advanced Bin / Numbered Inventory Management
r
yes yes
it is
why is that an issue?
b
then the bin number goes in the inventory details subrecord
r
okay
so how do i set the value?
should i do getsubrecord and then set the value?
b
start reading about how subrecords work
r
message has been deleted
I am not able set the value
nor the internal id nor able to get the subrecord
i seriously do not understand why is this
b
what does the line look like after setting the item
r
message has been deleted
<type then tab> is bin number
b
that line doesnt have an inventory detail
r
exactly
and I am not setting any either
but the thing is , it is setting and unsetting
look
Video Clip (2022-06-28_02-35-40-015).mp4
I have even added validateLine, fieldchanged, an other 10 million things
Why is this happening
when I set manually, it is working
b
oh
this is an inventory count
r
I am going to cry, thanks!!! It worked
Also got to know my dumbness. haha.