cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Advocate I
Advocate I

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

3 REPLIES 3
Advocate I
Advocate I

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

Highlighted
Helper II
Helper II

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

Highlighted
Regular Visitor

Re: Creating Quote In CDS with PowerApps

Any joy so far? Did you hear from MS since you posted it here?

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (12,622)