Scripting

  • 1.  Hi all,I have a customer that would like the nam

    Posted 09-17-2015 10:34
    Hi all, I have a customer that would like the name of the user that created a sales order to appear on the sales order invoicing header screen when they open the SO invoicing screen. I can get the user created key from the SO Header to show up, but I would like the name to appear in my UDF. I have tried adding the field from the SY_User table (LastName) but I get no returns. I didn't really think it would be that easy but thought I'd give it a try. In reviewed the scripting class materials and there is a button script(#32 - GetUserNameofOrigSO) that does this using a sql query to join the appropriate tables then fill in a udf accordingly. Is there some way to replicate that in a non-button script? Seems like the missing link is the SO_SalesOrderHeader.UserCreatedKey field linked to the SY_User.UserKey field to get the data I need. Any ideas are appreciated!


  • 2.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 10:51
    Just thinking aloud....can you do a UDS triggered by Post-read event? Use the UserCreatedKey you have as the key for SY_User_svc, grab the name, write it to another UDF, then HandleScriptUI()?


  • 3.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 10:56
    You could trigger your post read event on the Sale Order field, then fetch the UserCreatedKey from SO_SalesOrderHeader for your UDF. I don't see that anything was missing from Alnoor's button script. The link between those key fields is right there in the WHERE clause - Isn't it?


  • 4.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 10:57
    hi guys - thank you for the ideas - @DanBurleson i'm trying to accomplish without needing a button to click if possible. Is it possible to use the odbc / sql stuff in a non - button script?


  • 5.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 11:04
    Yes, you can use the ADODB methods in a UDS and set the last name with a SetValue, but referencing that Sales Order Header and Sy User tables with BO methods would be faster than the ODBC. That's what I meant by the Post Read Event on the Sales Order Number field.


  • 6.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 11:14
    Thanks @DanBurleson I guess this one is over my head - i'm totally lost. If you'd be interested in giving me an estimate on this project send me a note. The customer is looking for pricing on the 'enhancement' at this point so I don't have a solid sale on it yet.


  • 7.  RE: Hi all,I have a customer that would like the nam

    Posted 09-17-2015 11:21
    Will do. Thank you!