Data Migration using SDK - Check Transactions

Discussions related to custom development with Select.
Post Reply
enendza
Posts: 75
Joined: Wed Oct 16, 2019 12:22 pm

Data Migration using SDK - Check Transactions

Post by enendza »

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
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Data Migration using SDK - Check Transactions

Post by BobRichards »

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.

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...
Now that the transaction is initialized (as Pending), we can change to the desired status and write to the remaining properties.

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 = ...
Bottom line - Certain transactions properties can only be written if the Status is in a specific state. It will take a bit of experimentation.
Bob Richards, Senior Software Developer, SoftPro
enendza
Posts: 75
Joined: Wed Oct 16, 2019 12:22 pm

Re: Data Migration using SDK - Check Transactions

Post by enendza »

As always - thanks for the suggestions and guidance we will give it a try.

Emma
enendza
Posts: 75
Joined: Wed Oct 16, 2019 12:22 pm

Re: Data Migration using SDK - Check Transactions

Post by enendza »

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.
Attachments
MicrosoftTeams-image.png
MicrosoftTeams-image.png (108.41 KiB) Viewed 2000 times
MicrosoftTeams-image (2).png
MicrosoftTeams-image (2).png (58.53 KiB) Viewed 2000 times
MicrosoftTeams-image (1).png
MicrosoftTeams-image (1).png (19.81 KiB) Viewed 2000 times
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Data Migration using SDK - Check Transactions

Post by BobRichards »

Was the first step after setting up the Pending state to set the new status?

Code: Select all

tran.Status = TransactionStatus.Voided;
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
Bob Richards, Senior Software Developer, SoftPro
patel
Posts: 7
Joined: Mon Mar 30, 2020 3:51 pm

Re: Data Migration using SDK - Check Transactions

Post by patel »

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
Post Reply