Friday, May 16, 2014

SharePoint repeatedly prompting for login

Problem
I log into SharePoint and it prompts me to login. Fine, that's normal and i expect that.

Next i open a document, and it prompts me again. What? I shouldn't have to login again, i'm already logged in!

I like having security, but i also dont like being annoyed on a regular basis.

Solution
1. Open Internet Explorer options
2. Security tab > Intranet Sites > Sites
4. Advanced
5. Put in the URL for the Sharepoint site
6. Click Close
7. Make sure Protected Mode is not enabled.


Poof! This allows my VPN login/password to passthrough to SharePoint! I don't even have to login to Sharepoint initially, and most importantly i don't have to get repeatedly prompted when opening docs!

Wednesday, May 7, 2014

Clean strings in pass through SQL in Dexterity

There's a builtin function called SQL_FormatStrings() that escapes the single-quotes in a string and then adds single-quotes around the string. This is not in any of the Dex documentation, I found  


This is absolutely necessary when using raw SQL strings in any application. For one, if you're like me you'll forget to add the damn single-quotes around the string. Second, it prevents SQL injection attacks.

Saturday, May 3, 2014

"illegal address in script" when using anonymous table in Dexterity

I'm working on an overdue project on a Saturday. I'm getting this weird "illegal address in script" when using an anonymous table. So far i've wasted 4 hours on this issue.

Here's kinda what it looks like, simplified down:

script 1:
in boolean workTable;
local anonymous table tbl;
OpenTableByName, table tbl, workTable;


OpenTableByName script:
in string optionA;
in string optionB;
inout anonymous table tbl;

if workTable then
   open table tbl with name "workTable";
else
    open table tbl with name "historyTable";
end if;

This blows up with the error message when it's calling OpenTableByName. If I extract the tiny bit of code from that into the calling code it works just fine. This *must* mean you cannot pass an unopened anonymous table into a script. It *must* have to be opened before passing it to another script.

I just love finding these undocumented, dumb issues in Dexterity. It's dumb because the error message makes no sense whatsoever. Why can't the error say something useful, like "unopened anonymous table passed to a script. Can't do that!"

Just another stupid Dexterity quirk. Not the first one that's wasted HOURS UPON HOURS of my time, and won't be the last.





There was an error in this gadget