Hello -
We are migrating data from one SoftPro database to another. In the source system we have check transactions that are Void OR Stop Payment.
When we try to create a new Check transaction, how can we set the Status of a transaction to Void or Stop Payment?
When we insert a transaction we can add it with Posted or Pending, but it throws an error with Void and Stop Payment that reads: “Object does not contain a definition for status.” This is for check transaction under both disbursements and receipts.
Any ideas?
Thanks
Emma
Data Migration using SDK - Check Transactions
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Data Migration using SDK - Check Transactions
I can never be sure without seeing code, but here goes...
I've worked on creating transactions in the past and you have to do it in steps - like a user would enter it. Here is pseudo-code for the process. As so far as the Pending/Posted/Voided/etc status, you would use the TransactionStatus enumeration. We have to start with the transaction in Pending status so we can set fields we may not be able to set in any other state.
Now that the transaction is initialized (as Pending), we can change to the desired status and write to the remaining properties.
Bottom line - Certain transactions properties can only be written if the Status is in a specific state. It will take a bit of experimentation.
I've worked on creating transactions in the past and you have to do it in steps - like a user would enter it. Here is pseudo-code for the process. As so far as the Pending/Posted/Voided/etc status, you would use the TransactionStatus enumeration. We have to start with the transaction in Pending status so we can set fields we may not be able to set in any other state.
Code: Select all
// Create a new PENDING item so can set fields that will become read only once set
// to different status (i.e Posted).
// (Note: This is all that is required for a pending check.)
ITransactionsManager transMgr = ss.GetService<ITransactionsManager>();
ICheckTransaction tran = transMgr.NewTransaction<ICheckTransaction>(ledgerInfo);
tran.Status = TransactionStatus.Pending;
tran.Amount = ...
tran.Medium = ...
tran.Memo = ...
tran.MemoExtended = ...
tran.Name = ...
// Setup Address...
Code: Select all
// Let's do a void.
tran.Status = TransactionStatus.Voided;
tran.ReferenceNumber = checkNumber;
tran.UserPostedOn = ...
{Write amounts to the ITransaction.Splits values as necessary}
tran.VoidedOn = ...
Bob Richards, Senior Software Developer, SoftPro
Re: Data Migration using SDK - Check Transactions
As always - thanks for the suggestions and guidance we will give it a try.
Emma
Emma
Re: Data Migration using SDK - Check Transactions
Hi Bob
I was able to create pending transaction, but i am running into below error when i am trying to update status to voided. I have attached stack trace and exception and sample code (Getting exception when i am trying to set reference number)
Thank you.
I was able to create pending transaction, but i am running into below error when i am trying to update status to voided. I have attached stack trace and exception and sample code (Getting exception when i am trying to set reference number)
Thank you.
- Attachments
-
- MicrosoftTeams-image.png (108.41 KiB) Viewed 2011 times
-
- MicrosoftTeams-image (2).png (58.53 KiB) Viewed 2011 times
-
- MicrosoftTeams-image (1).png (19.81 KiB) Viewed 2011 times
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Data Migration using SDK - Check Transactions
Was the first step after setting up the Pending state to set the new status?
Otherwise, it appears to be a security exception because you don't have some required permission. Go to the Security tab in SPAdmin and give yourself the necessary ProTrust and/or Transactions permission. Frankly, I can't guarantee which one(s) would apply to this case. When I worked on a similar app, I had to enable the following permissions (my user was inheriting from the Administrators group, also).
Enable ability to add manual checks.
Category: Transactions\Transactions
Permission: Manual check
Setting: (Grant) Add
Full disclosure: These are the other permissions I had to give my user. You may need the last one to recreate old transactions.
Change the order ownership profile to one not valid for the logged in user.
Category: ProForm\Order\General
Permission: OwnershipProfile
Setting: (Grant) Edit
Allow user to add transaction dates that are in the past
Category: Transactions\Actions
Permission: Allow any transaction date
Setting: (Grant) Execute
Code: Select all
tran.Status = TransactionStatus.Voided;
Enable ability to add manual checks.
Category: Transactions\Transactions
Permission: Manual check
Setting: (Grant) Add
Full disclosure: These are the other permissions I had to give my user. You may need the last one to recreate old transactions.
Change the order ownership profile to one not valid for the logged in user.
Category: ProForm\Order\General
Permission: OwnershipProfile
Setting: (Grant) Edit
Allow user to add transaction dates that are in the past
Category: Transactions\Actions
Permission: Allow any transaction date
Setting: (Grant) Execute
Bob Richards, Senior Software Developer, SoftPro
Re: Data Migration using SDK - Check Transactions
Hi Bob,
Thanks for the reply.
Yes next step was to update the status on pending transaction. But i got same error when i removed that line. I will check my local permissions.
Thanks,
Parth
Thanks for the reply.
Yes next step was to update the status on pending transaction. But i got same error when i removed that line. I will check my local permissions.
Thanks,
Parth