EnableProFormGeneratedTransactions

Discussions related to custom development with Select.
Post Reply
KWoods
Posts: 10
Joined: Tue Aug 27, 2019 12:26 pm

EnableProFormGeneratedTransactions

Post by KWoods »

Hello, I am trying to disable this option on the Register, but it seems that no matter what I do it does not work the same as the UI.

What I want to do is create an order with no Trust Account.
Then go to the Register and unclick the Proform Generate Transactions check box.

This way I only get the pending ledger transfer transactions in the Register.

Then I want to select Generate Pending Transactions and select the pending disbursement to the B contact to pull it into the Register.

So in the API in order to get the ledger I have to assign a Trust Account to the order.
I do so by using:

Code: Select all

IAccountsManager am = (IAccountsManager)userObject.sps.GetService<IAccountsManager>();
ITrustAccountInfo trustAccount = am.TrustAccounts.Where(t => t.Code == "ILCMTUS7020").FirstOrDefault();
((IOrder)order).SetTag("TrustAccountId", trustAccount.ID.ToString());
So then I save the order and get the ledger:

Code: Select all

string ordnum = order.Number;
ILedgersManager lm = userObject.sps.GetService<ILedgersManager>();
ILedgerInfo info = lm.Ledgers.Where(l => l.Name == ordnum).FirstOrDefault();
 IOrderLedger ledger = (IOrderLedger)lm.GetLedger(info);
Then I am telling it to uncheck the Enable Proform Generated Transactions:

Code: Select all

ledger.EnableProFormGeneratedTransactions = false;
I have also tried setting the InitialEnableProFormGeneratedTransactions to false as well.

What I would like to see is only the two Ledger Transfer transactions in ledger.Transactions but I see 4 which includes a check and a receipt, I believe it is. And if I get the ledger again it comes back with the ledger.EnableProFormGeneratedTransactions set to true.

Any ideas or help would be appreciated.
KWoods
Posts: 10
Joined: Tue Aug 27, 2019 12:26 pm

Re: EnableProFormGeneratedTransactions

Post by KWoods »

If you could also assist with how to emulate clicking Generate Pending Transactions and select the pending disbursement to the B contact to pull it into the Register. That would be helpful.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: EnableProFormGeneratedTransactions

Post by BobRichards »

(Response to first question) The way Select knows a profile should use ProForm Generated Transactions (PGT) is by examining a flag. Open the profile in SPAdmin -> Security -> Profiles. Open the Accounting tab and look in the Register/Ledger group box. The first checkbox is "Use ProForm-generated transactions". If the checkbox is unchecked then order ledgers in that profile will not auto-create PGT transactions. If you can create orders in a non-PGT profile then you will get what you are after.

However, most customers require the checkbox to be set because they want the PGT created transactions. There is no way to selectively change this setting when creating an order. The PGT transactions are created when the order is saved - not when the order ledger is opened.

Once the transactions are present, you can't tell which ones were created by PGT. However you can filter the collection by looking for those created by certain contacts. Look at the Transaction Tags to find the contact ("OrderContactID").
Bob Richards, Senior Software Developer, SoftPro
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: EnableProFormGeneratedTransactions

Post by BobRichards »

(Response to second question) The logic PGT uses to create these transactions is complex and is in internal classes in the ProForm libraries so there is no direct way to do this. There are examples of manually creating transactions in this forum. Search for "create transaction".

If you do this and want to co-exist with PGT transactions, you will need to replicate all the information (including tags) but I cannot furnish a guide at this time as it is beyond the scope of this forum. Sorry.
Bob Richards, Senior Software Developer, SoftPro
Post Reply