Hello everybody,
today I want to leave a short note for the following situation:
Imagine that you need to enable some control in Acumatica ( for example Mark for PO ) on page Sales orders ( SO301000 ).
As usually for enabling control there are two ways:
- RowSelected
- Automation steps.
Recently I found third option, when neither 1 nor 2 did work. After spending some time I found third option: Cache has property AllowUpdate. After I've set it to true, I was able to modify lines in Document details.
In your code it may look like this:
protected void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
if (del != null)
del(cache, e);
SOLine row = (SOLine)e.Row;
if (row == null) return;
Base.Transactions.Cache.AllowUpdate = true;
PXUIFieldAttribute.SetEnabled<SOLine.pOCreate>(cache, row, true);
PXUIFieldAttribute.SetEnabled<SOLine.shipDate>(cache, row, true);
}
you still may need Row_Selected event handler, but not forget to add AllowUpdate = true.
Hello everybody,
today I want to write a few words about changes of PXUIFieldAttribute.SetVisibility method.
In the past, if you wanted to turn on some column, you could write in RowSelected event something like this:
PXUIFieldAttribute.SetVisibility<APRegister.finPeriodID>(Documents.Cache, null, true);
If you want to turn it off, then this:
PXUIFieldAttribute.SetVisibility<APRegister.finPeriodID>(Documents.Cache, null, false);
But for quite a long time ( even in 2017 version ), Acumatica team introduced PXUIVisibility enum. In code it looks like this:
[Flags]
public enum PXUIVisibility
{
Undefined = 0,
Invisible = 1,
Visible = 3,
SelectorVisible = 7,
Dynamic = 9,
Service = 19,
HiddenByAccessRights = 33,
}
For now I can comment on Visible and InVisible which correspond to false and true in the past implemtations. And in future posts I'll describe other selectors.
Hello everybody,
today I want to leave a post on how to change all emails, which are contained in Acumatica. For this purpose you may use script below:
UPDATE contact SET email = email + '.ts'
UPDATE socontact SET email = email + '.ts'
UPDATE apcontact SET email = email + '.ts'
UPDATE pocontact SET email = email + '.ts'
UPDATE crcontact SET email = email + '.ts'
UPDATE arcontact SET email = email + '.ts'
UPDATE fscontact SET email = email + '.ts'
UPDATE crcasecontacts SET email = email + '.ts'
UPDATE crcontact SET email = email + '.ts'
UPDATE pmcontact SET email = email + '.ts'
If you wonder, what can be the usage of such SQL, consider following scenario. You've restoed from back up some database. And you need to see if Automation schedules work fine. How can you do it without deletion of all of them and spamming of all customers of your customer? The only way would be updating emails in your database.
If you know any other table that contains e-mails which I've missed, let me know, I'll update this SQL script accordingly.