What Happened to UnitPrice in Intuit.Ipp.Data.Qbd? - intuit-partner-platform

Sorry, this gets curiouser and curiouser: I just updated my IPP in NuGet (VS2010) and now the UnitPrice property has disappeared from Intuit.Ipp.Data.Qbd.Item. It's in the SDK Docs and it's in the online docs, just not in the DLL.
I'll always admit it COULD be me, but I'd sure like to know how. :)
Any help appreciated (I'll submit a Support Ticket on Monday if I can't get this straightened out over the weekend).

Intuit.Ipp.Data.Qbd.Item item = new Intuit.Ipp.Data.Qbd.Item();
//Set UnitPrice
Intuit.Ipp.Data.Qbd.Money unitPrice = new Intuit.Ipp.Data.Qbd.Money();
unitPrice.Amount = 22;
unitPrice.AmountSpecified = true;
item.Item1 = unitPrice;

Related

Backendless API documentation incorrect?

Here is the code:
let queryBuilder = DataQueryBuilder()
queryBuilder.setWhereClause(whereClause: "age = 47") <---but this doesn't exist in the code.
The "setWhereClause" is not a member of queryBuilder. Is there updated documentation somewhere?
is there something wrong in my pod? I just verified I have the latest version.
I got it to work with this statement:
queryBuilder.whereClause = "age = '47'"
I wish they would update their tuts.

Set item email field in Podio

I'm having a hard time trying to guess how to set the item email field value, since there is nothing about this in the documentation (http://podio.github.io/podio-php/fields/)
I have tried :
$item->fields['email']->values = array("type"=>"work","value"=>"a#a.com");
$item->fields['email']->values = array("value"=>"a#a.com");
$item->fields['email']->values = "a#a.com";
$item->fields[$field_id]->value ="i#i.com";
$item->fields[$field_id]->type ="work";
$item->save();
Nothing works, please help! Thank you!
I have figured it out , here is the code that works (if anyone runs into the same problem)
$field_id = 'email';
$emails=$item->fields[$field_id]->values;
$item->fields[$field_id]->values =array('value'=>"i#oooo.com",'type'=>'work');
$item->save();

How to read UnitPrice from invoice line in QBO API v3 .NET

The bizarre properties in the .NET SDK continue to baffle me. How do I read the UnitPrice from an invoice line?
If I do this:
sild = (SalesItemLineDetail)line.AnyIntuitObject;
ln = new QBInvoiceLine(); // My internal line item class
ln.Description = line.Description;
ln.ItemRef = new QBRef() { Id = sild.ItemRef.Value, Name = sild.ItemRef.name };
if (sild.QtySpecified)
ln.Quantity = sild.Qty;
else
ln.Quantity = 0;
if (sild.ItemElementName == ItemChoiceType.UnitPrice)
ln.Rate = (decimal)sild.AnyIntuitObject; // Exception thrown here
The last line throws an invalid cast exception, even though the debugger shows that the value is 20. I've tried other types but get the same exception no matter what I do. So I finally punted and am calculating the rate like so:
ln.Rate = line.Amount / ln.Quantity;
(With proper rounding and checking for divide by zero, of course)
While we're on the subject... I noticed that in many cases ItemElementName == ItemChoiceType.PriceLevelRef. What's up with that? As far as I know, QBO doesn't support price levels, and I certainly wasn't using a price level with this invoice or customer. In this case I was also able to get what I needed from the Amount property.
Try this-
SalesItemLineDetail a1 = (SalesItemLineDetail)invoice11.Line[0].AnyIntuitObject;
object unitprice = a1.AnyIntuitObject;
decimal quantity = a1.Qty;
PriceLevelRef as an 'entity' is not supported. This means CRUD operations are not supported on this entity.
The service might however be returning readonly values in the transactions sometimes, but since this not mentioned in the docs, please consider it as unsupported.
Check that both request/response are in either json or xml format-
You can use the following code to set that-
ServiceContext context = new ServiceContext(appToken, realmId, intuitServiceType, reqvalidator);
context.IppConfiguration.Message.Request.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json;
context.IppConfiguration.Message.Response.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json;
Also, in QBO UI, check if Company->sales settings has Track Quantity and Price/rate turned on.

Read emails on specific date using google app script

Hello guys I am working on a project where I want to read emails from gmail inbox on a specific date. I have referred the official documentation but it hasn't been much helpful to me.
var master = SpreadsheetApp.openById(<SPREADSHEET_ID>);
var demosheet = master.getSheetByName("demo");
var newDate = Utilities.formatDate(new Date(), "GMT+5:30", "dd/MM/YYYY");
var getdate = demosheet.getDataRange().getValues();
var firstThread = GmailApp.getInboxThreads(0,1)[0];
//to get date from spreadshet
for(i=2;i<getdate.length;i++)
{
Logger.log(firstThread.getLastMessageDate(getdate[i][0])); }}
Can anyone please help, thanks in advance.
Look at GmailApp.search. Google for search format as its not in the docs. Probably uses syntax 'before:x after:y
https://developers.google.com/apps-script/reference/gmail/gmail-app?hl=ja#search(String,Integer,Integer)

How to get the current courseid for the current page in moodle

i have an addres moodle/course/modedit.php?add=page&type=&course=4&section=1&return=0&sr=0 in moodle. How can i get the courseid that is 4? I tried $COURSE->id but it doesnot worked.
Please help me with the solution.
Could you show the code?
You could try
$courseid = $PAGE->course->id
or
$courseid = optional_param('course', null, PARAM_INT);
make sure that you are using global $COURSE firstly.
function getCourses(){
global $COURSE;
echo $COURSE->id;
}