Set LedgerTransferIn on a LedgerTransferOut

Discussions related to custom development with Select.
Post Reply
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Set LedgerTransferIn on a LedgerTransferOut

Post by MattW »

Running into an issue trying to set the Transferred to: field on a Ledger Transfer (-).

I can not set this field directly, it requires creating a LedgerTransferIn transaction and posting it to the destination ledger, however I do not want it to automatically post with out the user, so I can't go that route.
I tried setting the FeeTransferLedger on the associated contact, and this populates correctly when the user updates the status to "Posted", and this seems to work for all contacts EXCEPT Buyer & Seller. In fact, for buyer and seller, FeeTransferLedger isn't even available in the UI, and looking at permissions reveals that permissions do not even exist for this field on buyer/seller let alone be editable. Trying to set this field via code throws a read-only exception.

So my question is, for a Buyer or Seller contact specifically, how do I automatically populate the Transferred To field on the Ledger Transfer (-) UI, while still letting the UI/Base framework handle actually creating & posting the transaction when the user clicks OK.


I understand a picture may help clarify what I am talking about, so I've Emailed Bob Richards a screen shot (Since uploading pictures on the forum does not work).
neetab
Posts: 22
Joined: Wed Apr 17, 2013 3:20 pm

Re: Set LedgerTransferIn on a LedgerTransferOut

Post by neetab »

The FeeTransferLedger field is not available via UI on the buyer/seller screen. You should be able to set it via API. Make sure you have the below permissions

Permissions.ProForm,Order.General.OrderContacts.BuyerSeller.Add and Permissions.General.OrderContacts.BuyerSeller.Edit
Permissions.ProForm.Order.General.OrderContacts.OutgoingWireInformation.Edit
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Re: Set LedgerTransferIn on a LedgerTransferOut

Post by MattW »

I did as you suggested and made sure I had full permissions.
I still cannot set FeeTransferLedger via the API, it is read-only.

I've attempted grabbing the contact from the transaction and setting it as below:

Code: Select all

var contactId = new Guid(transaction.Tags.FirstOrDefault(x => x.Name == "OrderContactID")?.Value ?? Guid.Empty.ToString());                        
                        var orderContact = t.ExtendedProperties
                                            .Where(p => p.Name == "OrderInformation")
                                            .Select(x => (IOrderInformation)x.Value)
                                                .SelectMany(c => c.Contacts)
                                                .FirstOrDefault(x => x.ID == contactId);

//Read only exception on this line
orderContact.FeeTransferLedger = ledgerTransferInName;
I've also tried getting the contact through the order object instead, but that version doesn't even have FeeTransferLedger as an available field.
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Re: Set LedgerTransferIn on a LedgerTransferOut

Post by MattW »

If possible we would rather not set the Fee Ledger for the Buyer/Seller (but if this is the only way, we can work with it for now).
Ideally we want to intercept the Posting process and set the Ledger ID for the Ledger Transfer in the UI at that time.
neetab
Posts: 22
Joined: Wed Apr 17, 2013 3:20 pm

Re: Set LedgerTransferIn on a LedgerTransferOut

Post by neetab »

FeeTransferLedger is on the PaymentInfo object.

Once you get the Contact, you can set the its value

[contact].PaymentInfo.FeeTransferLedger = “FeeLedgerName”
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Re: Set LedgerTransferIn on a LedgerTransferOut

Post by MattW »

Thank you, that works.
Post Reply