Hello!
I am trying to set a color for an entire row based of a field on that row. So when a particular field value is set to "1", I want that row highlighted yellow.
I have looked through Sage City & seen numerous threads & have tried many methods.
This is basically my issue:
Script for overriding AccountKey in JC Job Posting Entry
| Sagecity |
remove preview |
|
| Script for overriding AccountKey in JC Job Posting Entry |
| v2018 (so scripting in JC is possible). I'm writing a script to override the GL account for Job Posting Entry lines. (Detail PreWrite event). I can get the override to work, with a SetValue but the grid does not refresh with the new value. retSet = oBusObj.SetValue("AccountKey$", sNewAccount,"kACCOUNT") When I try to use InvokeChange, nothing happens. |
| View this on Sagecity > |
|
|
I can get it to work if I manually add a line. The issue is I am using this with Ascent Automated Service invoicing, so it populates numerous lines all at once & once it cycles through the lines, it can't keep the line number separate.
This function is on the Lines tab already, so its not like I am selecting a Sales Order on the Header & have the lines populated to fire upon change of panel or loop through them. I tried.
It seems I have to use a PreWrite on the Details table.
When I add them manually, I can use the logic for ChangedRow & it works like I need it to.
When I load all the lines at once, it leaves them all at a value of 0 & doesn't set that row number & fire off correctly.
If I use CurrentRow, it always sets to the next blank line where my curser ends up.
I don't get why this is so hard for it to see the row I am on when I write each line.
Has anyone successfully been able to set the current row before it moves to the next one? Or know the function to grab this value?
This is what works manually or if I edit a line previously brought in:
Event: Table - Pre-Write on SO Invoice Detail
sHidden = ""
sLine = ""
If (oScript.UIObj) Then
Set oUIObj = oSession.AsObject(oScript.UIObj)
Else
sMsg = "No UI"
retMsg = oSession.AsObject(oSession.UI).MessageBox("", sMsg)
End If
curRow = 0
'retVal = oUIObj.GetControlProperty("GD_LINES", "CurrentRow", curRow)
retVal = oUIObj.GetValue("cChangedRow", curRow)
r=oScript.DebugPrint(" CurrentRow = " & curRow)
retVal = oBusObj.GetValue("D514_HiddenLine$",sHidden)
r=oScript.DebugPrint(" Hidden Value = " & sHidden)
If sHidden = "1" then
retVal = oUIObj.SetControlProperty("GD_LINES","Row", curRow)
retVal = oUIObj.SetControlProperty("GD_LINES","Column", "0")
retVal = oUIObj.SetControlProperty("GD_LINES","BackColor","RGB: 255 255 0")
End If
#scripting #script #ui
------------------------------
Dana Young
Lehman Wesley & Associates
Lansing MI
------------------------------