I found this, however I think this solution is disabling all the fields no matter what record you're in, it completely disables the fields in the form (correct me if I'm wrong).
Also I don't know how to obtain the datasource "salesAgreementHeader_ds" (I'm working on sales agreement) using main(Args _args).