How do I Return an Invoice in Dyamics GP through eConnect or Web Services? - dynamics-gp

We have invoice documents in GP 10.0. Recently, the accounting department has decided that when the incorrect client has been billed, we will return the invoice and create a new one. (Previously, we would issue a credit memo to the wrong client and a debit memo to the new client).
I have been pointed at taSopHdrIvcInsert, but I'm not sure what to do with it or how to save it back. Because I'm never 100% sure what fields GP really needs, I was hoping I could use eConnect or web services to get the document by number, change the SOPTYPE to 4-Return and save it back since it appears everything else should be the same.
I can then invoice the new client and save that into GP using existing processes.
Thanks.

I got an answer over on the Dynamics GP Forums. The Web Service did have a method for me to use that was called CreateSalesReturn. I used the Web Service to pull back the invoice, and then I populated a SalesReturn object from the invoice's data and used CreateSalesReturn to get it into GP.

Related

Get purchased product from PaymentIntent

in my app i want to list past purchases for a stripe customer. So I was looking at the relevant API objects like PaymentIntents, Sessions or Charges. But they all do not seem to contain any reference to Product or Price, which I would need to list the purchased products.
Subscriptions contain a list of items that are contained in that subscription, so I was expecting PaymentIntents to have something like that too.
Does anyone has an idea how to archive my list of past purchases? Thanks!
I did some digging through the Stripe API docs[1] and, out of the three objects you referrenced (PaymentIntent, Session, Charges), the only one that I can see being able to trace back to a product is the Session.
Session objects have a line_items property[2] which can be followed all the way down to line_items.data.price.product[3]. To access this you’ll need to inlcude the expand=["data.line_items"] parameter to your call to list Checkout Sessions. You can read more about expanding API responses here[4]
So for all the charges to your customers that were done using Checkout Sessions, you could list them all, use the customer property to associate earch session with a customer in your application, traverse the the returned data, and then query the API for the product details. If you have a lot of customers & products these API calls will add up fast so I would store this data in your back-end to avoid hitting rate limits[5].
Alternatively, you could just save the product ID (either Stripe or your local version) as metadata[6] for any of the above Stripe payment objects listed. That would allow you to link any payment object you wish to a product.
https://stripe.com/docs/api
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product
https://stripe.com/docs/expand
https://stripe.com/docs/rate-limits
https://stripe.com/docs/api/metadata
I had the same question I found a way to retrieve the products related to a specific PaymentIntent.
You need to get the sessions that was linked to PaymentIntent when the Checkout process was made.
I will give you the code (in PHP) that I use to to this.
\Stripe\Stripe::setApiKey(STRIPE_API_SECRET);
// Find the Session for that PaymentIntent
$sessions = \Stripe\Checkout\Session::all([
'payment_intent' => "pi_xxxxxxxxxx",
'expand' => ['data.line_items'],
]);
You will then have an key line_items that contain the products linked.
Enjoy

Can I redirect customer back to my store from Stripe Hosted Invoice page?

I'm generating Invoice object in Stripe and then redirecting customer to the hosted_invoice_url (https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url)
After customer completes the payment, in the final step they are presented with two buttons - Download Invoice and Download Receipt, but there is no button/link for going back to my store. So it's a dead end. Customer can only close their browser tab.
Is there a way to specify something like success_url or home_url that would add a button for getting the customer back to my store?
Right now as a workaround I'm forcing hosted_invoice_url to open in a new tab. Customer closes the tab after they are finished and they get back to my store in the original tab.
From what I know, this is not possible with hosted invoices pages. I'd recommend relaying this use case/feedback directly to Stripe.
However, if you were to use Stripe Checkout you can pass success_url and cancel_url parameters which will fulfil your requirements in this case. Perhaps Checkout might be a better product for your use case?

Windows Universal Apps - Clearing In-App-Purchases

I have a tested app that will hopefully go live in the short term.
However, it has 3 in app purchases.
If the situation arises where I need to do a further test of purchasing the in-app-purchases, is there any way I can cancel my own personal in-app-purchases up to that point so I will be testing from scratch?
Note: I am using the new Windows.Services.Store.StoreContext method, and not the old one.
First, there's no such API that can cancel your in-app-purchase currently. But you can still do your further test.
If the situation arises where I need to do a further test of
purchasing the in-app-purchases, is there any way I can cancel my own
personal in-app-purchases up to that point so I will be testing from
scratch?
According to your description, it seems your IAP type is durable. If so, you can specify the duration for the product as 1 day so that you can repurchase it after it expires.
If your IAP is developer-managed consumable type, you need to report the previous IAP as fulfilled after the user consumes all the items. Then they purchase it again.
If your IAP is Store-managed consumable type, you need to report any items consumed by user as fulfilled to the Store and the Store updates user's balance. After users consume all the items, the user can purchase that IAP again.
For more details, you may refer to In-app purchases and trials.

How to pull a piece of data from a custom field in MS CRM 2011

I need to pull a piece of data from a custom field in the regarded account or case and pull it into a field in a phone call form. (its just to identify which account group the call took place from)
I am not sure of the javascript code to pull from the regarded account or case.
Can someone point me in the right direction.
Thanks in advance.
If you want to do this in javascript, you'll have to access the organization endpoint and retrieve the account/case record. The main form contains the regarding lookup field, which will have the GUID, display name, and entity name of the record. The CRM 2011 SDK has some sample code for retrieving records in Javascript, and they even have a library you could use that does all the hard work for you.

CRM 2011 Pre-Operation plug-in offline - changes not being synchronized to the server, while displayed offline

I am getting strange behavior in Synchronization in Dynamics CRM Outlook Client with Offline access. We have a plug-in that runs Offline in pre-operation stage when a Contact is created, setting a calculated field's value.
targetEntity.Attributes[fieldName] = newValue;
After the Contact is created the field is set and everything is working correctly while Offline, but after synchronization the field is being blanked. I checked OfflineQueue table on the client and I can see that the SOAP message does not contain information on the modified field, so this would be the reason why the information is not being brought to the server. It seems like the SOAP message is inserted into OfflineQueue table BEFORE the pre-operation stage and is not modified do to changes in plug-in. Has anyone seen this before? Is this a bug in CRM - I cannot find any information on this?
did you try it on post-operation?
register plugin step on post-operation, than retrieve the created contact and update field.
targetEntity.Attributes[fieldName] = newValue;
hope it will work

Resources