KBA-01701: Changing Values thru the Poke tool

Question:

Can I change the Vendor on a Committed Commitment? Or change the Project on an approved Bid document? Or make other changes “behind the scenes” to document fields?

Answer:

If you are a System Admin, you can use the Poke tool on the Diagnostic Tools Tab to change the value of document fields.  The instructions below are fairly generic, use a contact field (Source Contact) as an example and apply to Chrome only.

For another example, see KBA-01649: Moving a Document to Another Project.

To change values using the Poke tool:

  1. Open Notepad or other “scratch pad” to gather information you will need.
  2. Open the document that you want changed.
    1. If the field that you want to change is in the Document Header:
      1. Double-click to the left of the Powered by Spitfirelogo. A pop-up window will appear.
      2. Copy the DataPK value (a long alphanumeric string) to Notepad.
      3. Close the pop-up window.
    2. If the field that you want to change is not in the Document Header, see Poking Other Tables below to get the appropriate string and copy that to Notepad.
  3. On the document, click on the field whose value will change. In Notepad, write down
    1. The SQL database table name.  Note that DocMasterDetail = DocHeader.
    2. The SQL database fieldname. You can see both tablename and fieldname at the bottom of the document
    3. The current value of the field.
  4. If you are changing a field that uses codes (for example, Status), jot down the current code and the new code.
  5. If you do not need to change a code, while still on that field, right-click and select Inspect from the options:
  6. In the highlighted code that appears, look for the internal database value of the field after data-dbv= or data-pv=. Note:
    1. Contacts use a GUID for the internal value
    2. Text fields are the actual text strings
  7. Copy this info to Notepad.
  8. Note: if the document is a Commitment, consider if the field needs to also be changed on related documents such as Pay Requests. If so:
    1. Find related documents
    2. Find and copy the DataPK for each document onto Notepad
  9. Using the Inspect option as above, find and copy the new value for the field. You might need to go elsewhere, such as a different document or the Contacts dashboard, to find the new value. Your Notepad might look something like this (minus the pointers and colors):
  10. Close all windows (except Notepad and Spitfire).
  11. From the Site Options menu (your name), select Diagnostic Tools.
  12. Select the Poke tab.
  13. Fill out the fields as follows
    1. Table = xsfDocHeader (for any fields in the Doc Header or use the appropriate table name).
    2. Column = the database fieldname (shown in light green in the example above)
    3. Key = DocMasterKey = the DataPK  or equivalent string (shown in yellow in the example above)
    4. Prior = the current value (shown in lilac in the example above)
    5. Set To = the new value (shown in red in the example above).  You can also set the value to NULL.
  14. Click the Set Value button.
  15. To check, reopen the document from Recent Documents (on the Site Options menu).

Caveats and Cautions

  • If the document is a posting document, this procedure does not change the posting.
  • When poking a new Source Date on a Pay Request, you must also poke the Source Date on the attached AP Voucher.
  • For changing the project,  see KBA-01649: Moving a Document to Another Project.

Poking Other Tables

The DataPK described in step 3 works for the Document Header.  If the field you need to poke is in a different table, you need to track down its key.

Note: To find the name of the bit of information (field) you need to change, Inspect that field and look for what follows data-dbf.  That will tell you the table and column that you will need.

xsfDocRevision
  1. Open the document in Google Chrome and use the Chrome Inspector as indicated in step 5 above.
  2. Open the Console.
  3. Paste the following command into the console; the output includes the DocRevKey – use this in place of the DataPK
    GetJSONPX("get/{0}/DocRevision/DocRevKey/0/Created/Notes".format(sfWCC.dsCacheKey)).done(function (r) { console.log(r);});
  4. Look for DocRevKey and copy that key onto Notepad in place of the DataPK.
xsfDocItem
  1. Open the document in Google Chrome and go to the Items tab.
  2. Find the Item you wish to poke, right-click in the grid row near the icons (first column) and select Inspect.
  3. In the HTML markup displayed by Chrome, look up slightly for the Item’s DataPK.  You are looking for  id=itemsgridsorthandle data-pk=”…”
  4. Copy that data-pk string onto Notepad in place of the document’s DataPK.
xsfDocItemTask
  1. Open the document in Google Chrome and go to the Items tab.
  2. Find the Item you wish to poke, right-click in the grid row near the icons (first column) and select Inspect.
  3. Go to Console tab on top and click the clear button.
  4. Copy the following with the correct Item number then press Enter:
    sfAPIGetRows("DocItemTask/1/ProjEntity/AccountCategory/UOM",
              { dFilter: " Parent.DocItemNumber ='0015' " })
        .done(function (r) { console.log(r) })
    
    
  5. Copy the resulting ItemTaskKey.  You will use Key = ItemTaskKey and this GUID instead of the DataPK.

xsfDocRoute

  1. Open the document in Google Chrome and go to the Route Detail tab.
  2. Find the row you wish to poke, right-click near the icons (first column) and select Inspect.
  3. Look for the row’s DataPK.  You are looking for data-pk within a DIV.
  4. Copy that data-pk string onto Notepad in place of the document’s DataPK.
  5. If you need to change the person:
    1. Right-click on the person’s name and Inspect. (If person is not on the route, you can Inspect from someone else the name appears.)
    2. Copy the data-pv GUID onto Notepad.

 


KBA-01701; Last updated: January 5, 2022 at 10:58 am

Keywords: change value, GUIDs