cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aboodhamwi
Level: Powered On

Creating Quote In CDS with PowerApps

Hi,

I'm trying to create q quote record in the CDS using the Patch function, my problem with the customer field, I'm getting this error 

{
    "error": {
        "code": "0x0",
        "message": "An error occurred while validating input parameters: Microsoft.OData.ODataException: A property '_customerid_value' which only has property annotations in the payload but no property value is declared to be of type 'Edm.Guid'. In OData, only navigation properties and named streams can be represented as properties without values.\r\n   at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithoutValue(IODataJsonLightReaderResourceState resourceState, String propertyName)\r\n   at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.<ReadResourceContent>b__0(PropertyParsingResult propertyParsingResult, String propertyName)\r\n   at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func`2 readPropertyAnnotationValue, Action`2 handleProperty)\r\n   at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState)\r\n   at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtNestedResourceInfoEndImplementationSynchronously()\r\n   at Microsoft.OData.ODataReaderCore.ReadImplementation()\r\n   at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n   at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)\r\n   at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n   at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)"
    }
}

the customer field is from type Polymorphic, i already check "Relational data, option sets, and other new features for CDS" as i need to load Many-To-Many records.

this is my patch function

 

Patch(
        Quotes,
        Defaults(Quotes),
        {
            name: Concatenate(
                "Item Quote for ",
                SelectedCustomer.name
            ),
            quotenumber: "-",
            pricelevelid: newItemQuote_Step1_cboxPriceList.Selected,
            ets_requireapproval: true,
            _customerid_value: SelectedCustomer,
            msdyn_account: SelectedCustomer,
            ets_AttentionTo: SelectedPraimryContact,
            effectivefrom: Today(),
            effectiveto: DateAdd(
                Today(),
                30,
                Days
            ),
            ets_agreementwillhavedifferentenddate: false,
            ets_customerwillowntheasset: false,
            ets_digitaldocumentaccepted: true,
            ets_duration: 0,
            ets_informationcreatedinresco: true,
            ets_isrenewalquote: false,
            ets_serviceduringoperationhours: true,
            ets_terminationcondition: false,
            msdyn_ordertype: 'Order Type (Quotes)'.'Item based',
            ets_quotationtype: 'Quotation Types'.'Item Quotation'
        }
    )

any ideas

 

1 ACCEPTED SOLUTION

Accepted Solutions
BenDenBlanken
Level: Powered On

Re: Creating Quote In CDS with PowerApps

Hi,

 

I came across this error as well when writing my blog about embedded canvas app. I couldn’t set the customer field on a task activity record. What I did is first create the record, set that record as a variable and then use Relate to set the customer field.

See this screenshot below, where ModelDrivenFormIntegration.Item is a Case entity. The "Tasks" is the relationship name.

OnSelectScript.jpg

 

Let me know if this helps!

View solution in original post

2 REPLIES 2
BenDenBlanken
Level: Powered On

Re: Creating Quote In CDS with PowerApps

Hi,

 

I came across this error as well when writing my blog about embedded canvas app. I couldn’t set the customer field on a task activity record. What I did is first create the record, set that record as a variable and then use Relate to set the customer field.

See this screenshot below, where ModelDrivenFormIntegration.Item is a Case entity. The "Tasks" is the relationship name.

OnSelectScript.jpg

 

Let me know if this helps!

View solution in original post

aboodhamwi
Level: Powered On

Re: Creating Quote In CDS with PowerApps

Hi,

 

Thank you so much, that provide a solution for my problem, but the issue if you have any plugins for the Create event, we are waiting for Microsoft to provide a suitable solution for this issue

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (5,476)