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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Users Online
Currently online: 345 members 5,318 guests
Recent signins:
Please welcome our newest community members: