PayPal Agreement Amount getting Doubled on Creation Issue - paypal-sandbox

I have an issue with the Paypal Agreement creation. The amount entered is getting doubled in agreement.
PaymentDefinition paymentDefinition = new PaymentDefinition();
paymentDefinition.setName("Regular Payments");
paymentDefinition.setType("REGULAR");
paymentDefinition.setFrequencyInterval("1");
paymentDefinition.setCycles("12");
// Currency
Currency currency = new Currency();
currency.setCurrency("USD");
currency.setValue("5");
paymentDefinition.setAmount(currency);
ChargeModels chargeModels = new ChargeModels();
chargeModels.setType("SHIPPING");
chargeModels.setAmount(currency);
List<ChargeModels> chargeModelsList = new ArrayList<ChargeModels>();
chargeModelsList.add(chargeModels);
paymentDefinition.setChargeModels(chargeModelsList);
MerchantPreferences merchantPreferences = new MerchantPreferences();
merchantPreferences.setSetupFee(currency);
Agreement created image is attached showing double the amount.

Got the answer. I need to remove chargeModels list from paymentDefinition. ChargeModels are just to add miscellaneous charges like shipping/tax. Its added by PayPal examples by default to just show we can add such charges too.

Related

BMC Remedy ticket status change error in asp net

I'm using MVC to manage the BMC ticket raise and resolve. However for certain groups there are additional fields that opens up after choosing the type of change as 'Resolved'
I tried input values to those fields but still I'm not able to resolve the incident.
Below is the code used,
StagingRequest.Incident_Nature = "NA";
StagingRequest.Network_Infrastructure = "NA";
StagingRequest.Incident_Element = "NA";
String ss = _WS1.HelpDesk_Modify(_AI1, StagingRequest.Incident_Number, StagingRequest.Type_of_Change, StagingRequest.Status_Reason, StagingRequest.Group_Name, StagingRequest.Assignee_Login_ID, StagingRequest.Resolution, StagingRequest.Incident_Nature, StagingRequest.Network_Infrastructure, StagingRequest.Incident_Element, StagingRequest.WorkLog_SupportDiary, StagingRequest.Work_Info_Notes, StagingRequest.Expiry_Date);
Note that I tried entering the actual dropdown values in those 3 fields still the same error "Unable to Modify :ERROR (100000308): ; Please choose the value for the following fields before resolving the ticket; 'Incident Nature', 'Network Infrastructure' and 'Incident Element'. "
The other groups for which additional fields is not required worked with the below code,
String ss = _WS1.HelpDesk_Modify(_AI1, StagingRequest.Incident_Number, StagingRequest.Type_of_Change, StagingRequest.Status_Reason, StagingRequest.Group_Name, StagingRequest.Assignee_Login_ID, StagingRequest.Resolution, null, StagingRequest.Cause_for_SLA_Violation, StagingRequest.SLA_Comments, StagingRequest.WorkLog_SupportDiary, StagingRequest.Work_Info_Notes, StagingRequest.Expiry_Date);
Analysis the the difference in group in Remedy. Some groups are differently customized in remedy while resolving the incidents

Combine data from two datasources into a single table

I have two datasets:
Dataset 1 - Records the details of a store visit. Merchandiser name, location, date & a relation to SKU (Dataset 2)
Dataset 2 - This is the SKU data, where the stock levels for each sku are input as a new record, each associated to a visit from Dataset 1.
I have two issues:
I want to combine this data into a single table. I want to show each SKU record, with additional columns for the visit information (such as the location & date). How do I do this.
How do I combine this data for use elsewhere, such as google data studio. Essentially I want to be able to see an SKU's stock-level's history, or the date it was last updated.
You need to create Calculated Data Source. You can refer this sample.
On a high Level
Add data source in Appmaker.
Select Calculated, provide Name and Create the data source.
Once your Calculated Model is in place. Add fields as per need basis. e.g. If you want to store Sum of two fields, create one Integer field in Calculated Model. Here's how your calculated data model will look like.
Now go to Second Tab which is "Datasources". Click on the Data Model name there. You should see an option to write server side script.
Here you should write your logic for combining your data sources. I can provide you one sample to achieve this.
//server script
var calculatedModelRecords = [];
var recordsByStatus = {};
var allRecord = app.models.Request.newQuery().run(); //your existing data source.
for (var i = 0; i < allRecord.length; i++) {
var record = allRecord[i];
var draftRecord = app.models.TAT.newRecord(); //new data source
draftRecord.CreatedOn = record.CreatedOn;
draftRecord.DocumentName = record.DocumentName;
draftRecord.DueDate = record.DueDate;
draftRecord.DaysPerStage = record.DaysPerStage;
draftRecord.Status = record.Status;
calculatedModelRecords.push(draftRecord);
}
return calculatedModelRecords;

Update SalesLine Unit price on changing the size in Microsoft Dynamics AX 2012 R2

how to approach this? Change the value of unit price in the Sales line on changing its size, As far as I know the default unit price comes from trade agreements. In this case there would be no size, but for my requirement I should assign value from trade agreements for sizes 1,2,3,4 and for 5 and 6 the the value from trade agreements should be incremented with 1. i.e
For example sizes 1,2,3,4 -> 13$ and sizes 5,6 -> 14$
I am thinking to approach this making changes in the modified field method on InventSizeid in SalesTable form, is this the right approach or is there a better way to do this. Any help appreciated, thanks in advance
Check SalesTable form go to Data Sources/InventDim/Fields/InventSizeId/Methods/Modified open modified method, you need add your logic in the end of this method.
For example (this is standar method modified):
public void modified()
{
SalesCalcAvailableDlvDates salesCalcAvailableDlvDates;
super();
salesLine.modifyInventDim(inventDim, fieldNum(InventDim,InventSizeId), !salesLine.MatchingAgreementLine);
if (salesLine.DeliveryDateControlType)
{
salesCalcAvailableDlvDates = SalesCalcAvailableDlvDates::newCommonSalesDlvDateType(salesLine,0,inventDim);
salesCalcAvailableDlvDates.modifiedFieldBeforeInsert(salesLine);
}
salesLine_DS.cacheCalculateMethod(tableMethodStr(SalesLine,itemName));
//Your logic
...
...
...
SalesLine.SalesPrice = 999; //Your new sales price.
//Your logic END
}
you probably need to perform salesLine_DS.reread(); or salesLine_DS.refresh(); to see new price (else press F5 in form).
You can specify prices for product variants based on size, color etc. using the trade agreements. Please check the following link.

Sage CRM - It is possible to create an appointment through Classic ASP code?

Using this:
var NewComm = CRM.CreateRecord("Communication");
NewComm("Comm_ChannelId") = Request.Form("chanId");
NewComm("Comm_Type") = "Appointment";
NewComm("Comm_DateTime") = Request.Form("initialHour");
NewComm.SaveChanges()
I can see in the DDBB that the Communication is created
Just for testing (and to see if it needs a Comm_Link row to be able to show), i updated some row in the Comm_Link table (CmLi_Comm_CommunicationId column) to the ID equals to the Communication i just created, but still i do not see my Comm when clicking in My Calender
There is somethgin else i need to do?
There are certain fields that are required for security, namely Team (Channel) fields and Territory (Secterr) fields.
With Communications, you also need to make sure there are other default fields, as Communicationa are often filtered.
For example, Communication lists are filtered by the Status field = Pending by default, so make sure the comm_status field is set.
Also, all Communications generally have an Action (comm_action) and some other fields.
We advise setting the following fields, in addition to those you have already set:
NewComm("comm_status") = 'Pending';
NewComm("comm_action") = 'Meeting';
NewComm("comm_secterr") = *A Territory Id*;
NewComm("comm_subject") = 'A Subject';
NewComm("Comm_ToDateTime") = *End Date/Time*;
NewCommLink("cmli_comm_userid") = *The User Id*;
NewCommLink("cmli_comm_communicationid") = *The Communication Id*;
NewCommLink("cmli_comm_personid") = *The Person Id if required*;
NewCommLink("cmli_comm_companyid") = *The Company Id if required*;
Hope that helps!
Six Ticks Support

Import TransferOrder lines (InventTransferLine)

I am trying to import a transfer order line with this code from Transfer Orders Import:
InventDim inventDim;
InventTransferLine inventTransferLine;
#define.ShipDate("1/1/2016")
#define.ReceiveDate("1/1/2016")
//Order line
inventDim.clear();
inventDim.InventSiteId = "GENERAL";
inventDim.InventLocationId = "103";
inventTransferLine.clear();
inventTransferLine.initValue();
inventTransferLine.ItemId = "A01103472";
inventTransferLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
inventTransferLine.QtyTransfer = 2;
inventTransferLine.initFromInventTableModule(InventTableModule::find(inventTransferLine.ItemId,ModuleInventPurchSales::Invent));
inventTransferLine.QtyRemainReceive = inventTransferLine.QtyTransfer;
inventTransferLine.QtyRemainShip = inventTransferLine.QtyTransfer;
inventTransferLine.ShipDate = str2Date(#ShipDate, 213);
inventTransferLine.ReceiveDate = str2Date(#ReceiveDate, 213);
inventTransferLine.initFromInventTransferTable(inventTransferTable, false);
inventTransferLine.LineNum = InventTransferLine::lastLineNum(inventTransferLine.TransferId) + 1.0;
if (inventTransferLine.validateWrite())
{
inventTransferLine.insert();
}
else
throw error("Order line");
Is this the correct or the preferred way to do it?
What's the use of inventDim here? I am transferring this product from warehouse A to warehouse B and those are specified in the selected header, meaning the InventTransferTable record.
And i am not sure about these two lines:
1. inventTransferLine.QtyRemainReceive = inventTransferLine.QtyTransfer;
2. inventTransferLine.QtyRemainShip = inventTransferLine.QtyTransfer;
RemainReceive from where? i can't figure out what are they referring to.
You are more or less good to go.
You seems to have copied what others have done, which is good.
There are other ways to it, one using AxInventTransferTable and ...Line classes, another using the TransferOrderCreateService service. None will give you much competitive advantage, if working from within AX.
The InventDim (see white paper) contains the inventory, storage, and tracking dimensions of the item. You will need to set more fields if the item requires it as specified on the item and product.
Product dimensions. Item dimensions, color, size and configuration.
Storage dimensions. These are Site, Warehouse, Location, and Pallet.
Tracking dimensions. These are Batch number and Serial number.
A shipment is a two-step thing. First you ship the item from the source site/warehouse. Later you receive the item at the target site/warehouse.
The QtyRemainShipand QtyRemainReceive fields represents the quantity remaining for each step.

Resources